summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance
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/conformance
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/conformance')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/00_test_list.txt19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/00_test_list.txt15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-aliasing.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html98
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-nonexistent-attribute.html82
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib-update.html79
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html79
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html136
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-context-switch.html60
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html89
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-unconsumed-out-of-bounds.html191
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html131
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html190
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html171
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt14
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html203
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-dynamic-delay.html114
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html104
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html107
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html119
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/buffers/vertex-buffer-updated-after-draw.html94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html195
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html204
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html171
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/render-after-resize-test.html142
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-after-composite.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html142
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html92
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/canvas/webgl-to-2d-canvas.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html546
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer-antialias.html143
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html281
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html166
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html287
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html379
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html92
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/deleted-object-behavior.html237
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html165
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html178
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html251
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js4
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html49
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/context/zero-sized-canvas.html59
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html723
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html225
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-color-buffer-half-float.html27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html312
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-float-blend.html98
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html289
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html468
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html341
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-bptc.html159
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html162
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html99
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html220
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html428
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-fbo-render-mipmap.html92
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html444
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html426
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html474
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html194
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html780
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/s3tc-and-rgtc.html1066
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-astc.html2524
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html126
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc1.html74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html371
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html912
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html104
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html144
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html377
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-broadcast-return.html138
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html126
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html118
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html812
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-multi-draw.html1064
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-webcodecs-video-frame.html211
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html96
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html96
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html141
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/assign-to-swizzled-twice-in-function.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html312
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/character-set.html115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html191
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html142
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-texture-fetch.html130
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html138
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html80
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html93
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/if-return-and-elseif.html65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/in-parameter-passed-as-inout-argument-and-global.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/init-array-with-loop.html84
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html86
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html136
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html89
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html136
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-struct-function-arg.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html113
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html84
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-with-single-member-constructor.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html100
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/unary-minus-operator-float-bug.html49
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html64
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/varying-arrays-should-not-be-reversed.html82
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-matrix-constructor-scalarization.html181
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop-complex.html80
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop.html99
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt14
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html195
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html95
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html95
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html98
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html95
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html59
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html99
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html88
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html90
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html87
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html59
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html61
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html70
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html96
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html97
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html61
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html70
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt126
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html89
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html244
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/fragcolor-fragdata-invariant.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html323
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html132
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html134
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html227
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs4
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html172
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/local-variable-shadowing-outer-function.html59
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html150
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sampler-operand.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html60
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html251
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html188
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html105
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html133
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html145
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html192
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html238
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html224
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html67
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-1-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-2-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-3-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-4-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-5-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-6-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-7-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-8-of-8.html31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html263
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html156
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html123
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html332
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html87
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html80
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html88
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html289
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html103
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html151
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-inout-parameter.html117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-out-parameter.html115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html214
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html217
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html70
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html64
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html67
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html86
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uninitialized-local-global-variables.html274
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/00_test_list.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/comments.html204
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/macro-expansion-tricky.html46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt4
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html101
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html162
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt6
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html185
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html84
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html86
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html141
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html106
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt6
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html86
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html105
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html90
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html134
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html100
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html64
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html223
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html104
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/hint.html124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html170
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html89
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html443
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html340
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html151
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html262
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific-stencil-settings.html299
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/README.md53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html378
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html378
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html378
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B1.js61
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B2.js154
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B4.js71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js119
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js235
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-G_I.js124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-L_S.js122
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js212
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html576
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html350
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html180
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js414
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html82
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html165
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html73
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html58
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html79
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html88
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html121
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html96
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html110
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html122
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html61
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html87
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html113
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html105
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html149
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html70
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html114
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html160
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html143
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html100
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html105
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html101
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html121
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html97
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html258
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html196
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/index.html75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js970
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/more/util.js1287
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/00_test_list.txt12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-attribute-preserve-drawing-buffer.html93
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.js13
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation.html37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.html43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.js51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored.html88
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.html43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.js35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost.html69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.js13
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods.html36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-resize.html93
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-timer-query.html84
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-transfer-image-bitmap.html50
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/00_test_list.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag130
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag166
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html201
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag93
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag129
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag165
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag133
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert133
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag161
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag186
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert161
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert185
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert421
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert654
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag64
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag136
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert149
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag115
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert14
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert14
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert11
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert13
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert13
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag64
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag60
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag60
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert13
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert86
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html181
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert124
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert128
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag118
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert118
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag119
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert119
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert70
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html90
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag15
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt7
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag59
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert56
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag75
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert74
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html181
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html343
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html159
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag61
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert61
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt5
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_vert.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_frag.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_vert.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/input.run.txt4
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag84
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag120
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag156
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag99
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert102
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert37
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert53
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag54
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert57
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html135
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt4
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html231
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html313
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag32
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert34
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert28
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert144
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert132
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag14
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert23
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert18
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert16
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert21
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag14
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag17
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag22
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag66
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert19
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md20
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt64
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js791
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py568
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt12
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html119
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html153
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html139
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html85
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html136
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html48
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/program-handling.html142
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html62
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html406
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt3
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/reading/fbo-remains-unchanged-after-read-pixels.html105
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html251
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html428
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/depth-renderbuffer-initialization.html132
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html104
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html678
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html176
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html99
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/stencil-renderbuffer-initialization.html132
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/bind-framebuffer-flush-bug.html146
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/blending.html266
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/canvas-alpha-bug.html116
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-after-copyTexImage2D.html64
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-default-framebuffer-with-scissor-test.html68
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-preserved-during-implicit-clears.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-should-not-affect-antialiased-framebuffer-resolution.html71
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html127
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-webgl-to-canvas-2d-repeatedly.html91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html114
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-clear.html97
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html87
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html67
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html82
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html97
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html121
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html95
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html112
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html229
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-rendering-quality.html27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html138
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html123
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html98
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-array-buffers.html126
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html136
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html55
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html129
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html166
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html119
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html173
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/preservedrawingbuffer-leak.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-sampling-feedback-loop.html183
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-stencil-large-viewport.html92
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/scissor-rect-repeated-rendering.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html77
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/texture-switch-performance.html101
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html73
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt9
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/fb-attach-implicit-target-assignment.html94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html171
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html29
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html198
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html60
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html58
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html86
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt14
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-alpha-alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance-luminance-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-alpha-alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance-luminance-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-alpha-alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance-luminance-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-alpha-alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance-luminance-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-alpha-alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance-luminance-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-alpha-alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance-luminance-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-alpha-alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance-luminance-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-alpha-alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance-luminance-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-alpha-alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance-luminance-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-alpha-alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance-luminance-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt58
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/canvas-teximage-after-multiple-drawimages.html100
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html173
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html137
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-crash.html69
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-large-partial-copy-corruption.html65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-subrects.html170
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-map-uploads-out-of-order.html90
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html42
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html167
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/format-filterable-renderable.html378
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html27
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html96
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html406
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance-offscreencanvas.html125
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html137
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/png-image-types.html164
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html304
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html51
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html78
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html722
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html158
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html133
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html101
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html191
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html129
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html210
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html179
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html176
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html43
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html63
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-and-deletion.html91
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html82
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-corner-case-videos.html47
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html65
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html103
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html94
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html274
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html117
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html297
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html160
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html305
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html331
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html167
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html217
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html253
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html316
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html87
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html52
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html151
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-video-transparent.html164
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-with-flip-y-and-premultiply-alpha.html72
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/upload-from-srcset-with-empty-data.html44
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/video-rotation.html167
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-alpha-alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance-luminance-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-alpha-alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance-luminance-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt8
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-alpha-alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance-luminance-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html38
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt7
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html40
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html41
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html102
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html1103
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html33
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html421
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html257
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-get-uniform-non-current-program.html79
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html738
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html59
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html83
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html114
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html149
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html67
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-00.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-01.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-02.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-03.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-04.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-05.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-06.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-07.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-08.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-09.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-10.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-11.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-12.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-13.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-14.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-15.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-16.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-17.html39
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html81
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html168
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html339
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html96
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html111
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html179
2546 files changed, 157749 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/00_test_list.txt
new file mode 100644
index 0000000000..96a88cac2a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/00_test_list.txt
@@ -0,0 +1,19 @@
+attribs/00_test_list.txt
+buffers/00_test_list.txt
+canvas/00_test_list.txt
+context/00_test_list.txt
+extensions/00_test_list.txt
+glsl/00_test_list.txt
+limits/00_test_list.txt
+misc/00_test_list.txt
+--min-version 1.0.2 ogles/00_test_list.txt
+--min-version 1.0.4 offscreencanvas/00_test_list.txt
+programs/00_test_list.txt
+reading/00_test_list.txt
+renderbuffers/00_test_list.txt
+rendering/00_test_list.txt
+state/00_test_list.txt
+textures/00_test_list.txt
+typedarrays/00_test_list.txt
+uniforms/00_test_list.txt
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/00_test_list.txt
new file mode 100644
index 0000000000..317fe70233
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/00_test_list.txt
@@ -0,0 +1,15 @@
+--min-version 1.0.3 gl-bindAttribLocation-aliasing.html
+--min-version 1.0.3 gl-bindAttribLocation-matrix.html
+--min-version 1.0.4 gl-bindAttribLocation-nonexistent-attribute.html
+--min-version 1.0.4 gl-bindAttribLocation-repeated.html
+--min-version 1.0.2 gl-disabled-vertex-attrib.html
+--min-version 1.0.4 gl-disabled-vertex-attrib-update.html
+gl-enable-vertex-attrib.html
+--min-version 1.0.3 gl-matrix-attributes.html
+--max-version 1.9.9 gl-vertex-attrib.html
+gl-vertexattribpointer.html
+gl-vertexattribpointer-offsets.html
+--min-version 1.0.2 gl-vertex-attrib-render.html
+gl-vertex-attrib-zero-issues.html
+--min-version 1.0.4 gl-vertex-attrib-unconsumed-out-of-bounds.html
+--min-version 1.0.4 gl-vertex-attrib-context-switch.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-aliasing.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-aliasing.html
new file mode 100644
index 0000000000..aae54715dc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-aliasing.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/gl-bindattriblocation-aliasing.js"></script>
+<title>bindAttribLocation with aliasing</title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<script id="vertexShader" type="text/something-not-javascript">
+precision mediump float;
+attribute $(type_1) a_1;
+attribute $(type_2) a_2;
+void main() {
+ gl_Position = $(gl_Position_1) + $(gl_Position_2);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies combinations of valid, active attribute types cannot be bound to the same location with bindAttribLocation.");
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+var glFragmentShader = wtu.loadShader(gl, wtu.simpleColorFragmentShader, gl.FRAGMENT_SHADER);
+
+runBindAttribLocationAliasingTest(wtu, gl, glFragmentShader, wtu.getScript('vertexShader'));
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html
new file mode 100644
index 0000000000..ef5fd25b19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-matrix.html
@@ -0,0 +1,98 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>WebGL bindAttribLocation with Matrix Attributes Conformance Test</title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<script>
+"use strict";
+description("This test verifies that vectors placed via bindAttribLocation right after matricies will fail if there is insufficient room for the matrix.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+
+// Make sure we have room for at least a mat4.
+var maxAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
+debug('MAX_VERTEX_ATTRIBUTES is ' + maxAttributes);
+shouldBeGreaterThanOrEqual('maxAttributes', '4');
+
+var glFragmentShader = wtu.loadShader(gl, wtu.simpleColorFragmentShader, gl.FRAGMENT_SHADER);
+
+// Given a matrix dimension, load a vertex shader with a matrix of that dimension
+// and a vector. Ensure that both the vector and matrix are active attributes.
+// Return the compiled vertex shader.
+function loadVertexShader(numMatrixDimensions) {
+ var strVertexShader =
+ 'attribute mat' + numMatrixDimensions + ' matrix;\n' +
+ 'attribute vec' + numMatrixDimensions + ' vector;\n' +
+ 'void main(void) { gl_Position = vec4(vector*matrix';
+ // Ensure the vec4 has the correct number of dimensions in order to be assignable
+ // to gl_Position.
+ for (var ii = numMatrixDimensions; ii < 4; ++ii) {
+ strVertexShader += ",0.0";
+ }
+ strVertexShader += ");}\n";
+ return wtu.loadShader(gl, strVertexShader, gl.VERTEX_SHADER);
+}
+
+// Given a vertex shader, matrix location and vector location, create and link
+// a program with glFragmentShader and a vertex shader returned by loadVertexShader
+// attached. Bind the matrix to matrixLocation and the vector to vectorLocation.
+// Return whether the link was successful.
+function createAndLinkProgram(glVertexShader, matrixLocation, vectorLocation) {
+ var glProgram = gl.createProgram();
+ gl.bindAttribLocation(glProgram, matrixLocation, 'matrix');
+ gl.bindAttribLocation(glProgram, vectorLocation, 'vector');
+ gl.attachShader(glProgram, glVertexShader);
+ gl.attachShader(glProgram, glFragmentShader);
+ gl.linkProgram(glProgram);
+ return gl.getProgramParameter(glProgram, gl.LINK_STATUS);
+}
+
+// For each matrix dimension (mat2, mat3 and mat4)
+for (var mm = 2; mm <= 4; ++mm) {
+ debug('Testing ' + mm + ' dimensional matrices');
+ var glVertexShader = loadVertexShader(mm);
+ // Per the WebGL spec: "LinkProgram will fail if the attribute bindings assigned
+ // by bindAttribLocation do not leave enough space to assign a location for an
+ // active matrix attribute which requires multiple contiguous generic attributes."
+ // We will test this by placing the vector after the matrix attribute such that there
+ // is not enough room for the matrix. Vertify the link operation fails.
+
+ // Run the test for each available attribute slot. Go to maxAttributes-mm to leave enough room
+ // for the matrix itself. Leave another slot open for the vector following the matrix.
+ for (var pp = 0; pp <= maxAttributes - mm - 1; ++pp) {
+ // For each matrix dimension, bind the vector right after the matrix such that we leave
+ // insufficient room for the matrix. Verify doing this will fail the link operation.
+ for (var ll = 0; ll < mm; ++ll) {
+ var vectorLocation = pp + ll;
+ assertMsg(!createAndLinkProgram(glVertexShader, /*matrixLocation*/pp, vectorLocation),
+ "Matrix with location " + pp + " and vector with location " + vectorLocation + " should not link.");
+ }
+ // Ensure that once we have left enough room for the matrix, the program links successfully.
+ var vectorLocation = pp + ll;
+ assertMsg(createAndLinkProgram(glVertexShader, /*matrixLocation*/pp, vectorLocation),
+ "Matrix with location " + pp + " and vector with location " + vectorLocation + " should link.");
+ debug('');
+ }
+ debug('');
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-nonexistent-attribute.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-nonexistent-attribute.html
new file mode 100644
index 0000000000..d6968b5ea4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-nonexistent-attribute.html
@@ -0,0 +1,82 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>bindAttribLocation with nonexistent attribute name</title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="8" height="8"></canvas>
+<script id="vertexShader" type="text/something-not-javascript">
+precision highp float;
+attribute vec4 attr;
+void main() {
+ gl_Position = vec4(attr);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies that calling bindAttribLocation with a non-existent attribute location is fine.");
+
+// OpenGL ES 2.0.25 section 2.10 page 34.
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var fragmentShader = wtu.loadShader(gl, wtu.simpleColorFragmentShader, gl.FRAGMENT_SHADER);
+var vertexShader = wtu.loadShaderFromScript(gl, 'vertexShader', gl.VERTEX_SHADER);
+assertMsg(vertexShader != null, "Vertex shader compiled successfully.");
+
+var checkAttribLocation = function(program, expectedLocation) {
+ var location = gl.getAttribLocation(program, 'attr');
+ if (location != expectedLocation) {
+ testFailed('Unexpected location for attr: ' + location);
+ } else {
+ testPassed('Location of attr is: ' + location);
+ }
+}
+
+var testProgramNonExistentAttributeBound = function() {
+ var program = gl.createProgram();
+ gl.bindAttribLocation(program, 0, 'attr');
+ gl.bindAttribLocation(program, 1, 'bogus_attr');
+ gl.attachShader(program, vertexShader);
+ gl.attachShader(program, fragmentShader);
+ gl.linkProgram(program);
+ var linkStatus = gl.getProgramParameter(program, gl.LINK_STATUS);
+ expectTrue(linkStatus, "Link should succeed even if a non-existent attribute is bound.");
+ if (linkStatus) {
+ checkAttribLocation(program, 0);
+ }
+};
+var testProgramNonExistentAttributeOverlap = function() {
+ var program = gl.createProgram();
+ gl.bindAttribLocation(program, 1, 'attr');
+ gl.bindAttribLocation(program, 1, 'bogus_attr');
+ gl.attachShader(program, vertexShader);
+ gl.attachShader(program, fragmentShader);
+ gl.linkProgram(program);
+ var linkStatus = gl.getProgramParameter(program, gl.LINK_STATUS);
+ expectTrue(linkStatus, "Link should succeed even if a non-existent attribute is bound to the same location as an attribute that's present in the shader text.");
+ if (linkStatus) {
+ checkAttribLocation(program, 1);
+ }
+};
+
+testProgramNonExistentAttributeBound();
+testProgramNonExistentAttributeOverlap();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html
new file mode 100644
index 0000000000..cfbea4fb63
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-bindAttribLocation-repeated.html
@@ -0,0 +1,68 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Repeated BindAttribLocation 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 vPosition;
+ void main()
+ {
+ gl_Position = vPosition;
+ }
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+ void main()
+ {
+ gl_FragColor = vec4(0.0,1.0,0.0,1.0);
+ }
+</script>
+
+<script>
+"use strict";
+description("Test repeated loading of programs involving bindAttribLocation calls");
+debug("Regression test for <a href='https://code.google.com/p/chromium/issues/detail?id=510637'>crbug.com/510637</a>");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var g_program;
+var g_attribLocation;
+function setup(attribIndex) {
+ var program = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition'], [attribIndex]);
+ g_program = program;
+ g_attribLocation = attribIndex;
+ shouldBe("gl.getAttribLocation(g_program, 'vPosition')", "g_attribLocation");
+ return program;
+}
+
+var p0 = setup(0);
+var p3 = setup(3);
+var p1 = setup(1);
+// This call fails the getAttribLocation check on some drivers when
+// Chrome's program binary cache is enabled. On the affected drivers,
+// it returns the bound attribute location from the first binary
+// created. Swapping 0 and 1 above will cause it to return 1 rather
+// than 0.
+p3 = setup(3);
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib-update.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib-update.html
new file mode 100644
index 0000000000..3ef12fb9aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib-update.html
@@ -0,0 +1,79 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Disabled Vertex Attrib Update 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+attribute float a_actualValue;
+uniform float u_expectedValue;
+varying float v_result;
+void main() {
+ gl_Position = a_position;
+ v_result = a_actualValue == u_expectedValue ? 1.0 : 0.0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying float v_result;
+void main() {
+ gl_FragColor = v_result > 0.0 ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script>
+// Tests that repeatedly updating a disabled vertex attribute works as expected.
+// This covers an ANGLE bug where dirty bits for current values were ignoring repeated updates.
+// Based on ANGLE test (VertexAttributeTest, DisabledAttribUpdates) from https://github.com/google/angle/blob/f7f0b8c3ab21c52cc2915048959361cf628d95f0/src/tests/gl_tests/VertexAttributeTest.cpp
+"use strict";
+var wtu = WebGLTestUtils;
+description();
+
+var gl = wtu.create3DContext("example");
+
+var program = wtu.setupProgram(gl, ['vshader', 'fshader']);
+gl.useProgram(program);
+
+var positionLocation = gl.getAttribLocation(program, "a_position");
+var attribLoc = gl.getAttribLocation(program, "a_actualValue");
+gl.vertexAttribPointer(attribLoc, 1, gl.FLOAT, gl.FALSE, 0, 0);
+
+var uniLoc = gl.getUniformLocation(program, "u_expectedValue");
+
+var gridRes = 1;
+wtu.setupIndexedQuad(gl, gridRes, positionLocation);
+
+var testValues = [1, 2, 3, 4];
+for (var i = 0; i < testValues.length; ++i) {
+ var testValue = testValues[i];
+ gl.uniform1f(uniLoc, testValue);
+ gl.vertexAttrib1f(attribLoc, testValue);
+ wtu.clearAndDrawIndexedQuad(gl, gridRes);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html
new file mode 100644
index 0000000000..f4f8997449
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-disabled-vertex-attrib.html
@@ -0,0 +1,79 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Disabled Vertex Attrib 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+attribute vec4 a_color;
+varying vec4 v_color;
+bool isCorrectColor(vec4 v) {
+ return v.x == 0.0 && v.y == 0.0 && v.z == 0.0 && v.w == 1.0;
+}
+void main() {
+ gl_Position = a_position;
+ v_color = isCorrectColor(a_color) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main() {
+ gl_FragColor = v_color;
+}
+</script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description();
+
+var gl = wtu.create3DContext("example");
+
+var numVertexAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
+for (var ii = 0; ii < numVertexAttribs; ++ii) {
+ var colorLocation = (ii + 1) % numVertexAttribs;
+ var positionLocation = colorLocation ? 0 : 1;
+
+ if (positionLocation != 0) {
+ // We need to create a new 3d context for testing attrib 0
+ // since we've already effected attrib 0 on other tests.
+ gl = wtu.create3DContext();
+ }
+
+ debug("testing attrib: " + colorLocation);
+ var program = wtu.setupProgram(
+ gl,
+ ['vshader', 'fshader'],
+ ['a_position', 'a_color'],
+ [positionLocation, colorLocation]);
+ var gridRes = 1;
+ wtu.setupIndexedQuad(gl, gridRes, positionLocation);
+ wtu.clearAndDrawIndexedQuad(gl, gridRes);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html
new file mode 100644
index 0000000000..6425a33a7a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-enable-vertex-attrib.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+<meta charset="utf-8">
+ <title>WebGL Enable Vertex Attrib 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="../../js/tests/invalid-vertex-attrib-test.js"></script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("tests that turning on attribs that have no buffer bound fails to draw");
+const wtu = WebGLTestUtils;
+const gl = wtu.create3DContext("example");
+
+async function runInvalidAttribTests() {
+ const invalidAttribTestFn = createInvalidAttribTestFn(gl);
+
+ function drawArrays(gl) {
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+
+ function drawElements(gl) {
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ }
+
+ await invalidAttribTestFn(drawArrays);
+ await invalidAttribTestFn(drawElements);
+ finishTest();
+}
+runInvalidAttribTests();
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html
new file mode 100644
index 0000000000..fc7ab56b0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-matrix-attributes.html
@@ -0,0 +1,136 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>WebGL Matrix Attribute Conformance Test</title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<script>
+"use strict";
+description("This tests ensures that matrix attribute locations do not clash with other shader attributes.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+
+// Make sure we have room for at least a mat4.
+var maxAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
+debug('MAX_VERTEX_ATTRIBUTES is ' + maxAttributes);
+shouldBeGreaterThanOrEqual('maxAttributes', '4');
+
+var glFragmentShader = wtu.loadShader(gl, wtu.simpleColorFragmentShader, gl.FRAGMENT_SHADER);
+
+// prepareMatrixProgram creates a program with glFragmentShader as the fragment shader.
+// The vertex shader has numVector number of vectors and a matrix with numMatrixDimensions
+// dimensions at location numMatrixPosition in the list of attributes.
+// Ensures that every vector and matrix is used by the program.
+// Returns a valid program on successfull link; null on link failure.
+function prepareMatrixProgram(numVectors, numMatrixDimensions, numMatrixPosition) {
+ // Add the matrix and vector attribute declarations. Declare the vectors
+ // to have the same number of components as the matrix so we can perform
+ // operations on them when we assign to gl_Position later on.
+ var strVertexShader = "";
+ for (var ii = 1; ii <= numVectors; ++ii) {
+ if (numMatrixPosition === ii) {
+ strVertexShader += "attribute mat" + numMatrixDimensions + " matrix;\n";
+ }
+ strVertexShader += "attribute vec" + numMatrixDimensions + " vec_" + ii + ";\n";
+ }
+ // numMatrixPosition will be one past numVectors if the caller wants it to be
+ // last. Hence, we need this check outside the loop as well as inside.
+ if (numMatrixPosition === ii) {
+ strVertexShader += "attribute mat" + numMatrixDimensions + " matrix;\n";
+ }
+ // Add the body of the shader. Add up all of the vectors and multiply by the matrix.
+ // The operations we perform do not matter. We just need to ensure that all the vector and
+ // matrix attributes are used.
+ strVertexShader += "void main(void) { \ngl_Position = vec4((";
+ for (var ii = 1; ii <= numVectors; ++ii) {
+ if (ii > 1) {
+ strVertexShader += "+"
+ }
+ strVertexShader += "vec_" + ii;
+ }
+ strVertexShader += ")*matrix";
+ // Ensure the vec4 has the correct number of dimensions in order to be assignable
+ // to gl_Position.
+ for (var ii = numMatrixDimensions; ii < 4; ++ii) {
+ strVertexShader += ",0.0";
+ }
+ strVertexShader += ");}\n";
+ // Load the shader, attach it to a program, and return the link results
+ var glVertexShader = wtu.loadShader(gl, strVertexShader, gl.VERTEX_SHADER);
+ var strTest = 'Load shader with ' + numVectors + ' vectors and 1 matrix';
+ if (glVertexShader !== null) {
+ testPassed(strTest);
+
+ var glProgram = gl.createProgram();
+ gl.attachShader(glProgram, glVertexShader);
+ gl.attachShader(glProgram, glFragmentShader);
+ gl.linkProgram(glProgram);
+ if (gl.getProgramParameter(glProgram, gl.LINK_STATUS)) {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'linkProgram');
+ return glProgram;
+ }
+ } else {
+ testFailed(strTest);
+ }
+ return null;
+}
+
+debug('');
+
+// Test mat2, mat3 and mat4.
+for (var mm = 2; mm <= 4; ++mm) {
+ // Add maxAttribute number of attributes by saving enough room in the attribute
+ // list for a matrix of mm dimensions. All of the other attribute slots will be
+ // filled with vectors.
+ var numVectors = maxAttributes - mm;
+ for (var pp = 1; pp <= numVectors + 1; ++pp) {
+ debug('Test ' + mm + ' dimensional matrix at position ' + pp);
+ var glProgram = prepareMatrixProgram(numVectors, /*numMatrixDimensions*/mm, /*numMatrixPosition*/pp);
+ shouldBeNonNull('glProgram');
+ var attribMatrix = gl.getAttribLocation(glProgram, 'matrix');
+ debug('Matrix is at attribute location ' + attribMatrix);
+ shouldBeTrue('attribMatrix > -1');
+ // Per the spec, when an attribute is a matrix attribute, getAttribLocation
+ // returns the index of the first component of the matrix. The implementation must
+ // leave sufficient room for all the components. Here we ensure none of the vectors
+ // in the shader are assigned attribute locations that belong to the matrix.
+ for (var vv = 1; vv <= numVectors; ++vv) {
+ var strVector = 'vec_' + vv
+ var attribVector = gl.getAttribLocation(glProgram, strVector);
+ debug(strVector + ' is at attribute location ' + attribVector);
+ // Begin with the first attribute location where the matrix begins and ensure
+ // the vector's attribute location is not assigned to the matrix. Loop until
+ // we've checked all of the attribute locations that belong to the matrix.
+ for (var ii = attribMatrix; ii < attribMatrix + mm; ++ii) {
+ var testStr = strVector + ' attribute location: ' + attribVector + '. Should not be ' + ii;
+ if (attribVector !== ii) {
+ testPassed(testStr);
+ } else {
+ testFailed(testStr);
+ }
+ }
+ }
+ debug('');
+ }
+ debug('');
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-context-switch.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-context-switch.html
new file mode 100644
index 0000000000..1db1c9a321
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-context-switch.html
@@ -0,0 +1,60 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+<meta charset="utf-8">
+ <title>WebGL Vertex Attrib Context Switch 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>
+</head>
+<body>
+<canvas id="one" width="50" height="50">
+</canvas>
+<canvas id="two" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("tests that vertex attrib value is preserved across context switches");
+var wtu = WebGLTestUtils;
+var positionLocation = 0;
+var colorLocation = 1;
+var gridRes = 1;
+
+var canvas1 = document.getElementById("one");
+var gl1 = wtu.create3DContext(canvas1);
+var program1 = wtu.setupSimpleVertexColorProgram(gl1, positionLocation, colorLocation);
+gl1.vertexAttrib4f(colorLocation, 0.0, 1.0, 0.0, 1.0);
+wtu.setupIndexedQuad(gl1, gridRes, positionLocation);
+wtu.clearAndDrawIndexedQuad(gl1, gridRes);
+wtu.checkCanvas(gl1, [0, 255, 0, 255], "should be green 1");
+
+var canvas2 = document.getElementById("two");
+var gl2 = wtu.create3DContext(canvas2);
+var program2 = wtu.setupSimpleVertexColorProgram(gl2, positionLocation, colorLocation);
+wtu.setupIndexedQuad(gl2, gridRes, positionLocation);
+wtu.clearAndDrawIndexedQuad(gl2, gridRes);
+wtu.checkCanvas(gl2, [0, 0, 0, 255], "should be black 1");
+
+wtu.checkCanvas(gl1, [0, 255, 0, 255], "should be green 2");
+
+wtu.clearAndDrawIndexedQuad(gl2, gridRes);
+wtu.checkCanvas(gl2, [0, 0, 0, 255], "should be black 2");
+
+wtu.clearAndDrawIndexedQuad(gl1, gridRes);
+wtu.checkCanvas(gl1, [0, 255, 0, 255], "should be green 3");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html
new file mode 100644
index 0000000000..b10ebfe688
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-render.html
@@ -0,0 +1,89 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id='vshader' type='x-shader'>
+attribute vec4 a;
+attribute vec2 p;
+void main() {
+ gl_Position = vec4(p.x + a.x + a.y + a.z + a.w, p.y, 0.0, 1.0);
+}
+</script>
+<script id='fshader' type='x-shader'>
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+function checkRedPortion(gl, w, low, high) {
+ var buf = new Uint8Array(w * w * 4);
+ gl.readPixels(0, 0, w, w, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ var i = 0;
+ for (; i < w; ++i) {
+ if (buf[i * 4 + 0] == 255 && buf[i * 4 + 1] == 0 && buf[i * 4 + 2] == 0 && buf[i * 4 + 3] == 255) {
+ break;
+ }
+ }
+ return low <= i && i <= high;
+}
+
+function runTest() {
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext('testbed', { preserveDrawingBuffer : true });
+ if (!gl) {
+ testFailed('could not create context');
+ return;
+ }
+ var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['p', 'a'])
+
+ gl.enableVertexAttribArray(gl.p);
+ var pos = gl.createBuffer();
+ pos.type = gl.FLOAT;
+ pos.size = 2;
+ pos.num = 4;
+ gl.bindBuffer(gl.ARRAY_BUFFER, pos);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);
+
+ gl.vertexAttribPointer(0, pos.size, pos.type, false, 0, 0);
+
+ debug('Test vertexAttrib[1..4]fv by setting different combinations that add up to 1.5 and use that when rendering.');
+ var vals = [[0.5], [0.1,0.4], [0.2,-0.2,0.5], [-1.0,0.3,0.2,2.0]];
+
+ for (var j = 0; j < 4; ++j) {
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl['vertexAttrib' + (j+1) + 'fv'](1, vals[j]);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, pos.num);
+
+ if (checkRedPortion(gl, 50, 50 * 0.7, 50 * 0.8)) {
+ testPassed('Attribute of size ' + (j+1) + ' was set correctly');
+ } else {
+ testFailed('Attribute of size ' + (j+1) + ' was not set correctly');
+ }
+ }
+}
+</script>
+</head>
+<body>
+<canvas id="testbed" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verify that using constant attributes works.');
+runTest();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-unconsumed-out-of-bounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-unconsumed-out-of-bounds.html
new file mode 100644
index 0000000000..f704dd643b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-unconsumed-out-of-bounds.html
@@ -0,0 +1,191 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Unconsumed Vertex Attributes Out of Bounds 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+ void main() { }
+</script>
+
+<script id="vshader_attrib" type="x-shader/x-vertex">
+ attribute vec4 vPosition;
+ void main() {
+ gl_Position = vPosition;
+ }
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+ void main() {
+ gl_FragColor = vec4(1);
+ }
+</script>
+
+<script>
+"use strict";
+description("Test that unconsumed vertex attributes are not read out of bounds");
+// Tests for http://crbug.com/756293 (driver crash on macOS)
+// and a class of similar bugs that could exist on other systems.
+
+var wtu = WebGLTestUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var gl = wtu.create3DContext("example");
+var g_program;
+var g_attribLocation;
+
+var numAttribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
+var allocatedBuffer;
+var indexBuffer;
+
+function setupBuffers(numVerts) {
+ var vertices = new Float32Array(numVerts * 3);
+ allocatedBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, allocatedBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+
+ var indices = new Uint16Array(numVerts);
+ for (var ii = 0; ii < numVerts; ++ii) {
+ indices[ii] = ii;
+ }
+
+ indexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+}
+
+var progNoAttribs = wtu.setupProgram(gl, ['vshader', 'fshader'], [], []);
+var progAttrib1 = wtu.setupProgram(gl, ['vshader_attrib', 'fshader'], ['vPosition'], [1]);
+var progAttrib2 = wtu.setupProgram(gl, ['vshader_attrib', 'fshader'], ['vPosition'], [2]);
+setupBuffers(60000);
+
+var unallocatedBuffer = gl.createBuffer();
+var tests = [];
+
+debug("");
+debug("<u>Tests with one unconsumed attribute<u>");
+
+tests.push({
+ name: "drawArrays",
+ errors: gl.NO_ERROR,
+ draw: function() { gl.drawArrays(gl.TRIANGLES, 0, 3); }
+});
+tests.push({
+ name: "drawElements",
+ errors: gl.NO_ERROR,
+ draw: function() { gl.drawElements(gl.TRIANGLES, 60000, gl.UNSIGNED_SHORT, 0); }
+});
+
+if (contextVersion >= 2) {
+ tests.push({
+ name: "drawArraysInstanced",
+ errors: gl.NO_ERROR,
+ draw: function() { gl.drawArraysInstanced(gl.TRIANGLES, 0, 3, 1); }
+ });
+ tests.push({
+ name: "drawElementsInstanced",
+ errors: gl.NO_ERROR,
+ draw: function() { gl.drawElementsInstanced(gl.TRIANGLES, 60000, gl.UNSIGNED_SHORT, 0, 1); }
+ });
+ tests.push({
+ name: "drawRangeElements",
+ errors: gl.NO_ERROR,
+ draw: function() { gl.drawRangeElements(gl.TRIANGLES, 0, 60000, 60000, gl.UNSIGNED_SHORT, 0, 1); }
+ });
+}
+
+// Run tests
+
+// Bound forever
+gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+
+for (var attrib = 0; attrib < numAttribs; ++attrib) {
+ debug("Attrib " + attrib + " unconsumed");
+ for (var i = 0; i < tests.length; ++i) {
+ var test = tests[i];
+ gl.useProgram(progNoAttribs);
+
+ gl.enableVertexAttribArray(attrib);
+ gl.bindBuffer(gl.ARRAY_BUFFER, unallocatedBuffer);
+ gl.vertexAttribPointer(attrib, 3, gl.FLOAT, false, 0, 0);
+
+ test.draw();
+
+ gl.disableVertexAttribArray(attrib);
+ wtu.glErrorShouldBe(gl, test.errors, test.name);
+ }
+}
+
+debug("");
+debug("<u>Tests with one consumed attribute and one unconsumed attribute<u>");
+
+var ext = gl.getExtension("ANGLE_instanced_arrays");
+if (!ext) {
+ debug("ANGLE_instanced_arrays not available - skipped");
+} else {
+ tests.push({
+ name: "drawArraysInstancedANGLE",
+ errors: gl.NO_ERROR,
+ draw: function() {
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 3, 1);
+ }
+ });
+ tests.push({
+ name: "drawElementsInstancedANGLE",
+ errors: gl.NO_ERROR,
+ draw: function() {
+ ext.drawElementsInstancedANGLE(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0, 1);
+ }
+ });
+}
+
+// Note these don't trigger the macOS driver crash (http://crbug.com/756293)
+// but they still add potentially useful coverage.
+for (var attrib = 0; attrib < numAttribs; ++attrib) {
+ var consumedAttrib = attrib == 1 ? 2 : 1;
+ var prog = consumedAttrib == 1 ? progAttrib1 : progAttrib2;
+ debug("Attrib " + attrib +
+ " unconsumed (attrib " + consumedAttrib + " consumed)");
+
+ for (var i = 0; i < tests.length; ++i) {
+ var test = tests[i];
+ gl.useProgram(prog);
+
+ gl.enableVertexAttribArray(attrib);
+ gl.bindBuffer(gl.ARRAY_BUFFER, unallocatedBuffer);
+ gl.vertexAttribPointer(attrib, 3, gl.FLOAT, false, 0, 0);
+
+ // Needed because ANGLE_instanced_arrays requires at least one consumed
+ // attribute to have divisor=0 (which is the default, so we don't need to
+ // call vertexAttribDivisorANGLE here).
+ gl.enableVertexAttribArray(consumedAttrib);
+ gl.bindBuffer(gl.ARRAY_BUFFER, allocatedBuffer);
+ gl.vertexAttribPointer(consumedAttrib, 3, gl.FLOAT, false, 0, 0);
+
+ test.draw();
+
+ gl.disableVertexAttribArray(attrib);
+ gl.disableVertexAttribArray(consumedAttrib);
+ wtu.glErrorShouldBe(gl, test.errors, test.name);
+ }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html
new file mode 100644
index 0000000000..9de9439911
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib-zero-issues.html
@@ -0,0 +1,131 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Enable Vertex Attrib Zero 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 vPosition;
+ void main()
+ {
+ gl_Position = vPosition;
+ }
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+ void main()
+ {
+ gl_FragColor = vec4(0.0,1.0,0.0,1.0);
+ }
+</script>
+
+<script>
+"use strict";
+description("Test some of the issues of the difference between attrib 0 on OpenGL vs WebGL");
+debug("");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var g_program;
+var g_attribLocation;
+function setup(attribIndex) {
+ var program = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition'], [attribIndex]);
+ g_program = program;
+ g_attribLocation = attribIndex;
+ shouldBe("g_attribLocation", "gl.getAttribLocation(g_program, 'vPosition')");
+ return program;
+}
+
+function setupVerts(numVerts) {
+ var verts = [
+ 1.0, 1.0, 0.0,
+ -1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, -1.0, 0.0
+ ];
+ var positions = new Float32Array(numVerts * 3);
+ var indices = new Uint16Array(numVerts);
+ for (var ii = 0; ii < numVerts; ++ii) {
+ var ndx = ii % 6;
+ var dst = ii * 3;
+ var src = ndx * 3;
+ for (var jj = 0; jj < 3; ++jj) {
+ positions[dst + jj] = verts[src + jj];
+ }
+ indices[ii] = ii;
+ }
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
+ var indexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+}
+
+var p0 = setup(0);
+var p3 = setup(3);
+setupVerts(60000);
+
+for (var ii = 0; ii < 5; ++ii) {
+ // test drawing with attrib 0
+ gl.useProgram(p0);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawElements(gl.TRIANGLES, 60000, gl.UNSIGNED_SHORT, 0);
+ wtu.glErrorShouldBe(
+ gl, gl.NO_ERROR,
+ "drawing using attrib 0 with 6 verts");
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "canvas should be green");
+ gl.disableVertexAttribArray(0);
+
+ // test drawing without attrib 0
+ gl.useProgram(p3);
+ gl.enableVertexAttribArray(3);
+ gl.vertexAttribPointer(3, 3, gl.FLOAT, false, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 60000);
+ wtu.glErrorShouldBe(
+ gl, gl.NO_ERROR,
+ "drawing using attrib 3 with 60000 verts");
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "canvas should be green");
+ gl.disableVertexAttribArray(3);
+
+ // This second test of drawing without attrib0 uncovered a bug in chrome
+ // where after the draw without attrib0 the attrib 0 emulation code disabled
+ // attrib 0 and it was never re-enabled so this next draw failed.
+ gl.useProgram(p3);
+ gl.enableVertexAttribArray(3);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawElements(gl.TRIANGLES, 60000, gl.UNSIGNED_SHORT, 0);
+ wtu.glErrorShouldBe(
+ gl, gl.NO_ERROR,
+ "drawing using attrib 3 with 60000 verts");
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "canvas should be green");
+ gl.disableVertexAttribArray(3);
+}
+
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html
new file mode 100644
index 0000000000..aa69c5e7bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertex-attrib.html
@@ -0,0 +1,28 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL vertexAttrib Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../js/tests/gl-vertex-attrib.js"></script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html
new file mode 100644
index 0000000000..3cb8bd84a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer-offsets.html
@@ -0,0 +1,190 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+<meta charset="utf-8">
+ <title>vertexattribpointer offsets 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+ <script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 vPosition;
+ void main()
+ {
+ gl_Position = vPosition;
+ }
+ </script>
+
+ <script id="fshader" type="x-shader/x-fragment">
+ precision mediump float;
+ uniform vec4 color;
+ void main()
+ {
+ gl_FragColor = color;
+ }
+ </script>
+
+ <script>
+ "use strict";
+ function init()
+ {
+ description("test vertexattribpointer offsets work");
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+ var tests = [
+ { data: new Float32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+ type: gl.FLOAT,
+ componentSize: 4,
+ normalize: false,
+ },
+ { data: new Uint16Array([ 0, 32767, 0, 32767, 0, 0, 0, 0, 0]),
+ type: gl.SHORT,
+ componentSize: 2,
+ normalize: true,
+ },
+ { data: new Uint16Array([ 0, 65535, 0, 65535, 0, 0, 0, 0, 0 ]),
+ type: gl.UNSIGNED_SHORT,
+ componentSize: 2,
+ normalize: true,
+ },
+ { data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+ type: gl.UNSIGNED_SHORT,
+ componentSize: 2,
+ normalize: false,
+ },
+ { data: new Uint16Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+ type: gl.SHORT,
+ componentSize: 2,
+ normalize: false,
+ },
+ { data: new Uint8Array([ 0, 127, 0, 127, 0, 0, 0, 0, 0 ]),
+ type: gl.BYTE,
+ componentSize: 1,
+ normalize: true,
+ },
+ { data: new Uint8Array([ 0, 255, 0, 255, 0, 0, 0, 0, 0 ]),
+ type: gl.UNSIGNED_BYTE,
+ componentSize: 1,
+ normalize: true,
+ },
+ { data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+ type: gl.BYTE,
+ componentSize: 1,
+ normalize: false,
+ },
+ { data: new Uint8Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0 ]),
+ type: gl.UNSIGNED_BYTE,
+ componentSize: 1,
+ normalize: false,
+ }
+ ];
+
+ if (wtu.getDefault3DContextVersion() >= 2) {
+ tests.push(...[
+ { data: new Int32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0]),
+ type: gl.INT,
+ componentSize: 4,
+ normalize: false,
+ },
+ { data: new Int32Array([ 0, 2147483647, 0, 2147483647, 0, 0, 0, 0, 0]),
+ type: gl.INT,
+ componentSize: 4,
+ normalize: true,
+ },
+ { data: new Uint32Array([ 0, 1, 0, 1, 0, 0, 0, 0, 0]),
+ type: gl.UNSIGNED_INT,
+ componentSize: 4,
+ normalize: false,
+ },
+ { data: new Uint32Array([ 0, 4294967295, 0, 4294967295, 0, 0, 0, 0, 0]),
+ type: gl.UNSIGNED_INT,
+ componentSize: 4,
+ normalize: true,
+ },
+ { data: new Uint16Array([ 0, 0b11110000000000, 0, 0b11110000000000, 0, 0, 0, 0, 0]),
+ type: gl.HALF_FLOAT,
+ componentSize: 2,
+ normalize: false,
+ },
+ { data: new Uint16Array([ 0, 0b11110000000000, 0, 0b11110000000000, 0, 0, 0, 0, 0]),
+ type: gl.HALF_FLOAT,
+ componentSize: 2,
+ normalize: false,
+ }
+ ]);
+ }
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, 1024, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+
+ var colorLoc = gl.getUniformLocation(program, "color");
+ var kNumVerts = 3;
+ var kNumComponents = 3;
+
+ var count = 0;
+ for (var tt = 0; tt < tests.length; ++tt) {
+ var test = tests[tt];
+ for (var oo = 0; oo < 3; ++oo) {
+ for (var ss = 0; ss < 3; ++ss) {
+ var offset = (oo + 1) * test.componentSize;
+ var color = (count % 2) ? [1, 0, 0, 1] : [0, 1, 0, 1];
+ var stride = test.componentSize * kNumComponents + test.componentSize * ss;
+ debug("");
+ debug("check with " + wtu.glEnumToString(gl, test.type) + " at offset: " + offset + " with stride:" + stride + " normalize: " + test.normalize);
+ gl.uniform4fv(colorLoc, color);
+ var data = new Uint8Array(test.componentSize * kNumVerts * kNumComponents + stride * (kNumVerts - 1));
+ var view = new Uint8Array(test.data.buffer);
+ var size = test.componentSize * kNumComponents;
+ for (var jj = 0; jj < kNumVerts; ++jj) {
+ var off1 = jj * size;
+ var off2 = jj * stride;
+ for (var zz = 0; zz < size; ++zz) {
+ data[off2 + zz] = view[off1 + zz];
+ }
+ }
+ gl.bufferSubData(gl.ARRAY_BUFFER, offset, data);
+ gl.vertexAttribPointer(0, 3, test.type, test.normalize, stride, offset);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ var buf = new Uint8Array(50 * 50 * 4);
+ gl.readPixels(0, 0, 50, 50, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+
+ var black = [0, 0, 0, 0];
+ var other = [color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255];
+ var otherMsg = "should be " + ((count % 2) ? "red" : "green")
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, black, "should be black", 0);
+ wtu.checkCanvasRect(gl, 0, 49, 1, 1, black, "should be black", 0);
+ wtu.checkCanvasRect(gl, 26, 40, 1, 1, other, otherMsg, 0);
+ wtu.checkCanvasRect(gl, 26, 27, 1, 1, other, otherMsg, 0);
+ wtu.checkCanvasRect(gl, 40, 27, 1, 1, other, otherMsg, 0);
+ ++count;
+ }
+ }
+ }
+ }
+
+ init();
+ var successfullyParsed = true;
+ </script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html
new file mode 100644
index 0000000000..1276cec7c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/attribs/gl-vertexattribpointer.html
@@ -0,0 +1,171 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL vertexAttribPointer Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("This test checks vertexAttribPointer behaviors in WebGL.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking gl.vertexAttribPointer.");
+
+ if (!gl.FIXED) {
+ gl.FIXED = 0x140C;
+ }
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(0), gl.STATIC_DRAW);
+
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 4);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "vertexAttribPointer should fail if no buffer is bound and `offset` is non-zero.");
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "vertexAttribPointer should succeed if no buffer is bound and `offset` is zero.");
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+
+
+ if (wtu.getDefault3DContextVersion() < 2) {
+ gl.vertexAttribPointer(0, 1, gl.INT, 0, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "vertexAttribPointer should not support INT");
+ gl.vertexAttribPointer(0, 1, gl.UNSIGNED_INT, 0, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "vertexAttribPointer should not support UNSIGNED_INT");
+ }
+ gl.vertexAttribPointer(0, 1, gl.FIXED, 0, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "vertexAttribPointer should not support FIXED");
+
+ var checkVertexAttribPointer = function(
+ gl, err, reason, size, type, normalize, stride, offset) {
+ gl.vertexAttribPointer(0, size, type, normalize, stride, offset);
+ var succeeded = (err == gl.NO_ERROR);
+ wtu.glErrorShouldBe(gl, err,
+ "gl.vertexAttribPointer(0, " + size +
+ ", gl." + wtu.glEnumToString(gl, type) +
+ ", " + normalize +
+ ", " + stride +
+ ", " + offset +
+ ") should " + (succeeded ? "succeed " : "fail ") + reason);
+ if (succeeded) {
+ shouldBe('gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_SIZE)', size.toString());
+ shouldBe('gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_TYPE)', 'gl.' + wtu.glEnumToString(gl, type));
+ shouldBe('gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED)', normalize.toString());
+ shouldBe('gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_STRIDE)', stride.toString());
+ shouldBe('gl.getVertexAttribOffset(0, gl.VERTEX_ATTRIB_ARRAY_POINTER)', offset.toString());
+ }
+ }
+
+ var types = [
+ { type:gl.BYTE, bytesPerComponent: 1 },
+ { type:gl.UNSIGNED_BYTE, bytesPerComponent: 1 },
+ { type:gl.SHORT, bytesPerComponent: 2 },
+ { type:gl.UNSIGNED_SHORT, bytesPerComponent: 2 },
+ { type:gl.FLOAT, bytesPerComponent: 4 },
+ ];
+
+ if (wtu.getDefault3DContextVersion() >= 2) {
+ types.push(...[
+ { type:gl.INT, bytesPerComponent: 4 },
+ { type:gl.UNSIGNED_INT, bytesPerComponent: 4 },
+ { type:gl.HALF_FLOAT, bytesPerComponent: 2 },
+ { type:gl.INT_2_10_10_10_REV, bytesPerComponent: 4, minSize: 4 },
+ { type:gl.UNSIGNED_INT_2_10_10_10_REV, bytesPerComponent: 4, minSize: 4 },
+ ]);
+ }
+
+ for (var ii = 0; ii < types.length; ++ii) {
+ var info = types[ii];
+ debug("");
+ for (var size = 1; size <= 4; ++size) {
+ debug("");
+ debug("checking: " + wtu.glEnumToString(gl, info.type) + " with size " + size);
+ var bytesPerElement = size * info.bytesPerComponent;
+ var offsetSet = [
+ 0,
+ 1,
+ info.bytesPerComponent - 1,
+ info.bytesPerComponent,
+ info.bytesPerComponent + 1,
+ info.bytesPerComponent * 2];
+ for (var jj = 0; jj < offsetSet.length; ++jj) {
+ var offset = offsetSet[jj];
+ for (var kk = 0; kk < offsetSet.length; ++kk) {
+ var stride = offsetSet[kk];
+ var err = gl.NO_ERROR;
+ var reason = ""
+ if (offset % info.bytesPerComponent != 0) {
+ reason = "because offset is bad";
+ err = gl.INVALID_OPERATION;
+ }
+ if (stride % info.bytesPerComponent != 0) {
+ reason = "because stride is bad";
+ err = gl.INVALID_OPERATION;
+ }
+ if (size < info.minSize) {
+ reason = "because size < minSize";
+ err = gl.INVALID_OPERATION;
+ }
+ checkVertexAttribPointer(
+ gl, err, reason, size, info.type, false, stride, offset);
+ }
+ var stride = Math.floor(255 / info.bytesPerComponent) * info.bytesPerComponent;
+
+ if (offset == 0) {
+ checkVertexAttribPointer(
+ gl, size < info.minSize ? gl.INVALID_OPERATION : gl.NO_ERROR, "at stride limit",
+ size, info.type, false, stride, offset);
+ checkVertexAttribPointer(
+ gl, size < info.minSize ? [gl.INVALID_OPERATION, gl.INVALID_VALUE] : gl.INVALID_VALUE, "over stride limit",
+ size, info.type, false,
+ stride + info.bytesPerComponent, offset);
+ }
+ }
+ }
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt
new file mode 100644
index 0000000000..d6f6af332f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/00_test_list.txt
@@ -0,0 +1,14 @@
+buffer-bind-test.html
+buffer-data-and-buffer-sub-data.html
+--min-version 1.0.3 buffer-data-array-buffer-delete.html
+--min-version 1.0.4 buffer-data-dynamic-delay.html
+--min-version 1.0.4 buffer-uninitialized.html
+--min-version 1.0.2 element-array-buffer-delete-recreate.html
+index-validation-copies-indices.html
+index-validation-crash-with-buffer-sub-data.html
+--min-version 1.0.2 index-validation-large-buffer.html
+index-validation-verifies-too-many-indices.html
+index-validation-with-resized-buffer.html
+index-validation.html
+--min-version 1.0.4 vertex-buffer-updated-after-draw.html
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html
new file mode 100644
index 0000000000..b0f1fd7a38
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-bind-test.html
@@ -0,0 +1,66 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+<meta charset="utf-8">
+ <title>WebGL BindBuffer conformance 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>
+</head>
+<body>
+<canvas id="example" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Checks a buffer can only be bound to 1 target.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "should be able to bind array buffer.");
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "should be able to unbind array buffer.");
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "should get INVALID_OPERATION if attempting to bind array buffer to different target");
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buf);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "should be able to bind element array buffer.");
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "should be able to unbind element array buffer.");
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "should get INVALID_OPERATION if attempting to bind element array buffer to different target");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html
new file mode 100644
index 0000000000..f3c2658a22
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-and-buffer-sub-data.html
@@ -0,0 +1,203 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test bufferData/bufferSubData with or without ArrayBuffer input");
+
+debug('Regression test for <a href="https://bugs.webkit.org/show_bug.cgi?id=41884">https://bugs.webkit.org/show_bug.cgi?id=41884</a> : <code>Implement bufferData and bufferSubData with ArrayBuffer as input</code>');
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ bufferDataTest();
+ bufferDataSizesTest();
+
+ bufferSubDataTest();
+}
+
+function bufferDataTest() {
+ debug("");
+ debug("Test bufferData without ArrayBuffer input");
+
+ var buf = gl.createBuffer();
+ shouldBeNonNull(buf);
+
+ gl.bufferData(gl.ARRAY_BUFFER, 4, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "no buffer bound");
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ gl.bufferData(gl.ARRAY_BUFFER, -4, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "calling bufferData when buffer size is negative should generate INVALID_VALUE");
+
+ gl.bufferData(gl.ARRAY_BUFFER, null, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "calling bufferData when BufferDataSource is null should generate INVALID_VALUE");
+
+ gl.bufferData(gl.ARRAY_BUFFER, undefined, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "calling bufferData when BufferDataSource is undefined should generate INVALID_VALUE");
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+}
+
+function bufferDataSizesTest() {
+ debug("");
+ debug("Test bufferData overloads");
+
+ // bufferData has an integer overload and an ArrayBuffer overload.
+ // Per the WebIDL spec, the overload resolution algorithm should resolve types as follows:
+ // - If the argument is null or undefined, pick the nullable type, which is ArrayBuffer.
+ // Per the WebGL spec, null should flag INVALID_VALUE.
+ // - If the argument is an ArrayBuffer, then pick the ArrayBuffer overload
+ // - Everything else should pick the numeric overload. This means things like objects, strings,
+ // floating point numbers, arrays of numbers and strings, etc should convert themselves to a number.
+ var bufferDataParams = [
+ { parameter: 0, expectedBufferSize: 0 },
+ { parameter: 4, expectedBufferSize: 4 },
+ { parameter: 5.1, expectedBufferSize: 5 },
+ { parameter: 5.8, expectedBufferSize: 5 },
+ { parameter: 5.5, expectedBufferSize: 5 },
+
+ { parameter: "4", expectedBufferSize: 4 },
+ { parameter: "5.1", expectedBufferSize: 5 },
+ { parameter: "5.8", expectedBufferSize: 5 },
+ { parameter: "5.5", expectedBufferSize: 5 },
+ { parameter: "0", expectedBufferSize: 0 },
+
+ { parameter: [42, 64], expectedBufferSize: 0 },
+ { parameter: [42], expectedBufferSize: 42 },
+ { parameter: ["42"], expectedBufferSize: 42 },
+ { parameter: ["42", "64"], expectedBufferSize: 0 },
+
+ { parameter: new ArrayBuffer(0), expectedBufferSize: 0 },
+ { parameter: new ArrayBuffer(4), expectedBufferSize: 4 },
+ { parameter: new Uint8Array(new ArrayBuffer(5)), expectedBufferSize: 5 },
+ { parameter: new DataView(new ArrayBuffer(7)), expectedBufferSize: 7 },
+
+ { parameter: "WebGL Rocks!", expectedBufferSize: 0 },
+ { parameter: { mystring: "WebGL Rocks!" }, expectedBufferSize: 0 },
+ ];
+
+ if (window.SharedArrayBuffer) {
+ bufferDataParams.push(
+ { parameter: new SharedArrayBuffer(3), expectedBufferSize: 3 },
+ { parameter: new Uint8Array(new SharedArrayBuffer(6)), expectedBufferSize: 6 },
+ { parameter: new DataView(new SharedArrayBuffer(8)), expectedBufferSize: 8 }
+ );
+ }
+
+ bufferDataParams.forEach(function (bufferDataParam) {
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, bufferDataParam.parameter, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Passing " + bufferDataParam.parameter + " to bufferData");
+
+ shouldEvaluateTo("gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE)", bufferDataParam.expectedBufferSize);
+ });
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+}
+
+function bufferSubDataTest() {
+ debug("");
+ debug("Test bufferSubData");
+
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new ArrayBuffer(1));
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "Calling bufferSubData before bufferData should fail");
+
+ gl.bufferData(gl.ARRAY_BUFFER, 128, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var array = new ArrayBuffer(64);
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, -10, array);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "calling bufferSubData with ArrayBuffer when offset is negative should INVALID_VALUE");
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, 65, array);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "buffer overflow");
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, -10, new Float32Array(8));
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "calling bufferSubData with ArrayBufferView when offset is negative should generate INVALID_VALUE");
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, 10, array);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "calling bufferSubData with ArrayBuffer should succeed");
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, 10, new Float32Array(0));
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "calling bufferSubData with zero-sized ArrayBufferView should succeed");
+
+ // Arguments that are not ArrayBuffers, null or undefined should throw a TypeError exception
+ shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 0, 42);");
+ shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 0, 5.5);");
+ shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 0, \"5.5\");");
+ shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 0, [4]);");
+ shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 0, { mynumber: 42});");
+ shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 10, null)");
+ shouldThrow("gl.bufferSubData(gl.ARRAY_BUFFER, 10, undefined)");
+
+ if (window.SharedArrayBuffer) {
+ const validDatas = [
+ 'new SharedArrayBuffer(3)',
+ 'new Uint8Array(new SharedArrayBuffer(3))',
+ 'new DataView(new SharedArrayBuffer(3))',
+ ];
+ for (const x of validDatas) {
+ shouldNotThrow(`gl.bufferSubData(gl.ARRAY_BUFFER, 0, ${x})`);
+ }
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should generate no GL error");
+
+ // -
+ // Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1611837
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new ArrayBuffer(0));
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "Calling bufferSubData with empty ArrayBuffer and null WebGLBuffer should fail");
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new ArrayBuffer(0));
+ wtu.glErrorShouldBe(gl, 0,
+ "Calling bufferSubData with empty ArrayBuffer and non-null WebGLBuffer should succeed");
+
+ // -
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+}
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html
new file mode 100644
index 0000000000..4a25426f0c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-array-buffer-delete.html
@@ -0,0 +1,63 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test ARRAY_BUFFER deletion when a vertex attrib array with location != 0 is pointing to it and preserveDrawingBuffer is true.");
+
+var canvas = document.createElement('canvas');
+document.body.appendChild(canvas);
+
+canvas.addEventListener(
+ "webglcontextlost",
+ function(event) {
+ testFailed("Context lost");
+ event.preventDefault();
+ },
+ false);
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext(canvas, {preserveDrawingBuffer: true});
+
+if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+} else {
+ var array = new Float32Array([0]);
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bufferData(gl.ARRAY_BUFFER, array, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var attribLocation = 1;
+ gl.enableVertexAttribArray(attribLocation);
+ gl.vertexAttribPointer(attribLocation, 1, gl.FLOAT, false, 0, 0);
+
+ gl.deleteBuffer(buf);
+
+ setTimeout(function() {
+ // Wait for possible context loss
+ finishTest();
+ }, 2000);
+}
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-dynamic-delay.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-dynamic-delay.html
new file mode 100644
index 0000000000..8e41a687bb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-data-dynamic-delay.html
@@ -0,0 +1,114 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>bufferData with DYNAMIC_DRAW and delay between updating data</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="canvas" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="vshader" type="x-shader/x-vertex">
+ attribute vec2 a_position;
+ attribute vec2 a_color;
+ varying vec2 v_color;
+ void main()
+ {
+ gl_Position = vec4(a_position, 0.0, 1.0);
+ v_color = a_color;
+ }
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+ precision mediump float;
+ varying vec2 v_color;
+ void main()
+ {
+ gl_FragColor = vec4(v_color, 0.0, 1.0);
+ }
+</script>
+
+<script>
+"use strict";
+description("Verifies that bufferData with DYNAMIC_DRAW updates the vertex attribute when there is a significant delay between updating the buffer.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a_position", "a_color"]);
+
+// Initialize position vertex attribute to draw a square covering the entire canvas.
+var positionBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ -1.0, 1.0,
+ 1.0, 1.0,
+ -1.0, -1.0,
+ 1.0, -1.0
+ ]), gl.DYNAMIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+// Initialize color vertex attribute to red.
+var colorBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ 1.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 0.0,
+ 1.0, 0.0,
+ ]), gl.DYNAMIC_DRAW);
+gl.enableVertexAttribArray(1);
+gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No error after setup");
+
+// Fill the canvas with red
+gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No error after first drawArrays");
+
+wtu.checkCanvasRect(gl, 0, 0, 50, 50, [255, 0, 0, 255], "Canvas should be red after the first drawArrays");
+
+// With the buffer set to DYNAMIC_DRAW, Angle internally changes the storage type of the vertex attribute from DYNAMIC to DIRECT
+// if the buffer has not been updated after ~4-5 draw calls. When the buffer is eventually updated, the vertex attribute
+// is updated back to DYNAMIC, but there was a bug in Angle where the data is not marked as dirty. The result is that the
+// vertex data is not updated with the new buffer data. This test verifies that the vertex data is updated.
+var iteration = 0;
+function draw() {
+ // Draw 10 times to ensure that the vertex attribute storage type is changed.
+ if (iteration < 10) {
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 2);
+ requestAnimationFrame(draw);
+ }
+ else {
+ // Update the buffer bound to the color vertex attribute to green and draw.
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ 0.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 1.0,
+ 0.0, 1.0,
+ ]), gl.DYNAMIC_DRAW);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No error after last drawArrays");
+
+ wtu.checkCanvasRect(gl, 0, 0, 50, 50, [0, 255, 0, 255], "Canvas should be green after 10 frames");
+
+ finishTest();
+ }
+
+ iteration++;
+}
+
+requestAnimationFrame(draw);
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html
new file mode 100644
index 0000000000..75282f3674
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/buffer-uninitialized.html
@@ -0,0 +1,104 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<canvas id="canvas" width="1" height="1"></canvas>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute float a_vertex;
+void main()
+{
+ gl_Position = a_vertex == 0.0 ? vec4(9, 9, 9, 1) : vec4(0.5, 0.5, 0.5, 1);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+description("Tests that uninitialized WebGLBuffers are zeroed out");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext(document.getElementById("canvas"));
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a_vertex"]);
+shouldBeTrue("program != null");
+
+var TEST_LENGTH = 1024;
+var TEST_BUFSIZE = TEST_LENGTH * 4;
+var data = new Float32Array(TEST_LENGTH / 4); // this array is zeroed
+
+var indices = new Uint16Array(TEST_LENGTH);
+for (var i = 0; i < TEST_LENGTH; i++) {
+ indices[i] = i;
+}
+
+gl.clearColor(0, 1, 0, 1);
+
+function test(initFunction) {
+ var uninitializedBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, uninitializedBuffer);
+ initFunction();
+
+ var elements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elements);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ gl.useProgram(program);
+ var vertexLoc = gl.getAttribLocation(program, "a_vertex");
+ gl.vertexAttribPointer(vertexLoc, 1, gl.FLOAT, gl.FALSE, 0, 0);
+ gl.enableVertexAttribArray(vertexLoc);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no error should result from setup");
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.POINTS, TEST_LENGTH, gl.UNSIGNED_SHORT, 0);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 255, 0, 255], "buffer should be initialized to zero");
+
+ gl.deleteBuffer(uninitializedBuffer);
+}
+
+var REPETITIONS = 50;
+
+var j;
+debug("");
+debug("testing bufferData(..., size, ...)");
+for (j = 0; j < REPETITIONS; j++) {
+ test(function() {
+ gl.bufferData(gl.ARRAY_BUFFER, TEST_BUFSIZE, gl.STATIC_DRAW);
+ });
+}
+
+debug("");
+debug("testing bufferSubData(..., offset, data) of uninitialized buffer");
+for (j = 0; j < REPETITIONS; j++) {
+ test(function() {
+ gl.bufferData(gl.ARRAY_BUFFER, TEST_BUFSIZE, gl.STATIC_DRAW);
+ // bufferSubData the second quarter of the buffer
+ gl.bufferSubData(gl.ARRAY_BUFFER, TEST_BUFSIZE / 4, data);
+ });
+}
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html
new file mode 100644
index 0000000000..d4fb81af9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/element-array-buffer-delete-recreate.html
@@ -0,0 +1,69 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+ <title>Element Array Buffer Deletion and Recreation 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>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+function init()
+{
+ description();
+
+ // Clear the background with red.
+ var gl = wtu.create3DContext("example");
+ wtu.setupSimpleColorProgram(gl);
+ var color = [0, 255, 0, 255];
+ wtu.setUByteDrawColor(gl, color);
+
+ var vertexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ -1, -1,
+ 1, -1,
+ -1, 1,
+ 1, 1
+ ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+ // Create an element array buffer.
+ var indexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array([0, 1, 2, 3]), gl.STATIC_DRAW);
+
+ // Delete the element array buffer.
+ gl.deleteBuffer(indexBuffer);
+
+ // Create a new element array buffer.
+ indexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array([0, 1, 2, 3]), gl.STATIC_DRAW);
+
+ // Draw with the new element array buffer.
+ // If the geometry is drawn successfully, the fragment shader will color it green.
+ gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_BYTE, 0);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw");
+ wtu.checkCanvas(gl, color, "should be green")
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html
new file mode 100644
index 0000000000..e823f95f69
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-copies-indices.html
@@ -0,0 +1,56 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description('Test that client data is always copied during bufferData and bufferSubData calls, because otherwise the data the GL uses to draw may differ from that checked by the index validation code.')
+
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+
+context.useProgram(program);
+var vertexObject = context.createBuffer();
+context.enableVertexAttribArray(0);
+context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
+// 4 vertices -> 2 triangles
+context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
+context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
+
+var indexObject = context.createBuffer();
+
+context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
+var indices = new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]);
+context.bufferData(context.ELEMENT_ARRAY_BUFFER, indices, context.STATIC_DRAW);
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
+var indexValidationError = wtu.shouldGenerateGLError(context,
+ [context.INVALID_OPERATION, context.NO_ERROR],
+ "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
+indices[0] = 2;
+indices[5] = 1;
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
+
+debug("")
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html
new file mode 100644
index 0000000000..91873f740f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-crash-with-buffer-sub-data.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description('Verifies that the index validation code which is within bufferSubData does not crash.')
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+var elementBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, 256, gl.STATIC_DRAW);
+var data = new Uint8Array(127);
+gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 63, data);
+testPassed("bufferSubData, when buffer object was initialized with null, did not crash");
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html
new file mode 100644
index 0000000000..a0427039a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-large-buffer.html
@@ -0,0 +1,56 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description('Tests that index validation for drawElements works with large attribute buffers');
+
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+
+context.useProgram(program);
+
+// Create a small index buffer.
+var indexObject = context.createBuffer();
+context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
+var indexArray = new Uint16Array([0, 1, 2]);
+context.bufferData(context.ELEMENT_ARRAY_BUFFER, indexArray, context.STATIC_DRAW);
+
+// Create a large attribute buffer.
+var vertexObject = context.createBuffer();
+context.enableVertexAttribArray(0);
+context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
+context.bufferData(context.ARRAY_BUFFER, new Float32Array(3 * 65536), context.STATIC_DRAW);
+context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
+
+debug("Test large attribute buffer")
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_SHORT, 0)");
+
+// Enlarge the attribute buffer slightly.
+debug("Test even larger attribute buffer")
+context.bufferData(context.ARRAY_BUFFER, new Float32Array(3 * 65536 + 3), context.STATIC_DRAW);
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLES, 3, context.UNSIGNED_SHORT, 0)");
+
+debug("")
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html
new file mode 100644
index 0000000000..8ebbf4f32d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-verifies-too-many-indices.html
@@ -0,0 +1,50 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description('Tests that index validation for drawElements does not examine too many indices');
+
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+
+context.useProgram(program);
+var vertexObject = context.createBuffer();
+context.enableVertexAttribArray(0);
+context.bindBuffer(context.ARRAY_BUFFER, vertexObject);
+// 4 vertices -> 2 triangles
+context.bufferData(context.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), context.STATIC_DRAW);
+context.vertexAttribPointer(0, 3, context.FLOAT, false, 0, 0);
+
+var indexObject = context.createBuffer();
+
+debug("Test out of range indices")
+context.bindBuffer(context.ELEMENT_ARRAY_BUFFER, indexObject);
+context.bufferData(context.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 10000, 0, 1, 2, 3, 10000 ]), context.STATIC_DRAW);
+var indexValidationError = wtu.shouldGenerateGLError(context, [context.INVALID_OPERATION, context.NO_ERROR], "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 0)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 2)");
+wtu.shouldGenerateGLError(context, indexValidationError, "context.drawElements(context.TRIANGLE_STRIP, 4, context.UNSIGNED_SHORT, 4)");
+
+debug("")
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html
new file mode 100644
index 0000000000..182768085f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation-with-resized-buffer.html
@@ -0,0 +1,107 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="1" height="1"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="vs" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec4 vColor;
+varying vec4 color;
+void main() {
+ gl_Position = vPosition;
+ color = vColor;
+}
+</script>
+<script id="fs" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+void main() {
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+description('Test that updating the size of a vertex buffer is properly noticed by the WebGL implementation.')
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vs", "fs"], ["vPosition", "vColor"]);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after initialization");
+
+var vertexObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+ [-1,1,0, 1,1,0, -1,-1,0,
+ -1,-1,0, 1,1,0, 1,-1,0]), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after vertex setup");
+
+var texCoordObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, texCoordObject);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+ [0,0, 1,0, 0,1,
+ 0,1, 1,0, 1,1]), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(1);
+gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after texture coord setup");
+
+// Now resize these buffers because we want to change what we're drawing.
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ -1,1,0, 1,1,0, -1,-1,0, 1,-1,0,
+ -1,1,0, 1,1,0, -1,-1,0, 1,-1,0]), gl.STATIC_DRAW);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after vertex redefinition");
+gl.bindBuffer(gl.ARRAY_BUFFER, texCoordObject);
+gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array([
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255]), gl.STATIC_DRAW);
+gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, false, 0, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after texture coordinate / color redefinition");
+
+var numQuads = 2;
+var indices = new Uint8Array(numQuads * 6);
+for (var ii = 0; ii < numQuads; ++ii) {
+ var offset = ii * 6;
+ var quad = (ii == (numQuads - 1)) ? 4 : 0;
+ indices[offset + 0] = quad + 0;
+ indices[offset + 1] = quad + 1;
+ indices[offset + 2] = quad + 2;
+ indices[offset + 3] = quad + 2;
+ indices[offset + 4] = quad + 1;
+ indices[offset + 5] = quad + 3;
+}
+var indexObject = gl.createBuffer();
+gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after setting up indices");
+gl.drawElements(gl.TRIANGLES, numQuads * 6, gl.UNSIGNED_BYTE, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after drawing");
+
+debug("")
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html
new file mode 100644
index 0000000000..0aa7e78781
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/index-validation.html
@@ -0,0 +1,119 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Tests that index validation verifies the correct number of indices");
+
+function sizeInBytes(type) {
+ switch (type) {
+ case gl.BYTE:
+ case gl.UNSIGNED_BYTE:
+ return 1;
+ case gl.SHORT:
+ case gl.UNSIGNED_SHORT:
+ return 2;
+ case gl.INT:
+ case gl.UNSIGNED_INT:
+ case gl.FLOAT:
+ return 4;
+ default:
+ throw "unknown type";
+ }
+}
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var program = wtu.loadStandardProgram(gl);
+
+// 3 vertices => 1 triangle, interleaved data
+var dataComplete = new Float32Array([0, 0, 0, 1,
+ 0, 0, 1,
+ 1, 0, 0, 1,
+ 0, 0, 1,
+ 1, 1, 1, 1,
+ 0, 0, 1]);
+var dataIncomplete = new Float32Array([0, 0, 0, 1,
+ 0, 0, 1,
+ 1, 0, 0, 1,
+ 0, 0, 1,
+ 1, 1, 1, 1]);
+var indices = new Uint16Array([0, 1, 2]);
+
+debug("Testing with valid indices");
+
+var bufferComplete = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, bufferComplete);
+gl.bufferData(gl.ARRAY_BUFFER, dataComplete, gl.STATIC_DRAW);
+var elements = gl.createBuffer();
+gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elements);
+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+gl.useProgram(program);
+var vertexLoc = gl.getAttribLocation(program, "a_vertex");
+var normalLoc = gl.getAttribLocation(program, "a_normal");
+gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
+gl.enableVertexAttribArray(vertexLoc);
+gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
+gl.enableVertexAttribArray(normalLoc);
+shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("Testing with out-of-range indices");
+
+var bufferIncomplete = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, bufferIncomplete);
+gl.bufferData(gl.ARRAY_BUFFER, dataIncomplete, gl.STATIC_DRAW);
+gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
+gl.enableVertexAttribArray(vertexLoc);
+gl.disableVertexAttribArray(normalLoc);
+debug("Enable vertices, valid");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+debug("Enable normals, out-of-range");
+gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
+gl.enableVertexAttribArray(normalLoc);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
+wtu.glErrorShouldBe(gl, [gl.INVALID_OPERATION, gl.NO_ERROR]);
+
+debug("Test with enabled attribute that does not belong to current program");
+
+gl.disableVertexAttribArray(normalLoc);
+var extraLoc = Math.max(vertexLoc, normalLoc) + 1;
+gl.enableVertexAttribArray(extraLoc);
+debug("Enable an extra attribute with null");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
+debug("Enable an extra attribute with insufficient data buffer");
+gl.vertexAttribPointer(extraLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
+debug("Pass large negative index to vertexAttribPointer");
+gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), -2000000000 * sizeInBytes(gl.FLOAT));
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
+shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)');
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/buffers/vertex-buffer-updated-after-draw.html b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/vertex-buffer-updated-after-draw.html
new file mode 100644
index 0000000000..90436b64ef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/buffers/vertex-buffer-updated-after-draw.html
@@ -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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Vertex Buffer Updated After Draw 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec2 a_position;
+attribute vec4 a_color;
+varying vec4 v_outcolor;
+void main() {
+ gl_Position = vec4(a_position, 0, 1);
+ v_outcolor = a_color;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+varying mediump vec4 v_outcolor;
+void main() {
+ gl_FragColor = v_outcolor;
+}
+</script>
+
+<script>
+// Tests that D3D11 dirty bit updates don't forget about BufferSubData attrib updates.
+// Based on ANGLE test (StateChangeTest, VertexBufferUpdatedAfterDraw) from https://github.com/google/angle/blob/f7f0b8c3ab21c52cc2915048959361cf628d95f0/src/tests/gl_tests/StateChangeTest.cpp
+"use strict";
+var wtu = WebGLTestUtils;
+description();
+
+var gl = wtu.create3DContext("example");
+
+var program = wtu.setupProgram(gl, ['vshader', 'fshader']);
+
+var colorLoc = gl.getAttribLocation(program, "a_color");
+var green = new Uint8Array(4 * 6);
+var red = new Uint8Array(4 * 6);
+
+for (var i = 0; i < 6; ++i) {
+ var ci = i * 4;
+
+ green[ci] = 0;
+ red[ci] = 255;
+
+ green[ci + 1] = 255;
+ red[ci + 1] = 0;
+
+ green[ci + 2] = red[ci + 2] = 0;
+
+ green[ci + 3] = red[ci + 3] = 255;
+}
+
+var positionLoc = gl.getAttribLocation(program, "a_position");
+
+var gridRes = 1;
+wtu.setupIndexedQuad(gl, gridRes, positionLoc);
+
+var colorBuf = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, colorBuf);
+gl.bufferData(gl.ARRAY_BUFFER, green, gl.STATIC_DRAW);
+gl.vertexAttribPointer(colorLoc, 4, gl.UNSIGNED_BYTE, true, 0, 0);
+gl.enableVertexAttribArray(colorLoc);
+
+wtu.clearAndDrawIndexedQuad(gl, gridRes);
+wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+
+gl.bufferSubData(gl.ARRAY_BUFFER, 0, red);
+
+wtu.clearAndDrawIndexedQuad(gl, gridRes);
+wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt
new file mode 100644
index 0000000000..558163de17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/00_test_list.txt
@@ -0,0 +1,19 @@
+buffer-offscreen-test.html
+buffer-preserve-test.html
+canvas-test.html
+canvas-zero-size.html
+drawingbuffer-static-canvas-test.html
+--min-version 1.0.2 drawingbuffer-hd-dpi-test.html
+drawingbuffer-test.html
+--min-version 1.0.3 draw-webgl-to-canvas-test.html
+--min-version 1.0.3 draw-static-webgl-to-multiple-canvas-test.html
+--min-version 1.0.2 framebuffer-bindings-unaffected-on-resize.html
+--min-version 1.0.4 framebuffer-bindings-affected-by-to-data-url.html
+--min-version 1.0.3 rapid-resizing.html
+--min-version 1.0.4 render-after-resize-test.html
+--min-version 1.0.2 texture-bindings-unaffected-on-resize.html
+--min-version 1.0.2 to-data-url-test.html
+--min-version 1.0.4 to-data-url-after-composite.html
+viewport-unchanged-upon-resize.html
+--min-version 1.0.4 webgl-to-2d-canvas.html
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html
new file mode 100644
index 0000000000..c0bf2d35fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-offscreen-test.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL required buffer clear behaviour 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>
+<style type="text/css">
+body {
+ height: 3000px;
+}
+</style>
+</head>
+<body>
+<div id="description"></div>
+<canvas width="20" height="20" style="border: 1px solid blue;" id="c"></canvas>
+<div id="console"></div>
+<script>
+description("This test ensures WebGL implementations correctly clear " +
+ "the drawing buffer on composite if preserveDrawingBuffer is false.");
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl1 = wtu.create3DContext("c");
+var gl2 = wtu.create3DContext();
+shouldBeNonNull("gl1");
+shouldBeNonNull("gl2");
+
+shouldBeFalse('gl1.getContextAttributes().preserveDrawingBuffer');
+shouldBeFalse('gl2.getContextAttributes().preserveDrawingBuffer');
+
+function init(gl) {
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // enable scissor here, before compositing, to make sure it's correctly
+ // ignored and restored
+ gl.scissor(0, 10, 10, 10);
+ gl.enable(gl.SCISSOR_TEST);
+}
+
+init(gl1);
+init(gl2);
+
+wtu.waitForComposite(function() {
+ function clear(gl) {
+ // scissor was set earlier
+ gl.clearColor(0, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ }
+ clear(gl1);
+ clear(gl2);
+
+ debug("check on screen canvas");
+ wtu.checkCanvasRect(gl1, 0, 10, 10, 10, [0, 0, 255, 255],
+ "cleared corner should be blue, stencil should be preserved");
+ wtu.checkCanvasRect(gl1, 0, 0, 10, 10, [0, 0, 0, 0],
+ "remainder of buffer should be cleared");
+ debug("check off screen canvas");
+ wtu.checkCanvasRect(gl2, 0, 10, 10, 10, [0, 0, 255, 255],
+ "cleared corner should be blue, stencil should be preserved");
+ wtu.checkCanvasRect(gl2, 0, 0, 10, 10, [255, 0, 0, 255],
+ "remainder of buffer should be un-cleared red");
+
+ finishTest();
+});
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html
new file mode 100644
index 0000000000..38c07f5211
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/buffer-preserve-test.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL required buffer clear behaviour 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="../../js/tests/compositing-test.js"></script>
+<style type="text/css">
+body {
+ height: 3000px;
+}
+</style>
+</head>
+<body>
+<!-- Important to put the canvas at the top so that it's always visible even in the test suite runner.
+ Otherwise it just doesn't get composited in Firefox. -->
+<div id="description"></div>
+<div id="console"></div>
+<script type="application/javascript">
+"use strict";
+
+description("This test ensures WebGL implementations correctly clear the drawing buffer " +
+ "on composite if preserveDrawingBuffer is false.");
+debug("");
+
+const wtu = WebGLTestUtils;
+
+async function runCompositingTests() {
+ const compositingTestFn = createCompositingTestFn({
+ webglVersion: 1,
+ shadersFn(gl) {
+ const vs = `\
+ attribute vec4 position;
+ void main() {
+ gl_Position = position;
+ }
+ `;
+ const fs = `\
+ precision mediump float;
+ void main() {
+ gl_FragColor = vec4(1, 0, 0, 1);
+ }
+ `;
+ return [vs, fs];
+ },
+ });
+
+ function drawArrays(gl) {
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+
+ function drawElements(gl) {
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ }
+
+ await compositingTestFn(drawArrays);
+ await compositingTestFn(drawElements);
+ finishTest();
+}
+runCompositingTests();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html
new file mode 100644
index 0000000000..02164692c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-test.html
@@ -0,0 +1,195 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<canvas id="canvas2d" width="40" height="40"> </canvas>
+<script>
+"use strict";
+
+description("This test ensures WebGL implementations interact correctly with the canvas tag.");
+
+debug("");
+debug("Canvas.getContext");
+
+var err;
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var canvas2d = document.getElementById("canvas2d");
+var ctx2d = canvas2d.getContext("2d");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking canvas and WebGL interaction");
+
+ // Check that a canvas with no width or height is 300x150 pixels
+ shouldBe('canvas.width', '300');
+ shouldBe('canvas.height', '150');
+
+ // Check get a 4 value gl parameter as a csv string.
+ var getValue4v = function(name) {
+ var v = gl.getParameter(name);
+ var result = '' +
+ v[0] + ',' +
+ v[1] + ',' +
+ v[2] + ',' +
+ v[3];
+ return result;
+ }
+
+ var getViewport = function() {
+ return getValue4v(gl.VIEWPORT);
+ }
+
+ var getClearColor = function() {
+ return getValue4v(gl.COLOR_CLEAR_VALUE);
+ }
+
+ var isAboutEqual = function(a, b) {
+ return Math.abs(a - b) < 0.01;
+ }
+
+ var isAboutEqualInt = function(a, b) {
+ return Math.abs(a - b) < 3;
+ }
+
+ var checkCanvasContentIs = function(r3d,g3d,b3d,a3d) {
+ var r2d;
+ var g2d;
+ var b2d;
+ var a2d;
+
+ var checkPixel = function(x, y, r3d,g3d,b3d,a3d) {
+ var offset = (y * 40 + x) * 4;
+ r2d = imgData.data[offset];
+ g2d = imgData.data[offset + 1];
+ b2d = imgData.data[offset + 2];
+ a2d = imgData.data[offset + 3];
+ var res = isAboutEqualInt(r2d, r3d) &&
+ isAboutEqualInt(g2d, g3d) &&
+ isAboutEqualInt(b2d, b3d) &&
+ isAboutEqualInt(a2d, a3d);
+ if (!res) {
+ bufferedLogToConsole('at ' + x + ', ' + y + " (offset " + offset + ") = " + r2d + ", " + g2d + ", " + b2d + ", " + a2d);
+ }
+ return res;
+ }
+
+ var checkPixels = function(r3d,g3d,b3d,a3d) {
+ return checkPixel(0, 0, r3d, g3d, b3d, a3d) &&
+ checkPixel(0, 39, r3d, g3d, b3d, a3d) &&
+ checkPixel(39, 0, r3d, g3d, b3d, a3d) &&
+ checkPixel(39, 39, r3d, g3d, b3d, a3d) &&
+ checkPixel(0, 0, r3d, g3d, b3d, a3d);
+ };
+
+ // Set to just take the color from the 3d canvas
+ ctx2d.globalCompositeOperation = 'copy';
+
+ // fill 2d canvas with orange
+ ctx2d.fillStyle = "rgb(255,192,128)";
+ ctx2d.fillRect (0, 0, 40, 40);
+
+ // get the image data
+ var imgData = ctx2d.getImageData(0, 0, 40, 40);
+
+ // check it got cleared.
+ if (!checkPixels(255, 192, 128, 255)) {
+ testFailed("unable to fill 2d context.");
+ return;
+ }
+
+ // draw 3d canvas on top.
+ ctx2d.drawImage(canvas, 0,0, 40, 40);
+
+ // get the image data
+ var imgData = ctx2d.getImageData(0, 0, 40, 40);
+
+ // Check it's the expected color.
+ if (!checkPixels(r3d, g3d, b3d, a3d)) {
+ testFailed("pixels are " + r2d + "," + g2d + "," + b2d + "," + a2d +
+ " expected " + r3d + "," + g3d + "," + b3d + "," + a3d);
+ } else {
+ testPassed("pixels are " + r3d + "," + g3d + "," + b3d + "," + a3d);
+ }
+ }
+
+ checkCanvasContentIs(0, 0, 0, 0);
+ shouldBe('getViewport()', '"0,0,300,150"');
+
+ // Change the display size of the canvas and check
+ // the viewport size does not change.
+ debug("");
+ debug("change display size of canvas and see that viewport does not change");
+ canvas.style.width = "100px";
+ canvas.style.height = "25px";
+ var intervalId;
+ intervalId = window.setInterval(function() {
+ if (canvas.clientWidth == 100 &&
+ canvas.clientHeight == 25) {
+ window.clearInterval(intervalId);
+ shouldBe('getViewport()', '"0,0,300,150"');
+ shouldBe('canvas.width', '300');
+ shouldBe('canvas.height', '150');
+
+ // Change the actual size of the canvas
+ // Check that the viewport does not change.
+ // Check that the clear color does not change.
+ // Check that the color mask does not change.
+ debug("");
+ debug("change the actual size of the canvas and see that the viewport does not change");
+ gl.clearColor(0.25, 0.5, 0.75, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ checkCanvasContentIs(64, 128, 192, 255);
+ gl.colorMask(0,0,0,0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No GL errors before resizing the canvas");
+ canvas.width = 400;
+ canvas.height = 10;
+ err = gl.getError();
+ // Some implementations might lost the context when resizing
+ if (err != gl.CONTEXT_LOST_WEBGL) {
+ shouldBe("err", "gl.NO_ERROR");
+ var v = gl.getParameter(gl.COLOR_CLEAR_VALUE);
+ assertMsg(isAboutEqual(v[0], 0.25) &&
+ isAboutEqual(v[1], 0.5) &&
+ isAboutEqual(v[2], 0.75) &&
+ isAboutEqual(v[3], 1),
+ "gl.clearColor should not change after canvas resize");
+ v = gl.getParameter(gl.COLOR_WRITEMASK);
+ assertMsg(isAboutEqual(v[0], 0) &&
+ isAboutEqual(v[1], 0) &&
+ isAboutEqual(v[2], 0) &&
+ isAboutEqual(v[3], 0),
+ "gl.colorMask should not change after canvas resize");
+ shouldBe('getViewport()', '"0,0,300,150"');
+ checkCanvasContentIs(0, 0, 0, 0);
+ }
+
+ debug("");
+ finishTest();
+ }
+ }, 1000/30);
+}
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html
new file mode 100644
index 0000000000..c85a73d342
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/canvas-zero-size.html
@@ -0,0 +1,43 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Zero Size Canvas 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Tests that a zero size canvas does not fail.");
+var wtu = WebGLTestUtils;
+var canvas = document.createElement('canvas');
+var gl = wtu.create3DContext(canvas);
+canvas.width = 0;
+canvas.height = 0;
+gl.viewport(0, 0, 0, 0);
+var program = wtu.setupTexturedQuad(gl);
+shouldBeTrue("program != null");
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+var pixel = new Uint8Array([0, 255, 0, 255]);
+gl.texImage2D(
+ gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
+wtu.clearAndDrawUnitQuad(gl);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html
new file mode 100644
index 0000000000..be7a2e6f54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html
@@ -0,0 +1,75 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas2d_0" width="128" height="128"> </canvas>
+<canvas id="canvas2d_1" width="400" height="400"> </canvas>
+<canvas id="canvas2d_2" width="128" height="128"> </canvas>
+<canvas id="webgl" width="400" height="400"> </canvas>
+<script>
+"use strict";
+
+description("This test ensures WebGL implementations interact correctly with the canvas 2D drawImage call when drawing the same content.");
+
+var err;
+var wtu = WebGLTestUtils;
+
+var canvas2d = [];
+var ctx2d = [];
+for (var i = 0; i < 3; i ++) {
+ canvas2d[i] = document.getElementById("canvas2d_" + i);
+ ctx2d[i] = canvas2d[i].getContext("2d");
+}
+
+var canvas = document.getElementById("webgl");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("Checking drawing the same WebGL content to HW accelerated canvas and SW Canvases");
+ debug("");
+ var color = [[0.25, 0.5, 0.75, 1], [1, 0, 0, 1], [1, 0, 1, 1]];
+ var colorValue = [[64, 128, 192, 255], [255, 0, 0, 255], [255, 0, 255, 255]];
+ for (var count = 0; count < 10; count ++) {
+ for (var i = 0; i < 3; i++) {
+ gl.clearColor(color[i][0], color[i][1], color[i][2], color[i][3]);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ ctx2d[0].drawImage(canvas, 0, 0, canvas2d[0].width, canvas2d[0].height);
+ ctx2d[1].drawImage(canvas, 0, 0, canvas2d[1].width, canvas2d[1].height);
+ ctx2d[2].drawImage(canvas, 0, 0, canvas2d[2].width, canvas2d[2].height);
+ wtu.checkCanvasRect(ctx2d[0], 0, 0, canvas2d[0].width, canvas2d[0].height, colorValue[i],
+ "drawImage: Should be (" + colorValue[i][0] + "," + colorValue[i][1] +
+ "," + colorValue[i][2] + "," + colorValue[i][3] + ").", 2);
+ wtu.checkCanvasRect(ctx2d[1], 0, 0, canvas2d[1].width, canvas2d[1].height, colorValue[i],
+ "drawImage: Should be (" + colorValue[i][0] + "," + colorValue[i][1] +
+ "," + colorValue[i][2] + "," + colorValue[i][3] + ").", 2);
+ wtu.checkCanvasRect(ctx2d[2], 0, 0, canvas2d[2].width, canvas2d[2].height, colorValue[i],
+ "drawImage: Should be (" + colorValue[i][0] + "," + colorValue[i][1] +
+ "," + colorValue[i][2] + "," + colorValue[i][3] + ").", 2);
+ }
+ }
+
+ err = gl.getError();
+ debug("");
+}
+finishTest();
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html
new file mode 100644
index 0000000000..16007cfe50
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/draw-webgl-to-canvas-test.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas2d_0" width="400" height="400"> </canvas>
+<canvas id="canvas2d_1" width="400" height="400"> </canvas>
+<canvas id="canvas2d_2" width="400" height="400"> </canvas>
+<canvas id="webgl" width="400" height="400"> </canvas>
+<script>
+"use strict";
+
+description("This test ensures WebGL implementations interact correctly with the canvas 2D drawImage call.");
+
+var err;
+var wtu = WebGLTestUtils;
+
+var canvas2d = [];
+var ctx2d = [];
+for (var i = 0; i < 3; i ++) {
+ canvas2d[i] = document.getElementById("canvas2d_" + i);
+ ctx2d[i] = canvas2d[i].getContext("2d");
+}
+
+var canvas = document.getElementById("webgl");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking canvas and WebGL drawImage interaction");
+ for (var count = 0; count < 10; count ++) {
+ gl.clearColor(0.25, 0.5, 0.75, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ ctx2d[0].drawImage(canvas, 0, 0, canvas2d[0].width, canvas2d[0].height);
+
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ ctx2d[1].drawImage(canvas, 0, 0, canvas2d[1].width, canvas2d[1].height);
+
+ gl.clearColor(1, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ ctx2d[2].drawImage(canvas, 0, 0, canvas2d[2].width, canvas2d[2].height);
+
+ gl.clearColor(1, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ wtu.checkCanvasRect(ctx2d[0], 0, 0, canvas2d[0].width, canvas2d[0].height, [64, 128, 192, 255],
+ "drawImage: Should be [64, 128, 192, 255]", 2);
+ wtu.checkCanvasRect(ctx2d[1], 0, 0, canvas2d[1].width, canvas2d[1].height, [255, 0, 0, 255],
+ "drawImage: Should be [255, 0, 0, 255]", 2);
+ wtu.checkCanvasRect(ctx2d[2], 0, 0, canvas2d[2].width, canvas2d[2].height, [255, 0, 255, 255],
+ "drawImage: Should be [255, 0, 255, 255]", 2);
+ }
+
+ err = gl.getError();
+ debug("");
+}
+finishTest();
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html
new file mode 100644
index 0000000000..93edeacc0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-hd-dpi-test.html
@@ -0,0 +1,204 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL DrawingBuffer dimensions on HD-DPI machines 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshaderGrid" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main()
+{
+ gl_Position = a_position;
+}
+</script>
+
+<script id="fshaderGrid" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ float r = mod(gl_FragCoord.x, 2.0) < 1.0 ? 0.0 : 1.0;
+ float g = mod(gl_FragCoord.y, 2.0) < 1.0 ? 0.0 : 1.0;
+ gl_FragColor = vec4(r, g, 0, 1);
+}
+</script>
+<script>
+"use strict";
+description();
+debug("");
+
+var gl;
+var canvas;
+
+function checkDimensions() {
+ // We expect that for the sizes being testing drawingBufferWidth and drawingBufferHeight
+ // will match canvas.width and canvas.height.
+
+ // We need to test that devicePixelRatio does not effect the backbuffer size of a canvas.
+ shouldBe('gl.drawingBufferWidth', 'canvas.width');
+ shouldBe('gl.drawingBufferHeight', 'canvas.height');
+}
+
+// This uses gl_FragCoord to draw a device pixel relavent pattern.
+// If drawBufferWidth or drawBufferHeight are not in device pixels
+// this test should fail.
+function checkGrid(gl, width, height) {
+ var program = wtu.setupProgram(gl, ["vshaderGrid", "fshaderGrid"], ["a_position"]);
+ wtu.setupUnitQuad(gl);
+ gl.useProgram(program);
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+
+ wtu.clearAndDrawUnitQuad(gl);
+
+ var pixels = new Uint8Array(width * height * 4);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
+
+ var colors = [
+ [ { color: [0, 0, 0, 255], name: "black" }, { color: [255, 0, 0, 255], name: "red" } ],
+ [ { color: [0, 255, 0, 255], name: "green" }, { color: [255, 255, 0, 255], name: "yellow" } ],
+ ];
+
+ for (var yy = 0; yy < height; ++yy) {
+ for (var xx = 0; xx < width; ++xx) {
+ var info = colors[yy % 2][xx % 2];
+ var color = info.color;
+ var offset = (yy * width + xx) * 4;
+ for (var jj = 0; jj < 4; ++jj) {
+ if (pixels[offset + jj] != color[jj]) {
+ var actual = [pixels[offset], pixels[offset + 1], pixels[offset + 2], pixels[offset + 3]];
+ testFailed("at " + xx + ", " + yy + " expected " + color + "(" + info.name + ") was " + actual);
+ return;
+ }
+ }
+ }
+ }
+ testPassed("grid rendered correctly");
+}
+
+// This passes device coordinate vertices in to make sure gl.viewport is not being mucked with.
+function checkQuad(gl, width, height) {
+ var deviceToClipSpace = function(value, range) {
+ return value / range * 2 - 1;
+ }
+
+ var program = wtu.setupColorQuad(gl);
+
+ // draw a small green square in the top right corner.
+ var deviceX1 = width - 4;
+ var deviceX2 = width;
+ var deviceY1 = height - 4;
+ var deviceY2 = height;
+
+ var clipX1 = deviceToClipSpace(deviceX1, width);
+ var clipX2 = deviceToClipSpace(deviceX2, width);
+ var clipY1 = deviceToClipSpace(deviceY1, height);
+ var clipY2 = deviceToClipSpace(deviceY2, height);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array(
+ [ clipX2, clipY2,
+ clipX1, clipY2,
+ clipX1, clipY1,
+ clipX2, clipY2,
+ clipX1, clipY1,
+ clipX2, clipY1]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+ var green = [0, 255, 0, 255];
+ var black = [0, 0, 0, 0];
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.drawUByteColorQuad(gl, [0, 255, 0, 255]);
+
+ var squareWidth = deviceX2 - deviceX1;
+ var squareHeight = deviceY2 - deviceY1;
+
+ // check the square.
+ wtu.checkCanvasRect(gl, deviceX1, deviceY1, squareWidth, squareHeight, green, "should be green");
+ // check outside the square.
+ wtu.checkCanvasRect(gl, 0, 0, width, height - squareHeight, black, "should be black");
+ wtu.checkCanvasRect(gl, 0, height - squareHeight, width - squareWidth, squareHeight, black, "should be black");
+}
+
+
+function test(desiredWidth, desiredHeight) {
+ debug("");
+ debug("testing canvas width = " + desiredWidth + ", height = " + desiredHeight);
+
+ // Make a fresh canvas.
+ canvas = document.createElement("canvas");
+ canvas.width = desiredWidth;
+ canvas.height = desiredHeight;
+
+ // This 'gl' must be global for shouldBe to work.
+ gl = wtu.create3DContext(canvas, {antialias: false});
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ // Check the dimensions are correct.
+ checkDimensions();
+
+ // Draw a pixel grid using a shader that draws in device coordinates
+ checkGrid(gl, desiredWidth, desiredHeight);
+
+ // Draw a quad in the top right corner.
+ checkQuad(gl, desiredWidth, desiredHeight);
+
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+
+ debug("");
+ debug("testing resizing canvas to width = " + desiredWidth + ", height = " + desiredHeight);
+
+ var oldViewport = gl.getParameter(gl.VIEWPORT);
+
+ // flip width and height
+ canvas.width = desiredHeight;
+ canvas.height = desiredWidth;
+
+ // fix the viewport
+ gl.viewport(0, 0, desiredHeight, desiredWidth);
+
+ // Check the dimensions are correct.
+ checkDimensions();
+
+ // Draw a pixel grid using a shader that draws in device coordinates
+ checkGrid(gl, desiredHeight, desiredWidth);
+
+ // Draw a quad in the top right corner.
+ checkQuad(gl, desiredHeight, desiredWidth);
+
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+ }
+}
+
+var wtu = WebGLTestUtils;
+
+// test a few sizes
+test(32, 16);
+test(128, 64);
+test(256, 512);
+
+debug("")
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html
new file mode 100644
index 0000000000..66ffb32194
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-static-canvas-test.html
@@ -0,0 +1,116 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="50" height="50"> </canvas>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+
+<script>
+"use strict";
+
+function drawTriangleTest(gl)
+{
+ var width = 50;
+ var height = 50;
+ gl.viewport(0, 0, width, height);
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ // Test several locations
+ wtu.checkCanvasRect(gl, 0, 0, width, 1, [0, 0, 0, 255],
+ 'First line should be all black');
+ wtu.checkCanvasRect(gl, 20, 15, 10, 1, [255, 0, 0, 255],
+ 'Line 15 should be red for at least 10 red pixels starting 20 pixels in');
+ wtu.checkCanvasRect(gl, 0, height - 1, width, 1, [0, 0, 0, 255],
+ 'Last line should be all black');
+}
+
+description("This test ensures WebGL implementations correctly implement drawingbufferWidth/Height with compositing.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var err;
+var maxSize;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+ shouldBeNonNull("program");
+ gl.enable(gl.DEPTH_TEST);
+ gl.clearColor(0, 0, 0, 1);
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+
+ debug("");
+ debug("Checking drawingBufferWidth/drawingBufferHeight");
+
+ shouldBe('gl.drawingBufferWidth', 'gl.canvas.width');
+ shouldBe('gl.drawingBufferHeight', 'gl.canvas.height');
+
+ // Check that changing the canvas size to something too large falls back to reasonable values.
+ maxSize = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
+ shouldBeTrue('maxSize[0] > 0');
+ shouldBeTrue('maxSize[1] > 0');
+
+ // debug("MAX_VIEWPORT_DIMS = " + maxSize[0] + "x" + maxSize[1]);
+ gl.canvas.width = maxSize[0] * 4;
+ gl.canvas.height = maxSize[1] * 4;
+ shouldBeTrue('gl.drawingBufferWidth > 0');
+ shouldBeTrue('gl.drawingBufferHeight > 0');
+ shouldBeTrue('gl.drawingBufferWidth <= maxSize[0]');
+ shouldBeTrue('gl.drawingBufferHeight <= maxSize[1]');
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+
+ debug("");
+ debug("Checking scaling up then back down to 50/50, drawing still works.");
+ gl.canvas.width = 50;
+ gl.canvas.height = 50;
+ shouldBeTrue('gl.drawingBufferWidth == 50');
+ shouldBeTrue('gl.drawingBufferHeight == 50');
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+ drawTriangleTest(gl);
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+}
+debug("")
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html
new file mode 100644
index 0000000000..e1f458e59a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/drawingbuffer-test.html
@@ -0,0 +1,117 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas.drawingBufferWidth,drawingBufferHeight Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+debug("");
+
+var gl;
+var oldViewport;
+
+function getMaxViewportDimensions() {
+ // create a fresh canvas. This canvas will be discarded
+ // after exiting this function.
+ var canvas = document.createElement("canvas");
+ gl = wtu.create3DContext(canvas, {antialias: false});
+ if (!gl) {
+ testFailed("context does not exist");
+ return [0, 0];
+ } else {
+ testPassed("context exists");
+
+ // For a default size canvas these should be equal.
+ // WebGL contexts are not allowed to change the size of the drawingBuffer
+ // for things like hi-res displays.
+ shouldBe('gl.drawingBufferWidth', 'gl.canvas.width');
+ shouldBe('gl.drawingBufferHeight', 'gl.canvas.height');
+ return gl.getParameter(gl.MAX_VIEWPORT_DIMS);
+ }
+}
+
+function test(desiredWidth, desiredHeight) {
+ debug("");
+ debug("testing canvas width = " + desiredWidth + ", height = " + desiredHeight);
+
+ // Make a fresh canvas.
+ var canvas = document.createElement("canvas");
+ canvas.width = desiredWidth;
+ canvas.height = desiredHeight;
+
+ // This 'gl' must be global for shouldBe to work.
+ gl = wtu.create3DContext(canvas, {antialias: false});
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ // Verify these stats didn't change since they come from a different
+ // context.
+ shouldBe('gl.getParameter(gl.MAX_VIEWPORT_DIMS)[0]', 'maxSize[0]');
+ shouldBe('gl.getParameter(gl.MAX_VIEWPORT_DIMS)[1]', 'maxSize[1]');
+
+ // check the initial viewport matches the drawingBufferWidth and drawingBufferHeight
+ shouldBe('gl.getParameter(gl.VIEWPORT)[0]', '0');
+ shouldBe('gl.getParameter(gl.VIEWPORT)[1]', '0');
+ shouldBe('gl.getParameter(gl.VIEWPORT)[2]', 'gl.drawingBufferWidth');
+ shouldBe('gl.getParameter(gl.VIEWPORT)[3]', 'gl.drawingBufferHeight');
+
+ debug("");
+ debug("testing resizing canvas to width = " + desiredWidth + ", height = " + desiredHeight);
+
+ oldViewport = gl.getParameter(gl.VIEWPORT);
+
+ // flip width and height
+ canvas.width = desiredHeight;
+ canvas.height = desiredWidth;
+
+ // Verify the viewport didn't change.
+ shouldBe('gl.getParameter(gl.VIEWPORT)[0]', 'oldViewport[0]');
+ shouldBe('gl.getParameter(gl.VIEWPORT)[1]', 'oldViewport[1]');
+ shouldBe('gl.getParameter(gl.VIEWPORT)[2]', 'oldViewport[2]');
+ shouldBe('gl.getParameter(gl.VIEWPORT)[3]', 'oldViewport[3]');
+
+ // fix the viewport
+// gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
+
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+ }
+}
+
+var wtu = WebGLTestUtils;
+var maxSize = getMaxViewportDimensions();
+debug("MAX_VIEWPORT_DIMS: " + maxSize[0] + ", " + maxSize[1]);
+
+shouldBeTrue('maxSize[0] > 0');
+shouldBeTrue('maxSize[1] > 0');
+
+// test a small size to make sure it works at all.
+test(16, 32);
+
+// Make a canvas slightly larger than the max size WebGL can handle.
+// From section 2.2 of the spec the WebGL implementation should allow this to work.
+
+// test a size larger than MAX_VIEWPORT_DIMS in both dimensions
+test(maxSize[0] + 32, 8);
+
+debug("")
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html
new file mode 100644
index 0000000000..bc21aca2ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-affected-by-to-data-url.html
@@ -0,0 +1,81 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Verifies than GL framebuffer bindings do not change by toDataURL()</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Verifies than GL framebuffer bindings do not change by toDataURL()");
+
+var wtu = WebGLTestUtils;
+function test() {
+ var glCanvas = document.getElementById("example");
+ var gl = wtu.create3DContext(glCanvas, {preserveDrawingBuffer: true, premultipliedAlpha: true});
+
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+
+ var program = wtu.setupColorQuad(gl);
+
+ // Clear backbuffer in red.
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+
+ var fbo = gl.createFramebuffer();
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 50, 50, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ 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.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ return;
+ }
+
+ // Clear the FBO in green.
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // backbuffer is still in red.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ // toDataURL() calls must not bind backbuffer.
+ glCanvas.toDataURL();
+ // Calling twice caused a bug due to wrong cache impl; crbug.com/445848
+ glCanvas.toDataURL();
+ // It must applies to the FBO, not backbuffer.
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // backbuffer must be in red, not green.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+}
+test();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html
new file mode 100644
index 0000000000..e342841fe3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/framebuffer-bindings-unaffected-on-resize.html
@@ -0,0 +1,85 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Verifies that GL framebuffer bindings do not change when canvas is resized</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="4" height="4"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+enableJSTestPreVerboseLogging();
+description("Verifies that GL framebuffer bindings do not change when canvas is resized");
+
+var err;
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var gl = wtu.create3DContext(canvas);
+var green = [0, 255, 0, 255];
+var blue = [0, 0, 255, 255];
+var fboSize = 2;
+shouldBeTrue("fboSize < canvas.width");
+var fbo = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+var fboTex = gl.createTexture();
+gl.activeTexture(gl.TEXTURE1);
+gl.bindTexture(gl.TEXTURE_2D, fboTex);
+gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fboTex, 0);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, fboSize, fboSize, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+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);
+shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+
+function checkFBO(color, msg) {
+ wtu.checkCanvasRect(gl, 0, 0, fboSize, fboSize, color, msg);
+ wtu.checkCanvasRect(gl, fboSize, fboSize, fboSize, fboSize, [0, 0, 0, 0], "area outside fbo should be transparent black");
+}
+
+// The FBO is 2x2 and it's bound so clearing should clear a 2x2 area
+// and calling read pixels should read the clear color in that 2x2 area
+// and 0,0,0,0 outside that area.
+//
+// If the FBO is no longer bound because of a WebGL implementation error
+// then likely the clear will clear the backbuffer and reading outside
+// the 2x2 area will not be 0,0,0,0
+
+function test() {
+ gl.clearColor(0, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ checkFBO(blue, "should be blue");
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ checkFBO(green, "should be green");
+}
+
+debug("test before resizing canvas");
+test();
+debug("test after resizing canvas");
+canvas.width = 8;
+test();
+debug("test after resizing canvas and waiting for compositing");
+canvas.width = 16;
+wtu.waitForComposite(function() {
+ test();
+ finishTest();
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+});
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html
new file mode 100644
index 0000000000..ed42083030
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/rapid-resizing.html
@@ -0,0 +1,171 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Rapid Resizing 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>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas1" style="width: 256px; height: 256px;"> </canvas>
+<canvas id="canvas2" style="width: 256px; height: 256px;"> </canvas>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec2 position;
+void main()
+{
+ gl_Position = vec4(position, 0.0, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(0.0,1.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+
+description("Verifies that rapidly resizing the canvas works correctly.");
+
+debug("");
+debug("Regression test for Chromium <a href='http://crbug.com/299371'>Issue 299371</a> and <a href='http://crbug.com/557848'>Issue 557848</a>");
+debug("");
+
+var err;
+var wtu = WebGLTestUtils;
+var canvas;
+var largeSize = 256;
+var smallSize = 128;
+var currentSize;
+var gl;
+var program;
+var numFrames = 0;
+var testNumber = 0;
+
+function nextTest() {
+ ++testNumber;
+ numFrames = 0;
+ currentSize = largeSize;
+ if (testNumber > 2) {
+ finishTest();
+ return;
+ }
+
+ canvas = document.getElementById("canvas" + testNumber);
+ canvas.width = currentSize;
+ canvas.height = currentSize;
+ var usePreserveDrawingBuffer = (testNumber == 1) ? true : false;
+ debug("Testing preserveDrawingBuffer = " + usePreserveDrawingBuffer);
+ gl = wtu.create3DContext(canvas, { preserveDrawingBuffer: usePreserveDrawingBuffer });
+
+ if (!gl) {
+ testFailed("context does not exist");
+
+ wtu.requestAnimFrame(nextTest);
+ } else {
+ testPassed("context exists");
+
+ gl.clearColor(0, 0, 0, 1);
+
+ program = wtu.setupProgram(gl, ["vshader", "fshader"], ["position"]);
+ shouldBeNonNull("program");
+
+ // Prepare to draw quads
+ var quadSize = 0.1;
+
+ var vertexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ // Lower left
+ -1, -1 + quadSize,
+ -1, -1,
+ -1 + quadSize, -1,
+ -1 + quadSize, -1 + quadSize,
+
+ // Lower right
+ 1 - quadSize, -1 + quadSize,
+ 1 - quadSize, -1,
+ 1, -1,
+ 1, -1 + quadSize,
+
+ // Upper right
+ 1 - quadSize, 1,
+ 1 - quadSize, 1 - quadSize,
+ 1, 1 - quadSize,
+ 1, 1,
+
+ // Upper left
+ -1, 1,
+ -1, 1 - quadSize,
+ -1 + quadSize, 1 - quadSize,
+ -1 + quadSize, 1
+ ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+ var indexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([
+ 0, 1, 2,
+ 0, 2, 3,
+
+ 4, 5, 6,
+ 4, 6, 7,
+
+ 8, 9, 10,
+ 8, 10, 11,
+
+ 12, 13, 14,
+ 12, 14, 15
+ ]), gl.STATIC_DRAW);
+
+ wtu.requestAnimFrame(render);
+ }
+}
+
+function render() {
+ if (++numFrames < 30) {
+ if (currentSize == largeSize) {
+ canvas.height = smallSize;
+ currentSize = smallSize;
+ } else {
+ canvas.height = largeSize;
+ currentSize = largeSize;
+ }
+ }
+
+ gl.viewport(0, 0, largeSize, currentSize);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawElements(gl.TRIANGLES, 24, gl.UNSIGNED_SHORT, 0);
+
+ // Check the four corners
+ var green = [ 0, 255, 0, 255 ];
+ var inset = 3;
+ wtu.checkCanvasRect(gl, inset, inset, 1, 1, green, "lower left should be green", 1);
+ wtu.checkCanvasRect(gl, largeSize - inset, inset, 1, 1, green, "lower right should be green", 1);
+ wtu.checkCanvasRect(gl, inset, currentSize - inset, 1, 1, green, "upper left should be green", 1);
+ wtu.checkCanvasRect(gl, largeSize - inset, currentSize - inset, 1, 1, green, "upper right should be green", 1);
+
+ if (numFrames < 60) {
+ wtu.requestAnimFrame(render);
+ } else {
+ wtu.requestAnimFrame(nextTest);
+ }
+}
+
+wtu.requestAnimFrame(nextTest);
+
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/render-after-resize-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/render-after-resize-test.html
new file mode 100644
index 0000000000..f973d4d618
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/render-after-resize-test.html
@@ -0,0 +1,142 @@
+<!--
+Copyright (c) 2020 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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL render after resize 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>
+</head>
+<body>
+<div id="description"></div>
+<canvas style="width: 100px; height: 100px; border: 1px solid black;" id="c"></canvas>
+<div id="console"></div>
+<script>
+description("This test ensures WebGL implementations can render correctly after resizing the canvas.");
+debug("");
+
+const wtu = WebGLTestUtils;
+const gl = wtu.create3DContext("c", {depth: true, stencil: true});
+shouldBeTrue("gl != null");
+
+gl.clearColor(1,0,0,1);
+
+const positionLocation = 0;
+const program = wtu.setupColorQuad(gl, positionLocation);
+const colorLocation = gl.getUniformLocation(program, 'u_color');
+gl.useProgram(program);
+
+const SMALL = 2;
+// Changing this size to something smaller produces
+// different results. Sometimes wrong, sometimes correct.
+const LARGE = 1200;
+
+gl.uniform4fv(colorLocation, [0.0, 1.0, 0.0, 1.0]);
+
+// -
+
+debug('\nResize then render.');
+gl.canvas.width = gl.canvas.height = SMALL;
+gl.viewport(0, 0, SMALL, SMALL);
+
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.drawUnitQuad(gl);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 255, 0, 255 ]);
+
+// -
+
+debug('\nResize twice then render.');
+gl.canvas.width = gl.canvas.height = LARGE;
+gl.canvas.width = gl.canvas.height = SMALL;
+
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.drawUnitQuad(gl);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 255, 0, 255 ]);
+
+debug('\nCause a GL error, then resize and render.');
+gl.depthFunc(0); // Causes INVALID_ENUM
+gl.canvas.width = gl.canvas.height = LARGE;
+gl.clear(gl.COLOR_BUFFER_BIT);
+gl.canvas.width = gl.canvas.height = SMALL;
+
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.drawUnitQuad(gl);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 255, 0, 255 ]);
+wtu.glErrorShouldBe(gl, gl.INVALID_ENUM);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+// -
+
+debug('\nRender, no-op resize, then depth-fail render.');
+
+gl.enable(gl.DEPTH_TEST);
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+gl.uniform4fv(colorLocation, [0.0, 1.0, 0.0, 1.0]);
+wtu.drawUnitQuad(gl);
+
+gl.canvas.width = gl.canvas.width;
+gl.uniform4fv(colorLocation, [0.0, 0.0, 1.0, 1.0]);
+wtu.drawUnitQuad(gl);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 255, 0, 255 ]);
+
+// Reset
+gl.disable(gl.DEPTH_TEST);
+
+// -
+
+debug('\nRender, no-op resize, then stencil-fail render.');
+
+gl.enable(gl.STENCIL_TEST);
+gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);
+gl.stencilFunc(gl.EQUAL, 0, 0xff);
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+gl.uniform4fv(colorLocation, [0.0, 1.0, 0.0, 1.0]);
+wtu.drawUnitQuad(gl);
+
+gl.canvas.width = gl.canvas.width;
+gl.uniform4fv(colorLocation, [0.0, 0.0, 1.0, 1.0]);
+wtu.drawUnitQuad(gl);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 255, 0, 255 ]);
+
+// Reset
+gl.disable(gl.STENCIL_TEST);
+gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+gl.stencilFunc(gl.ALWAYS, 0, 0xff);
+
+// -
+
+debug('\nRender, no-op resize, then scissor render.');
+
+gl.enable(gl.SCISSOR_TEST);
+gl.clear(gl.COLOR_BUFFER_BIT);
+gl.uniform4fv(colorLocation, [0.0, 1.0, 0.0, 1.0]);
+wtu.drawUnitQuad(gl);
+
+gl.canvas.width = gl.canvas.width;
+gl.enable(gl.SCISSOR_TEST);
+gl.scissor(0, 0, 1, 1);
+gl.uniform4fv(colorLocation, [0.0, 0.0, 1.0, 1.0]);
+wtu.drawUnitQuad(gl);
+gl.disable(gl.SCISSOR_TEST);
+
+wtu.checkCanvasRect(gl, 1, 0, 1, 1, [ 0, 255, 0, 255 ]);
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [ 0, 0, 255, 255 ]);
+
+// -
+
+finishTest();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html
new file mode 100644
index 0000000000..ac05a734ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/texture-bindings-unaffected-on-resize.html
@@ -0,0 +1,66 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="4" height="4"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verifies that GL texture bindings do not change when canvas is resized');
+
+var err;
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var gl = wtu.create3DContext(canvas);
+var program = wtu.setupTexturedQuad(gl);
+
+var green = [0, 255, 0, 255];
+var blue = [0, 0, 255, 255];
+var tex0 = gl.createTexture();
+wtu.fillTexture(gl, tex0, 1, 1, blue, 0);
+gl.activeTexture(gl.TEXTURE1)
+var tex1 = gl.createTexture();
+wtu.fillTexture(gl, tex1, 1, 1, green, 0);
+
+var loc = gl.getUniformLocation(program, "tex");
+
+function test() {
+ gl.viewport(0, 0, canvas.width, canvas.height);
+ gl.uniform1i(loc, 0);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, blue, "should be blue");
+ gl.uniform1i(loc, 1);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, green, "should be green");
+}
+
+debug("test before resizing canvas");
+test();
+debug("test after resizing canvas");
+canvas.width = 8;
+test();
+debug("test after resizing canvas and waiting for compositing");
+canvas.width = 16;
+wtu.waitForComposite(function() {
+ test();
+ finishTest();
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+});
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-after-composite.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-after-composite.html
new file mode 100644
index 0000000000..668b9c7154
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-after-composite.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL toDataURL after composite 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>
+</head>
+<body>
+<canvas width="20" height="20" style="border: 1px solid black; width: 128px; height: 128px" id="c3d"></canvas>
+<canvas width="20" height="20" style="border: 1px solid black; width: 128px; height: 128px" id="c2d"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script type="application/javascript">
+const wtu = WebGLTestUtils;
+let gl;
+let ctx;
+
+function main() {
+ description();
+ const c2d = document.getElementById("c2d");
+ ctx = c2d.getContext("2d");
+ gl = wtu.create3DContext("c3d", { preserveDrawingBuffer: true });
+
+ // Clear to green
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ wtu.waitForComposite(() => {
+ // Performs gl.canvas.toDataURL() internally
+ let img = wtu.makeImageFromCanvas(gl.canvas, function() {
+ ctx.drawImage(img, 0, 0);
+ wtu.checkCanvas(ctx, [0, 255, 0], "toDataURL loaded into image, drawn into 2D context, should be green", 5);
+ finishTest();
+ });
+ });
+
+};
+
+main();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html
new file mode 100644
index 0000000000..60e882c61f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/to-data-url-test.html
@@ -0,0 +1,142 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL toDataURL 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>
+</head>
+<body>
+<canvas width="20" height="20" style="border: 1px solid black; width: 16px; height: 16px" id="c3d"></canvas>
+<canvas width="20" height="20" style="border: 1px solid black; width: 16px; height: 16px" id="c2d"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script type="application/javascript">
+var wtu = WebGLTestUtils;
+var numTests = 10;
+var gl;
+var ctx;
+
+var main = function() {
+ description();
+ ctx = document.getElementById("c2d").getContext("2d");
+
+ var updateCanvas = function(width, height, attributes) {
+ var canvas = document.getElementById("c3d");
+
+ if (gl && (gl.attributes !== attributes)) {
+ // Attributes changed, recreate the canvas
+ var newCanvas = canvas.cloneNode();
+ canvas.parentNode.replaceChild(newCanvas, canvas);
+ canvas = newCanvas;
+ gl = undefined;
+ }
+
+ canvas.width = width;
+ canvas.height = height;
+
+ if (!gl) {
+ gl = wtu.create3DContext(canvas, attributes);
+
+ if (!gl) {
+ testFailed("can't create 3d context");
+ return;
+ }
+
+ gl.attributes = attributes;
+ }
+
+ return gl;
+ };
+
+ var clearRect = function(gl, x, y, width, height, color) {
+ gl.clearColor(color[0] / 255, color[1] / 255, color[2] / 255, color[3] / 255);
+ gl.scissor(x, y, width, height);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ };
+
+ var testSize = function(width, height, attributes, callback) {
+ let attributesDebugMessage = "";
+ if (attributes) {
+ attributesDebugMessage = " attributes: " + JSON.stringify(attributes);
+ }
+ debug("testing " + width + " by " + height + attributesDebugMessage);
+ var gl = updateCanvas(width, height, attributes);
+ if (!gl) {
+ callback();
+ return;
+ }
+
+ gl.viewport(0, 0, width, height);
+ gl.enable(gl.SCISSOR_TEST);
+
+ var bottomColor = [255, 0, 0, 255];
+ var topColor = [0, 255, 0, 255];
+ var rightColor = [0, 0, 255, 255];
+ var halfHeight = Math.floor(height / 2);
+ var topHeight = height - halfHeight;
+ var canvasTopHeight = height - topHeight;
+ clearRect(gl, 0, 0, width, halfHeight, bottomColor);
+ clearRect(gl, 0, halfHeight, width, topHeight, topColor);
+ clearRect(gl, width - 1, 0, 1, height, rightColor);
+
+ // Performs gl.canvas.toDataURL() internally
+ var img = wtu.makeImageFromCanvas(gl.canvas, function() {
+ ctx.canvas.width = width;
+ ctx.canvas.height = height;
+ ctx.imageSmoothingEnabled = false;
+ ctx.drawImage(img, 0, 0);
+ wtu.checkCanvasRect(ctx, 0, 0, width - 1, topHeight, topColor);
+ wtu.checkCanvasRect(ctx, 0, topHeight, width - 1, halfHeight, bottomColor);
+ wtu.checkCanvasRect(ctx, width - 1, 0, 1, height, rightColor);
+ debug("");
+ callback();
+ });
+ };
+
+ const premultipliedAlphaAttributes = {
+ premultipliedAlpha: false,
+ };
+ var tests = [
+ { width: 16 , height: 16 , },
+ { width: 16 - 1, height: 16 , },
+ { width: 16 - 1, height: 16 - 1, },
+ { width: 16 + 1, height: 16 - 1, },
+ { width: 16 - 1, height: 16 + 1, },
+ { width: 256 , height: 256 , },
+ { width: 256 - 1, height: 256 , },
+ { width: 256 - 1, height: 256 - 1, },
+ { width: 256 + 1, height: 256 - 1, },
+ { width: 256 - 1, height: 256 + 1, },
+ { width: 512 , height: 512 , },
+ { width: 512 - 1, height: 512 , },
+ { width: 512 - 1, height: 512 - 1, },
+ { width: 512 + 1, height: 512 - 1, },
+ { width: 512 - 1, height: 512 + 1, },
+ { width: 16 , height: 16 , attributes: premultipliedAlphaAttributes},
+ ];
+ var testIndex = 0;
+ var runNextTest = function() {
+ if (testIndex == tests.length) {
+ finishTest();
+ return;
+ }
+ var test = tests[testIndex++];
+ testSize(test.width, test.height, test.attributes, function() {
+ setTimeout(runNextTest, 0);
+ })
+ };
+ runNextTest();
+};
+main();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html
new file mode 100644
index 0000000000..70414fc1a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/viewport-unchanged-upon-resize.html
@@ -0,0 +1,92 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 g_Position;
+
+void main()
+{
+ gl_Position = vec4(g_Position.x, g_Position.y, g_Position.z, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+</head>
+<body>
+<canvas id="example" width="4" height="4"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verifies that GL viewport does not change when canvas is resized');
+
+var err;
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["g_Position"]);
+
+var vertices = new Float32Array([
+ 1.0, 1.0, 0.0,
+ -1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, -1.0, 0.0]);
+var vbo = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+// Clear and set up
+gl.clearColor(0, 0, 1, 1);
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+gl.useProgram(program);
+// Draw the triangle pair to the frame buffer
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+// Ensure that the frame buffer is red at the sampled pixel
+wtu.checkCanvasRect(gl, 2, 2, 1, 1, [255, 0, 0, 255]);
+
+// Now resize the canvas
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No GL errors before resizing the canvas");
+var canvas = gl.canvas;
+canvas.width = 8;
+canvas.height = 8;
+err = gl.getError();
+// Some implementations might lost the context when resizing
+if (err == gl.CONTEXT_LOST_WEBGL) {
+ testPassed("canvas lost context on resize");
+} else {
+ shouldBe("err", "gl.NO_ERROR");
+ // Do another render
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ // This time, because we did not change the viewport, it should
+ // still be (0, 0, 4, 4), so only the lower-left quadrant should
+ // have been filled.
+ wtu.checkCanvasRect(gl, 6, 6, 1, 1, [0, 0, 255, 255]);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/canvas/webgl-to-2d-canvas.html b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/webgl-to-2d-canvas.html
new file mode 100644
index 0000000000..bed9c89718
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/canvas/webgl-to-2d-canvas.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL canvas to 2D canvas 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>
+<style>
+canvas {
+ border: 1px solid black;
+ margin: 3px;
+ display: block;
+}
+</style>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script type="application/javascript">
+var wtu = WebGLTestUtils;
+var diff;
+var consoleElem = document.querySelector('#console');
+
+var main = function() {
+ description();
+
+ test({ premultipliedAlpha: true, }, [171, 234, 172, 191], [128, 255, 177, 128]);
+ test({ premultipliedAlpha: false, }, [170, 234, 171, 191], [128, 255, 177, 128]);
+ test({ alpha: false, }, [127, 255, 178, 255], [128, 255, 178, 255]);
+ test({ premultipliedAlpha: false, alpha: false, }, [127, 255, 178, 255], [128, 255, 178, 255]);
+
+ function test(attrs, expected, expected2) {
+ debug(`test: ${JSON.stringify(attrs)}`);
+
+ const canvas = document.createElement('canvas');
+ canvas.width = 64;
+ canvas.height = 64;
+
+ const gl = wtu.create3DContext(canvas, attrs);
+ if (!gl) {
+ testFailed("can't create 3d context");
+ return;
+ }
+ const alpha = 0.5;
+ const effectiveAlpha = attrs.premultipliedAlpha ? alpha : 1.0;
+ const color = [0.5, 1.0, 0.7].map(v => v * effectiveAlpha);
+ color.push(0.5);
+ debug(`clearColor: ${color.join(', ')}`);
+ gl.clearColor(...color);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ consoleElem.appendChild(canvas);
+
+ const ctx = document.createElement('canvas').getContext('2d');
+ ctx.canvas.width = 128;
+ ctx.canvas.height = 128;
+ ctx.fillStyle = 'rgba(255, 190, 160, 0.5)';
+ ctx.fillRect(0, 0, 64, 64);
+ ctx.drawImage(canvas, 32, 32);
+ consoleElem.appendChild(ctx.canvas);
+
+ wtu.checkCanvasRect(ctx, 33, 33, 1, 1, expected, 'canvas 2d is correct color', 3);
+ wtu.checkCanvasRect(ctx, 65, 65, 1, 1, expected2, 'canvas 2d is correct color', 3);
+ debug('----------------------------------');
+ }
+ finishTest();
+};
+main();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt
new file mode 100644
index 0000000000..f1acae5dfa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/00_test_list.txt
@@ -0,0 +1,21 @@
+--max-version 1.9.9 constants-and-properties.html
+--min-version 1.0.2 context-attribute-preserve-drawing-buffer.html
+--min-version 1.0.4 context-attribute-preserve-drawing-buffer-antialias.html
+context-attributes-alpha-depth-stencil-antialias.html
+--min-version 1.0.4 context-size-change.html
+--min-version 1.0.4 context-no-alpha-fbo-with-alpha.html
+--min-version 1.0.2 --slow context-creation-and-destruction.html
+--min-version 1.0.3 --slow context-creation.html
+--min-version 1.0.3 --slow context-eviction-with-garbage-collection.html
+--min-version 1.0.3 context-hidden-alpha.html
+--min-version 1.0.2 context-release-upon-reload.html
+--min-version 1.0.2 context-release-with-workers.html
+context-lost-restored.html
+context-lost.html
+--max-version 1.9.9 context-type-test.html
+--min-version 1.0.4 deleted-object-behavior.html
+incorrect-context-object-behaviour.html
+--max-version 1.9.9 methods.html
+premultiplyalpha-test.html
+--min-version 1.0.4 user-defined-properties-on-context.html
+--min-version 1.0.4 zero-sized-canvas.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html
new file mode 100644
index 0000000000..ccf128e11b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/constants-and-properties.html
@@ -0,0 +1,546 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Constants and Properties 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<script>
+"use strict";
+description("This test ensures that the WebGL context has all the constants and (non-function) properties in the specification.");
+
+var constants = {
+ /* ClearBufferMask */
+DEPTH_BUFFER_BIT : 0x00000100,
+STENCIL_BUFFER_BIT : 0x00000400,
+COLOR_BUFFER_BIT : 0x00004000,
+
+ /* BeginMode */
+POINTS : 0x0000,
+LINES : 0x0001,
+LINE_LOOP : 0x0002,
+LINE_STRIP : 0x0003,
+TRIANGLES : 0x0004,
+TRIANGLE_STRIP : 0x0005,
+TRIANGLE_FAN : 0x0006,
+
+ /* AlphaFunction (not supported in ES20) */
+ /* NEVER */
+ /* LESS */
+ /* EQUAL */
+ /* LEQUAL */
+ /* GREATER */
+ /* NOTEQUAL */
+ /* GEQUAL */
+ /* ALWAYS */
+
+ /* BlendingFactorDest */
+ZERO : 0,
+ONE : 1,
+SRC_COLOR : 0x0300,
+ONE_MINUS_SRC_COLOR : 0x0301,
+SRC_ALPHA : 0x0302,
+ONE_MINUS_SRC_ALPHA : 0x0303,
+DST_ALPHA : 0x0304,
+ONE_MINUS_DST_ALPHA : 0x0305,
+
+ /* BlendingFactorSrc */
+ /* ZERO */
+ /* ONE */
+DST_COLOR : 0x0306,
+ONE_MINUS_DST_COLOR : 0x0307,
+SRC_ALPHA_SATURATE : 0x0308,
+ /* SRC_ALPHA */
+ /* ONE_MINUS_SRC_ALPHA */
+ /* DST_ALPHA */
+ /* ONE_MINUS_DST_ALPHA */
+
+ /* BlendEquationSeparate */
+FUNC_ADD : 0x8006,
+BLEND_EQUATION : 0x8009,
+BLEND_EQUATION_RGB : 0x8009, /* same as BLEND_EQUATION */
+BLEND_EQUATION_ALPHA : 0x883D,
+
+ /* BlendSubtract */
+FUNC_SUBTRACT : 0x800A,
+FUNC_REVERSE_SUBTRACT : 0x800B,
+
+ /* Separate Blend Functions */
+BLEND_DST_RGB : 0x80C8,
+BLEND_SRC_RGB : 0x80C9,
+BLEND_DST_ALPHA : 0x80CA,
+BLEND_SRC_ALPHA : 0x80CB,
+CONSTANT_COLOR : 0x8001,
+ONE_MINUS_CONSTANT_COLOR : 0x8002,
+CONSTANT_ALPHA : 0x8003,
+ONE_MINUS_CONSTANT_ALPHA : 0x8004,
+BLEND_COLOR : 0x8005,
+
+ /* Buffer Objects */
+ARRAY_BUFFER : 0x8892,
+ELEMENT_ARRAY_BUFFER : 0x8893,
+ARRAY_BUFFER_BINDING : 0x8894,
+ELEMENT_ARRAY_BUFFER_BINDING : 0x8895,
+
+STREAM_DRAW : 0x88E0,
+STATIC_DRAW : 0x88E4,
+DYNAMIC_DRAW : 0x88E8,
+
+BUFFER_SIZE : 0x8764,
+BUFFER_USAGE : 0x8765,
+
+CURRENT_VERTEX_ATTRIB : 0x8626,
+
+ /* CullFaceMode */
+FRONT : 0x0404,
+BACK : 0x0405,
+FRONT_AND_BACK : 0x0408,
+
+ /* DepthFunction */
+ /* NEVER */
+ /* LESS */
+ /* EQUAL */
+ /* LEQUAL */
+ /* GREATER */
+ /* NOTEQUAL */
+ /* GEQUAL */
+ /* ALWAYS */
+
+ /* EnableCap */
+ /* TEXTURE_2D */
+CULL_FACE : 0x0B44,
+BLEND : 0x0BE2,
+DITHER : 0x0BD0,
+STENCIL_TEST : 0x0B90,
+DEPTH_TEST : 0x0B71,
+SCISSOR_TEST : 0x0C11,
+POLYGON_OFFSET_FILL : 0x8037,
+SAMPLE_ALPHA_TO_COVERAGE : 0x809E,
+SAMPLE_COVERAGE : 0x80A0,
+
+ /* ErrorCode */
+NO_ERROR : 0,
+INVALID_ENUM : 0x0500,
+INVALID_VALUE : 0x0501,
+INVALID_OPERATION : 0x0502,
+OUT_OF_MEMORY : 0x0505,
+
+ /* FrontFaceDirection */
+CW : 0x0900,
+CCW : 0x0901,
+
+ /* GetPName */
+LINE_WIDTH : 0x0B21,
+ALIASED_POINT_SIZE_RANGE : 0x846D,
+ALIASED_LINE_WIDTH_RANGE : 0x846E,
+CULL_FACE_MODE : 0x0B45,
+FRONT_FACE : 0x0B46,
+DEPTH_RANGE : 0x0B70,
+DEPTH_WRITEMASK : 0x0B72,
+DEPTH_CLEAR_VALUE : 0x0B73,
+DEPTH_FUNC : 0x0B74,
+STENCIL_CLEAR_VALUE : 0x0B91,
+STENCIL_FUNC : 0x0B92,
+STENCIL_FAIL : 0x0B94,
+STENCIL_PASS_DEPTH_FAIL : 0x0B95,
+STENCIL_PASS_DEPTH_PASS : 0x0B96,
+STENCIL_REF : 0x0B97,
+STENCIL_VALUE_MASK : 0x0B93,
+STENCIL_WRITEMASK : 0x0B98,
+STENCIL_BACK_FUNC : 0x8800,
+STENCIL_BACK_FAIL : 0x8801,
+STENCIL_BACK_PASS_DEPTH_FAIL : 0x8802,
+STENCIL_BACK_PASS_DEPTH_PASS : 0x8803,
+STENCIL_BACK_REF : 0x8CA3,
+STENCIL_BACK_VALUE_MASK : 0x8CA4,
+STENCIL_BACK_WRITEMASK : 0x8CA5,
+VIEWPORT : 0x0BA2,
+SCISSOR_BOX : 0x0C10,
+ /* SCISSOR_TEST */
+COLOR_CLEAR_VALUE : 0x0C22,
+COLOR_WRITEMASK : 0x0C23,
+UNPACK_ALIGNMENT : 0x0CF5,
+PACK_ALIGNMENT : 0x0D05,
+MAX_TEXTURE_SIZE : 0x0D33,
+MAX_VIEWPORT_DIMS : 0x0D3A,
+SUBPIXEL_BITS : 0x0D50,
+RED_BITS : 0x0D52,
+GREEN_BITS : 0x0D53,
+BLUE_BITS : 0x0D54,
+ALPHA_BITS : 0x0D55,
+DEPTH_BITS : 0x0D56,
+STENCIL_BITS : 0x0D57,
+POLYGON_OFFSET_UNITS : 0x2A00,
+ /* POLYGON_OFFSET_FILL */
+POLYGON_OFFSET_FACTOR : 0x8038,
+TEXTURE_BINDING_2D : 0x8069,
+SAMPLE_BUFFERS : 0x80A8,
+SAMPLES : 0x80A9,
+SAMPLE_COVERAGE_VALUE : 0x80AA,
+SAMPLE_COVERAGE_INVERT : 0x80AB,
+
+ /* GetTextureParameter */
+ /* TEXTURE_MAG_FILTER */
+ /* TEXTURE_MIN_FILTER */
+ /* TEXTURE_WRAP_S */
+ /* TEXTURE_WRAP_T */
+
+COMPRESSED_TEXTURE_FORMATS : 0x86A3,
+
+ /* HintMode */
+DONT_CARE : 0x1100,
+FASTEST : 0x1101,
+NICEST : 0x1102,
+
+ /* HintTarget */
+GENERATE_MIPMAP_HINT : 0x8192,
+
+ /* DataType */
+BYTE : 0x1400,
+UNSIGNED_BYTE : 0x1401,
+SHORT : 0x1402,
+UNSIGNED_SHORT : 0x1403,
+INT : 0x1404,
+UNSIGNED_INT : 0x1405,
+FLOAT : 0x1406,
+
+ /* PixelFormat */
+DEPTH_COMPONENT : 0x1902,
+ALPHA : 0x1906,
+RGB : 0x1907,
+RGBA : 0x1908,
+LUMINANCE : 0x1909,
+LUMINANCE_ALPHA : 0x190A,
+
+ /* PixelType */
+ /* UNSIGNED_BYTE */
+UNSIGNED_SHORT_4_4_4_4 : 0x8033,
+UNSIGNED_SHORT_5_5_5_1 : 0x8034,
+UNSIGNED_SHORT_5_6_5 : 0x8363,
+
+ /* Shaders */
+FRAGMENT_SHADER : 0x8B30,
+VERTEX_SHADER : 0x8B31,
+MAX_VERTEX_ATTRIBS : 0x8869,
+MAX_VERTEX_UNIFORM_VECTORS : 0x8DFB,
+MAX_VARYING_VECTORS : 0x8DFC,
+MAX_COMBINED_TEXTURE_IMAGE_UNITS : 0x8B4D,
+MAX_VERTEX_TEXTURE_IMAGE_UNITS : 0x8B4C,
+MAX_TEXTURE_IMAGE_UNITS : 0x8872,
+MAX_FRAGMENT_UNIFORM_VECTORS : 0x8DFD,
+SHADER_TYPE : 0x8B4F,
+DELETE_STATUS : 0x8B80,
+LINK_STATUS : 0x8B82,
+VALIDATE_STATUS : 0x8B83,
+ATTACHED_SHADERS : 0x8B85,
+ACTIVE_UNIFORMS : 0x8B86,
+ACTIVE_ATTRIBUTES : 0x8B89,
+SHADING_LANGUAGE_VERSION : 0x8B8C,
+CURRENT_PROGRAM : 0x8B8D,
+
+ /* StencilFunction */
+NEVER : 0x0200,
+LESS : 0x0201,
+EQUAL : 0x0202,
+LEQUAL : 0x0203,
+GREATER : 0x0204,
+NOTEQUAL : 0x0205,
+GEQUAL : 0x0206,
+ALWAYS : 0x0207,
+
+ /* StencilOp */
+ /* ZERO */
+KEEP : 0x1E00,
+REPLACE : 0x1E01,
+INCR : 0x1E02,
+DECR : 0x1E03,
+INVERT : 0x150A,
+INCR_WRAP : 0x8507,
+DECR_WRAP : 0x8508,
+
+ /* StringName */
+VENDOR : 0x1F00,
+RENDERER : 0x1F01,
+VERSION : 0x1F02,
+
+ /* TextureMagFilter */
+NEAREST : 0x2600,
+LINEAR : 0x2601,
+
+ /* TextureMinFilter */
+ /* NEAREST */
+ /* LINEAR */
+NEAREST_MIPMAP_NEAREST : 0x2700,
+LINEAR_MIPMAP_NEAREST : 0x2701,
+NEAREST_MIPMAP_LINEAR : 0x2702,
+LINEAR_MIPMAP_LINEAR : 0x2703,
+
+ /* TextureParameterName */
+TEXTURE_MAG_FILTER : 0x2800,
+TEXTURE_MIN_FILTER : 0x2801,
+TEXTURE_WRAP_S : 0x2802,
+TEXTURE_WRAP_T : 0x2803,
+
+ /* TextureTarget */
+TEXTURE_2D : 0x0DE1,
+TEXTURE : 0x1702,
+
+TEXTURE_CUBE_MAP : 0x8513,
+TEXTURE_BINDING_CUBE_MAP : 0x8514,
+TEXTURE_CUBE_MAP_POSITIVE_X : 0x8515,
+TEXTURE_CUBE_MAP_NEGATIVE_X : 0x8516,
+TEXTURE_CUBE_MAP_POSITIVE_Y : 0x8517,
+TEXTURE_CUBE_MAP_NEGATIVE_Y : 0x8518,
+TEXTURE_CUBE_MAP_POSITIVE_Z : 0x8519,
+TEXTURE_CUBE_MAP_NEGATIVE_Z : 0x851A,
+MAX_CUBE_MAP_TEXTURE_SIZE : 0x851C,
+
+ /* TextureUnit */
+TEXTURE0 : 0x84C0,
+TEXTURE1 : 0x84C1,
+TEXTURE2 : 0x84C2,
+TEXTURE3 : 0x84C3,
+TEXTURE4 : 0x84C4,
+TEXTURE5 : 0x84C5,
+TEXTURE6 : 0x84C6,
+TEXTURE7 : 0x84C7,
+TEXTURE8 : 0x84C8,
+TEXTURE9 : 0x84C9,
+TEXTURE10 : 0x84CA,
+TEXTURE11 : 0x84CB,
+TEXTURE12 : 0x84CC,
+TEXTURE13 : 0x84CD,
+TEXTURE14 : 0x84CE,
+TEXTURE15 : 0x84CF,
+TEXTURE16 : 0x84D0,
+TEXTURE17 : 0x84D1,
+TEXTURE18 : 0x84D2,
+TEXTURE19 : 0x84D3,
+TEXTURE20 : 0x84D4,
+TEXTURE21 : 0x84D5,
+TEXTURE22 : 0x84D6,
+TEXTURE23 : 0x84D7,
+TEXTURE24 : 0x84D8,
+TEXTURE25 : 0x84D9,
+TEXTURE26 : 0x84DA,
+TEXTURE27 : 0x84DB,
+TEXTURE28 : 0x84DC,
+TEXTURE29 : 0x84DD,
+TEXTURE30 : 0x84DE,
+TEXTURE31 : 0x84DF,
+ACTIVE_TEXTURE : 0x84E0,
+
+ /* TextureWrapMode */
+REPEAT : 0x2901,
+CLAMP_TO_EDGE : 0x812F,
+MIRRORED_REPEAT : 0x8370,
+
+ /* Uniform Types */
+FLOAT_VEC2 : 0x8B50,
+FLOAT_VEC3 : 0x8B51,
+FLOAT_VEC4 : 0x8B52,
+INT_VEC2 : 0x8B53,
+INT_VEC3 : 0x8B54,
+INT_VEC4 : 0x8B55,
+BOOL : 0x8B56,
+BOOL_VEC2 : 0x8B57,
+BOOL_VEC3 : 0x8B58,
+BOOL_VEC4 : 0x8B59,
+FLOAT_MAT2 : 0x8B5A,
+FLOAT_MAT3 : 0x8B5B,
+FLOAT_MAT4 : 0x8B5C,
+SAMPLER_2D : 0x8B5E,
+SAMPLER_CUBE : 0x8B60,
+
+ /* Vertex Arrays */
+VERTEX_ATTRIB_ARRAY_ENABLED : 0x8622,
+VERTEX_ATTRIB_ARRAY_SIZE : 0x8623,
+VERTEX_ATTRIB_ARRAY_STRIDE : 0x8624,
+VERTEX_ATTRIB_ARRAY_TYPE : 0x8625,
+VERTEX_ATTRIB_ARRAY_NORMALIZED : 0x886A,
+VERTEX_ATTRIB_ARRAY_POINTER : 0x8645,
+VERTEX_ATTRIB_ARRAY_BUFFER_BINDING : 0x889F,
+
+ /* Read Format */
+IMPLEMENTATION_COLOR_READ_TYPE : 0x8B9A,
+IMPLEMENTATION_COLOR_READ_FORMAT : 0x8B9B,
+
+ /* Shader Source */
+COMPILE_STATUS : 0x8B81,
+
+ /* Shader Precision-Specified Types */
+LOW_FLOAT : 0x8DF0,
+MEDIUM_FLOAT : 0x8DF1,
+HIGH_FLOAT : 0x8DF2,
+LOW_INT : 0x8DF3,
+MEDIUM_INT : 0x8DF4,
+HIGH_INT : 0x8DF5,
+
+ /* Framebuffer Object. */
+FRAMEBUFFER : 0x8D40,
+RENDERBUFFER : 0x8D41,
+
+RGBA4 : 0x8056,
+RGB5_A1 : 0x8057,
+RGB565 : 0x8D62,
+DEPTH_COMPONENT16 : 0x81A5,
+STENCIL_INDEX8 : 0x8D48,
+DEPTH_STENCIL : 0x84F9,
+
+RENDERBUFFER_WIDTH : 0x8D42,
+RENDERBUFFER_HEIGHT : 0x8D43,
+RENDERBUFFER_INTERNAL_FORMAT : 0x8D44,
+RENDERBUFFER_RED_SIZE : 0x8D50,
+RENDERBUFFER_GREEN_SIZE : 0x8D51,
+RENDERBUFFER_BLUE_SIZE : 0x8D52,
+RENDERBUFFER_ALPHA_SIZE : 0x8D53,
+RENDERBUFFER_DEPTH_SIZE : 0x8D54,
+RENDERBUFFER_STENCIL_SIZE : 0x8D55,
+
+FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE : 0x8CD0,
+FRAMEBUFFER_ATTACHMENT_OBJECT_NAME : 0x8CD1,
+FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL : 0x8CD2,
+FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE : 0x8CD3,
+
+COLOR_ATTACHMENT0 : 0x8CE0,
+DEPTH_ATTACHMENT : 0x8D00,
+STENCIL_ATTACHMENT : 0x8D20,
+DEPTH_STENCIL_ATTACHMENT : 0x821A,
+
+NONE : 0,
+
+FRAMEBUFFER_COMPLETE : 0x8CD5,
+FRAMEBUFFER_INCOMPLETE_ATTACHMENT : 0x8CD6,
+FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : 0x8CD7,
+FRAMEBUFFER_INCOMPLETE_DIMENSIONS : 0x8CD9,
+FRAMEBUFFER_UNSUPPORTED : 0x8CDD,
+
+FRAMEBUFFER_BINDING : 0x8CA6,
+RENDERBUFFER_BINDING : 0x8CA7,
+MAX_RENDERBUFFER_SIZE : 0x84E8,
+
+INVALID_FRAMEBUFFER_OPERATION : 0x0506,
+
+/* WebGL-specific enums */
+UNPACK_FLIP_Y_WEBGL : 0x9240,
+UNPACK_PREMULTIPLY_ALPHA_WEBGL : 0x9241,
+CONTEXT_LOST_WEBGL : 0x9242,
+UNPACK_COLORSPACE_CONVERSION_WEBGL : 0x9243,
+BROWSER_DEFAULT_WEBGL : 0x9244
+};
+
+// Other non-function properties on the WebGL object
+var otherProperties = {
+drawingBufferWidth : "number",
+drawingBufferHeight : "number",
+drawingBufferColorSpace : "string",
+unpackColorSpace : "string",
+canvas : "implementation-dependent"
+};
+
+// Properties to be ignored (as a list of strings) because they were
+// added in versions of the spec that are backward-compatible with
+// this version
+var ignoredProperties = [
+];
+
+// Constants removed from the WebGL spec compared to ES 2.0
+var removedConstants = {
+NUM_COMPRESSED_TEXTURE_FORMATS : 0x86A2,
+FIXED : 0x140C,
+ACTIVE_UNIFORM_MAX_LENGTH : 0x8B87,
+ACTIVE_ATTRIBUTE_MAX_LENGTH : 0x8B8A,
+EXTENSIONS : 0x1F03,
+INFO_LOG_LENGTH : 0x8B84,
+SHADER_SOURCE_LENGTH : 0x8B88,
+SHADER_COMPILER : 0x8DFA,
+SHADER_BINARY_FORMATS : 0x8DF8,
+NUM_SHADER_BINARY_FORMATS : 0x8DF9,
+};
+
+function assertProperty(v, p) {
+ if (p in v) {
+ return true;
+ } else {
+ testFailed("Property does not exist: " + p)
+ return false;
+ }
+}
+
+function assertNoProperty(v, p) {
+ if (p in v) {
+ testFailed("Property is defined and should not be: " + p)
+ return false;
+ } else {
+ return true;
+ }
+}
+
+function assertMsg_(bool, msg) {
+ if (!bool) // show only failures to avoid spamming result list
+ assertMsg(bool, msg);
+ return bool;
+}
+
+debug("");
+debug("Canvas.getContext");
+
+var canvas = document.getElementById("canvas");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext(canvas);
+var passed = true;
+for (var i in constants) {
+ var r = assertProperty(gl, i) && assertMsg_(gl[i] == constants[i], "Property "+i+" value test "+gl[i]+" == "+constants[i]);
+ passed = passed && r;
+}
+if (passed) {
+ testPassed("All WebGL constants found to have correct values.");
+}
+passed = true;
+for (var i in removedConstants) {
+ var r = assertNoProperty(gl, i);
+ passed = passed && r;
+}
+if (passed) {
+ testPassed("All constants removed from WebGL spec were absent from WebGL context.");
+}
+var extended = false;
+for (var i in gl) {
+ if (constants[i] !== undefined) {
+ // OK; known constant
+ } else if (ignoredProperties.indexOf(i) != -1) {
+ // OK; constant that should be ignored because it was added in a later version of the spec
+ } else if (otherProperties[i] !== undefined &&
+ (otherProperties[i] == "implementation-dependent" || typeof gl[i] == otherProperties[i])) {
+ // OK; known property of known type
+ } else if (typeof gl[i] != "function" && removedConstants[i] === undefined) {
+ if (!extended) {
+ extended = true;
+ testFailed("Also found the following extra properties:");
+ }
+ testFailed(i);
+ }
+}
+
+if (!extended) {
+ testPassed("No extra properties found on WebGL context.");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer-antialias.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer-antialias.html
new file mode 100644
index 0000000000..fa8d9937db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer-antialias.html
@@ -0,0 +1,143 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="128" height="64" style="width: 32px; height: 32px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const wtu = WebGLTestUtils;
+description(' Test drawingbuffer is preserved when drawing');
+
+const waitForComposite = () => new Promise(resolve => wtu.waitForComposite(resolve));
+const gl = wtu.create3DContext("canvas", {
+ preserveDrawingBuffer: true,
+ antialias: true,
+});
+console.log(gl.getContextAttributes());
+const w = 128;
+const h = 64;
+
+if (!gl) {
+ testFailed('canvas.getContext() failed');
+} else {
+ gl.viewport(0, 0, w, h);
+ runTest(gl, 4);
+}
+
+async function runTest(gl, sampleCount) {
+ const vs = `
+ attribute vec4 position;
+ uniform mat4 mat;
+
+ void main() {
+ gl_Position = mat * position;
+ }
+ `;
+
+ const fs = `
+ precision mediump float;
+ uniform vec4 color;
+ void main() {
+ gl_FragColor = color;
+ }
+ `;
+
+ const positionLoc = 0; // hard coded in shaders so they match
+ const buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ 0, 0,
+ 1, 0,
+ 0, 1,
+ 0, 1,
+ 1, 0,
+ 1, 1,
+ ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(positionLoc);
+ gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);
+
+ const program = wtu.setupProgram(gl, [vs, fs]);
+
+ const colorLoc = gl.getUniformLocation(program, 'color');
+ const matLoc = gl.getUniformLocation(program, 'mat');
+
+ gl.useProgram(program);
+
+ const draw = (color, mat) => {
+ gl.uniform4fv(colorLoc, color);
+ gl.uniformMatrix4fv(matLoc, false, mat);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ };
+
+ const f32Red = [1, 0, 0, 1];
+ const f32Green = [0, 1, 0, 1];
+ const f32Gray = [0.5, 0.5, 0.5, 1];
+
+ const u8Red = [255, 0, 0, 255];
+ const u8Green = [ 0, 255, 0, 255];
+ const u8LightRed = [255, 128, 128, 255];
+ const u8LightGreen = [128, 255, 128, 255];
+
+ draw(f32Red, [
+ 2, 0, 0, 0,
+ 0, 2, 0, 0,
+ 0, 0, 1, 0,
+ -1, -1, 0, 1,
+ ]);
+ await waitForComposite();
+
+ draw(f32Green, [
+ 1, 0, 0, 0,
+ 0, 2, 0, 0,
+ 0, 0, 1, 0,
+ 0, -1, 0, 1,
+ ]);
+ await waitForComposite();
+
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.ONE, gl.ONE);
+ draw(f32Gray, [
+ 1, 0, 0, 0,
+ 0, 2, 0, 0,
+ 0, 0, 1, 0,
+ -0.5, -1, 0, 1,
+ ]);
+ gl.disable(gl.BLEND);
+ await waitForComposite();
+
+ /*
+ expected
+ +-----+-------+---------+--------+
+ | red | ltRed | ltGreen | green |
+ +-----+-------+---------+--------+
+ 0,0
+ */
+
+ const tolerance = 2; // For multisampling resolution differences between GPUs
+ wtu.checkCanvasRect(gl, 0, 0, w / 4, h , u8Red, 'left edge', tolerance)
+ wtu.checkCanvasRect(gl, w * 3 / 4, 0, w / 4, h, u8Green, 'right edge', tolerance);
+ wtu.checkCanvasRect(gl, w / 4, 0, w / 4, h, u8LightRed, 'left of center', tolerance);
+ wtu.checkCanvasRect(gl, w / 2, 0, w / 4, h, u8LightGreen, 'right of center', tolerance);
+
+ finishTest();
+}
+
+var successfullyParsed = true;
+shouldBeTrue("successfullyParsed");
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html
new file mode 100644
index 0000000000..7a023996fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attribute-preserve-drawing-buffer.html
@@ -0,0 +1,117 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<style>
+.pattern {
+ white-space: nowrap;
+ display: inline-block;
+}
+canvas {
+ width:10px;
+ height:10px;
+}
+.square {
+ display:inline-block;
+ width:10px;
+ height:10px;
+ background-color:red;
+}
+</style>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+function checkResult(ctx1, ctx2, preserve) {
+ var imgData1 = ctx1.getImageData(0,0,1,1);
+ var imgData2 = ctx2.getImageData(0,0,1,1);
+ var correct1 = [255,0,0,255];
+ var correct2 = preserve ? [255,0,0,255] : [0,0,0,255];
+ var ok1 = true;
+ var ok2 = true;
+ for (var p = 0; p < 4; ++p) {
+ if (imgData1.data[p] != correct1[p])
+ ok1 = false;
+ if (imgData2.data[p] != correct2[p])
+ ok2 = false;
+ }
+ if (ok1 && ok2)
+ testPassed('Rendered ok with preserveDrawingBuffer ' + preserve +'.');
+ else
+ testFailed('Did not render ok with preserveDrawingBuffer ' + preserve + '.');
+ if (preserve) {
+ finishTest()
+ } else {
+ runTest(true);
+ }
+}
+
+function runTest(preserve) {
+ var c1 = document.getElementById('c' + (preserve * 3 + 1));
+ var c2 = document.getElementById('c' + (preserve * 3 + 2));
+ var c3 = document.getElementById('c' + (preserve * 3 + 3));
+ var ctx1 = c1.getContext('2d');
+ var ctx2 = c2.getContext('2d');
+ var gl = wtu.create3DContext(c3, { alpha:false, preserveDrawingBuffer:preserve });
+ if (!gl) {
+ testFailed("context does not exist");
+ if (preserve) {
+ finishTest()
+ } else {
+ runTest(true);
+ }
+ return;
+ }
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ ctx1.drawImage(c3, 0, 0);
+ wtu.waitForComposite(function() {
+ ctx2.drawImage(c3, 0, 0);
+ checkResult(ctx1, ctx2, preserve);
+ });
+}
+</script>
+</head>
+<body>
+<div class="pattern">
+ <canvas id='c1'></canvas>
+ <canvas id='c2'></canvas>
+ <canvas id='c3'></canvas>
+</div>
+<span>should look like</span>
+<div class="pattern">
+ <div class='square'></div>
+ <div class='square' style='background-color:black'></div>
+ <div class='square'></div>
+</div>
+<hr />
+<div class="pattern">
+ <canvas id='c4'></canvas>
+ <canvas id='c5'></canvas>
+ <canvas id='c6'></canvas>
+</div>
+<span>should look like</span>
+<div class="pattern">
+ <div class='square'></div>
+ <div class='square'></div>
+ <div class='square'></div>
+</div>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verify that preserveDrawingBuffer attribute is honored.');
+runTest(false);
+var successfullyParsed = true;
+shouldBeTrue("successfullyParsed");
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
new file mode 100644
index 0000000000..40f46a744a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-attributes-alpha-depth-stencil-antialias.html
@@ -0,0 +1,281 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 pos;
+attribute vec4 colorIn;
+varying vec4 color;
+
+void main()
+{
+ color = colorIn;
+ gl_Position = vec4(pos.xyz, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+varying vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+
+<script>
+"use strict";
+
+// These four declarations need to be global for "shouldBe" to see them
+var wtu = WebGLTestUtils;
+var gl;
+var contextAttribs = null;
+var redChannels = [0, 0, 0];
+var correctColor = null;
+var framebuffer;
+var fbHasColor;
+var fbHasDepth;
+var fbHasStencil;
+var contextVersion = wtu.getDefault3DContextVersion();
+
+function init()
+{
+ description('Verify WebGLContextAttributes are working as specified, including alpha, depth, stencil, antialias, but not premultipliedAlpha');
+
+ runTest();
+}
+
+var vertices = new Float32Array([
+ 1.0, 1.0, 0.0,
+ -1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, -1.0, 0.0]);
+
+var colors = new Uint8Array([
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255]);
+
+
+function getWebGL(canvasWidth, canvasHeight, contextAttribs, clearColor, clearDepth, clearStencil)
+{
+ var canvas = document.createElement("canvas");
+ if (!canvas)
+ return null;
+ canvas.width = canvasWidth;
+ canvas.height = canvasHeight;
+
+ gl = wtu.create3DContext(canvas, contextAttribs, contextVersion);
+ if (!gl)
+ return null;
+
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["pos", "colorIn"]);
+ if (!program)
+ return null;
+
+ gl.enable(gl.DEPTH_TEST);
+ gl.enable(gl.STENCIL_TEST);
+
+ gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+ gl.clearDepth(clearDepth);
+ gl.clearStencil(clearStencil);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ framebuffer = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.canvas.width, gl.canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ fbHasStencil = false;
+ fbHasDepth = false;
+ fbHasColor = gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE;
+ if (fbHasColor) {
+ var depthStencil = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencil);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, gl.canvas.width, gl.canvas.height);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencil);
+ fbHasDepth = gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE;
+ if (!fbHasDepth) {
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, null);
+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+ } else {
+ fbHasStencil = true;
+ }
+ }
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ var colorOffset = vertices.byteLength;
+ var vbo = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, colorOffset + colors.byteLength, gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices);
+ gl.bufferSubData(gl.ARRAY_BUFFER, colorOffset, colors);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, colorOffset);
+ gl.enableVertexAttribArray(1);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+ return gl;
+}
+
+function draw(gl, verticesCount)
+{
+ verticesCount = verticesCount || vertices.length / 3;
+ gl.drawArrays(gl.TRIANGLES, 0, verticesCount);
+}
+
+function checkDraw(hasAlpha, hasStencil, hasDepth, hasAntialias)
+{
+ let red = [255, 0, 0, 255 ];
+ let black = [0, 0, 0, hasAlpha ? 0 : 255 ];
+ debug(`Testing that stencil ${ hasStencil ? 'affects': 'does not affect'} the rendering.`);
+ gl.stencilFunc(gl.NEVER, 1, 1);
+ gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+ draw(gl);
+ correctColor = hasStencil ? black : red;
+ wtu.checkCanvas(gl, correctColor)
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ wtu.checkCanvas(gl, black);
+ gl.stencilFunc(gl.ALWAYS, 1, 1);
+
+ debug(`Testing that depth ${ hasDepth ? 'affects': 'does not affect'} the rendering.`);
+ gl.depthFunc(gl.NEVER);
+ draw(gl);
+ correctColor = hasDepth ? black : red;
+ wtu.checkCanvas(gl, correctColor);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ wtu.checkCanvas(gl, black);
+ gl.depthFunc(gl.ALWAYS);
+
+ debug(`Testing that rendering is ${hasAntialias ? 'antialiased' : 'aliased'}.`);
+ draw(gl, 3);
+ let N = 2;
+ let buf = new Uint8Array(N * N * 4);
+ gl.readPixels(0, 0, N, N, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ redChannels[0] = buf[4 * (N + 1)]; // (1, 1)
+ redChannels[1] = buf[4 * N * (N - 1)]; // left top
+ redChannels[2] = buf[4 * (N - 1)]; // right bottom
+ shouldBe("redChannels[1]", "255");
+ shouldBe("redChannels[2]", "0");
+ if (hasAntialias) {
+ shouldNotBe("redChannels[0]", "255");
+ shouldNotBe("redChannels[0]", "0");
+ } else {
+ shouldBeTrue("redChannels[0] == 255 || redChannels[0] == 0");
+ }
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ wtu.checkCanvas(gl, black);
+
+ debug("Testing that rendering works.");
+ draw(gl);
+ wtu.checkCanvas(gl, red);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ wtu.checkCanvas(gl, black);
+}
+
+function testDefault()
+{
+ debug("Testing default attributes: { stencil:false }");
+ shouldBeNonNull("gl = getWebGL(1, 1, null, [ 0, 0, 0, 0 ], 1, 0)");
+ shouldBeFalse("gl.getContextAttributes().stencil");
+ shouldBe("gl.getParameter(gl.STENCIL_BITS)", "0");
+}
+
+function testAttributesAffectContext(alpha, stencil, depth, antialias)
+{
+ shouldBeNonNull(`gl = getWebGL(2, 2, { depth: ${depth}, stencil: ${stencil}, antialias: ${antialias}, alpha: ${alpha} }, [ 0, 0, 0, 0 ], 1, 0)`);
+ shouldBeNonNull("contextAttribs = gl.getContextAttributes()");
+
+ shouldBeGreaterThanOrEqual("gl.getParameter(gl.RED_BITS)", "8");
+ shouldBeGreaterThanOrEqual("gl.getParameter(gl.GREEN_BITS)", "8");
+ shouldBeGreaterThanOrEqual("gl.getParameter(gl.BLUE_BITS)", "8");
+
+ shouldBe("contextAttribs.alpha", "" + alpha);
+ if (contextVersion < 2) {
+ if (!stencil)
+ shouldBeFalse("contextAttribs.stencil");
+ else
+ stencil = contextAttribs.stencil;
+ if (!depth)
+ shouldBeFalse("contextAttribs.depth");
+ else
+ depth = contextAttribs.depth;
+ if (!antialias)
+ shouldBeFalse("contextAttribs.antialias");
+ else
+ antialias = contextAttribs.antialias;
+ } else {
+ shouldBe("contextAttribs.stencil", "" + stencil);
+ shouldBe("contextAttribs.depth", "" + depth);
+ shouldBe("contextAttribs.antialias", "" + antialias);
+ }
+
+ if (alpha)
+ shouldBeGreaterThanOrEqual("gl.getParameter(gl.ALPHA_BITS)", "8");
+ else
+ shouldBe("gl.getParameter(gl.ALPHA_BITS)", "0");
+ if (stencil)
+ shouldBeGreaterThanOrEqual("gl.getParameter(gl.STENCIL_BITS)", "8");
+ else
+ shouldBe("gl.getParameter(gl.STENCIL_BITS)", "0");
+ if (depth)
+ shouldBeGreaterThanOrEqual("gl.getParameter(gl.DEPTH_BITS)", "16");
+ else
+ shouldBe("gl.getParameter(gl.DEPTH_BITS)", "0");
+
+ var correctColor = alpha ? [0, 0, 0, 0] : [0, 0, 0, 255];
+ wtu.checkCanvas(gl, correctColor);
+
+ debug("Testing default framebuffer.");
+ checkDraw(alpha, stencil, depth, antialias);
+
+ if (fbHasColor) {
+ debug("Testing bound framebuffer object.");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ checkDraw(true, fbHasStencil, fbHasDepth, false);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ }
+}
+
+function runTest()
+{
+ testDefault();
+ let cases = [false, true];
+ for (let alpha of cases) {
+ for (let stencil of cases) {
+ for (let depth of cases) {
+ for (let antialias of cases) {
+ testAttributesAffectContext(alpha, stencil, depth, antialias);
+ }
+ }
+ }
+ }
+ finishTest();
+}
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html
new file mode 100644
index 0000000000..72324b5f17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation-and-destruction.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test that contexts are freed and garbage collected reasonably</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+<script src="../../js/tests/iterable-test.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+
+var test = IterableTest.createContextCreationAndDestructionTest();
+var iterations = parseInt(wtu.getUrlOptions().iterations, 10) || 50;
+IterableTest.run(test, iterations);
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html
new file mode 100644
index 0000000000..ceeb5b092b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-creation.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test that you can create large numbers of WebGL contexts.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+<script src="../../js/tests/iterable-test.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+
+var test = IterableTest.createContextCreationTest();
+var iterations = parseInt(wtu.getUrlOptions().iterations, 10) || 50;
+IterableTest.run(test, iterations);
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html
new file mode 100644
index 0000000000..1898e73520
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-eviction-with-garbage-collection.html
@@ -0,0 +1,57 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test that context eviction and garbage collection do not interfere with each other</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+// See http://crbug.com/374086 for original failing case.
+description("Test that context eviction and garbage collection do not interfere with each other.");
+var wtu = WebGLTestUtils;
+
+var total_iteration = 50;
+var array_count = 10;
+
+var bank = [];
+for (var i = 0; i < array_count; i++)
+ bank[i] = [];
+
+for (var iter = 0; iter < total_iteration; ++iter) {
+ for (var i = 0; i < array_count; i++)
+ bank[i][iter * i] = iter;
+
+ var canvas = document.createElement('canvas');
+ var gl = wtu.create3DContext(canvas);
+ canvas.width = 50;
+ canvas.height = 50;
+ var program = wtu.setupTexturedQuad(gl);
+ shouldBeTrue("program != null");
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var pixel = new Uint8Array([0, 255, 0, 255]);
+ gl.texImage2D(
+ gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from iteration " + iter);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html
new file mode 100644
index 0000000000..ed67fc0093
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-hidden-alpha.html
@@ -0,0 +1,166 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id='vs' type='x-shader/x-vertex'>
+ attribute vec2 aPosCoord;
+
+ void main(void) {
+ gl_Position = vec4(aPosCoord, 0.0, 1.0);
+ }
+</script>
+
+<script id='fs' type='x-shader/x-fragment'>
+ precision mediump float;
+
+ void main(void) {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+</script>
+<script>
+"use strict";
+
+var posCoords_arr = new Float32Array(2 * 4);
+var posCoords_buff = null;
+function DrawQuad(gl, prog, x0, y0, x1, y1) {
+ gl.useProgram(prog);
+
+ if (!posCoords_buff) {
+ posCoords_buff = gl.createBuffer();
+ }
+ gl.bindBuffer(gl.ARRAY_BUFFER, posCoords_buff);
+ posCoords_arr[0] = x0;
+ posCoords_arr[1] = y0;
+
+ posCoords_arr[2] = x1;
+ posCoords_arr[3] = y0;
+
+ posCoords_arr[4] = x0;
+ posCoords_arr[5] = y1;
+
+ posCoords_arr[6] = x1;
+ posCoords_arr[7] = y1;
+ gl.bufferData(gl.ARRAY_BUFFER, posCoords_arr, gl.STREAM_DRAW);
+
+ gl.enableVertexAttribArray(prog.aPosCoord);
+ gl.vertexAttribPointer(prog.aPosCoord, 2, gl.FLOAT, false, 0, 0);
+
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+}
+
+function DrawSquare(gl, prog, size) {
+ DrawQuad(gl, prog, -size, -size, size, size);
+}
+
+function Reset(gl) {
+ gl.canvas.width += 1;
+ gl.canvas.width -= 1;
+}
+
+var iColor;
+var pixel;
+var dataURL_pre;
+var dataURL_post;
+
+function Test(gl, prog, shouldFinish) {
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.ZERO, gl.DST_ALPHA);
+
+ iColor = 64;
+ var fColor = iColor / 255.0;
+
+ //////////////////
+
+ debug('clear(R,G,B,0)');
+
+ Reset(gl);
+
+ gl.clearColor(fColor, fColor, fColor, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ dataURL_pre = gl.canvas.toDataURL();
+ //console.log('Before blending: ' + dataURL_pre);
+
+ DrawSquare(gl, prog, 0.7);
+
+ WebGLTestUtils.checkCanvasRect(gl, gl.drawingBufferWidth/2,
+ gl.drawingBufferHeight/2, 1, 1,
+ [iColor, iColor, iColor, 255],
+ 'Should blend as if alpha is 1.0.');
+
+ dataURL_post = gl.canvas.toDataURL();
+ //console.log('After blending: ' + dataURL_post);
+ shouldBe("dataURL_post", "dataURL_pre");
+
+ //////////////////
+
+ debug('mask(R,G,B,0), clear(R,G,B,1)');
+
+ Reset(gl);
+
+ gl.colorMask(true, true, true, false);
+ gl.clearColor(fColor, fColor, fColor, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.colorMask(true, true, true, true);
+
+ dataURL_pre = gl.canvas.toDataURL();
+ //console.log('Before blending: ' + dataURL_pre);
+
+ DrawSquare(gl, prog, 0.7);
+
+ WebGLTestUtils.checkCanvasRect(gl, gl.drawingBufferWidth/2,
+ gl.drawingBufferHeight/2, 1, 1,
+ [iColor, iColor, iColor, 255],
+ 'Should blend as if alpha is 1.0.');
+
+ dataURL_post = gl.canvas.toDataURL();
+ //console.log('After blending: ' + dataURL_post);
+ shouldBe("dataURL_post", "dataURL_pre");
+
+ ////////////////
+
+ WebGLTestUtils.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+
+ if (shouldFinish)
+ finishTest();
+}
+
+var gl;
+function init() {
+ var canvas = document.getElementById('canvas');
+ var attribs = {
+ alpha: false,
+ antialias: false,
+ premultipliedAlpha: false,
+ };
+ gl = canvas.getContext('experimental-webgl', attribs);
+ shouldBeNonNull(gl);
+ shouldBe("gl.getParameter(gl.ALPHA_BITS)", "0");
+
+ var prog = WebGLTestUtils.setupProgram(gl, ['vs', 'fs']);
+ shouldBeNonNull(prog);
+ prog.aPosCoord = gl.getAttribLocation(prog, 'aPosCoord');
+
+ Test(gl, prog, false);
+
+ requestAnimationFrame(function(){ Test(gl, prog, true); });
+}
+
+</script>
+</head>
+<body onload="init()">
+<canvas id='canvas'></canvas>
+<br/>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html
new file mode 100644
index 0000000000..6942e3d1ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost-restored.html
@@ -0,0 +1,287 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var canvas;
+var gl;
+var shouldGenerateGLError;
+var WEBGL_lose_context;
+var new_WEBGL_lose_context;
+var bufferObjects;
+var program;
+var texture;
+var texColor = [255, 10, 20, 255];
+var allowRestore;
+var contextLostEventFired;
+var contextRestoredEventFired;
+var OES_vertex_array_object;
+var old_OES_vertex_array_object;
+var vertexArrayObject;
+var OES_texture_float;
+var newExtension;
+
+function init()
+{
+ enableJSTestPreVerboseLogging();
+ description("Tests behavior under a restored context.");
+
+ shouldGenerateGLError = wtu.shouldGenerateGLError;
+ testLosingContext();
+}
+
+function setupTest()
+{
+ canvas = document.createElement("canvas");
+ canvas.width = 1;
+ canvas.height = 1;
+ gl = wtu.create3DContext(canvas);
+ WEBGL_lose_context = getExtensionAndAddProperty(gl, "WEBGL_lose_context");
+ if (!WEBGL_lose_context) {
+ debug("Could not find WEBGL_lose_context extension");
+ return false;
+ }
+
+ // Try to get a few extensions
+ OES_vertex_array_object = getExtensionAndAddProperty(gl, "OES_vertex_array_object");
+ OES_texture_float = getExtensionAndAddProperty(gl, "OES_texture_float");
+
+ return true;
+}
+
+function getExtensionAndAddProperty(gl, name) {
+ var ext = wtu.getExtensionWithKnownPrefixes(gl, name);
+ if (ext) {
+ ext.webglTestProperty = true;
+ }
+ return ext;
+}
+
+function reGetExtensionAndTestForProperty(gl, name, expectProperty) {
+ newExtension = wtu.getExtensionWithKnownPrefixes(gl, name);
+ // NOTE: while getting a extension after context lost/restored is allowed to fail
+ // for the purpose the conformance tests it is not.
+ //
+ // Hypothetically the user can switch GPUs live. For example on Windows, install 2 GPUs,
+ // then in the control panen enable 1, disable the others and visa versa. Since the GPUs
+ // have different capabilities one or the other may not support a particlar extension.
+ //
+ // But, for the purpose of the conformance tests the context is expected to restore
+ // on the same GPU and therefore the extensions that succeeded previously should
+ // succeed on restore.
+ shouldBeTrue("newExtension != null");
+ if (expectProperty) {
+ shouldBeTrue("newExtension.webglTestProperty === true");
+ } else {
+ shouldBeTrue("newExtension.webglTestProperty === undefined");
+ }
+ return newExtension;
+}
+
+function testLosingContext()
+{
+ if (!setupTest()) {
+ finishTest();
+ return;
+ }
+
+ debug("Test losing a context and inability to restore it.");
+
+ canvas.addEventListener("webglcontextlost", function(e) {
+ testLostContext(e);
+ // restore the context after this event has exited.
+ setTimeout(function() {
+ // we didn't call prevent default so we should not be able to restore the context
+ shouldGenerateGLError(gl, gl.INVALID_OPERATION, "WEBGL_lose_context.restoreContext()");
+ testLosingAndRestoringContext();
+ }, 0);
+ });
+ canvas.addEventListener("webglcontextrestored", testShouldNotRestoreContext);
+ allowRestore = false;
+ contextLostEventFired = false;
+ contextRestoredEventFired = false;
+
+ testOriginalContext();
+ WEBGL_lose_context.loseContext();
+ // The context should be lost immediately.
+ shouldBeTrue("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.CONTEXT_LOST_WEBGL");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ // gl methods should be no-ops
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendFunc(gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP)");
+ // but the event should not have been fired.
+ shouldBeFalse("contextLostEventFired");
+}
+
+function testLosingAndRestoringContext()
+{
+ if (!setupTest())
+ finishTest();
+
+ debug("");
+ debug("Test losing and restoring a context.");
+
+ canvas.addEventListener("webglcontextlost", function(e) {
+ testLostContext(e);
+ // restore the context after this event has exited.
+ setTimeout(function() {
+ shouldGenerateGLError(gl, gl.NO_ERROR, "WEBGL_lose_context.restoreContext()");
+ // Calling restoreContext() twice should not cause error or crash
+ shouldGenerateGLError(gl, gl.NO_ERROR, "WEBGL_lose_context.restoreContext()");
+ // The context should still be lost. It will not get restored until the
+ // webglrestorecontext event is fired.
+ shouldBeTrue("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ // gl methods should still be no-ops
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendFunc(gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP)");
+ }, 0);
+ });
+ canvas.addEventListener("webglcontextrestored", function() {
+ testRestoredContext();
+ finishTest();
+ });
+ allowRestore = true;
+ contextLostEventFired = false;
+ contextRestoredEventFired = false;
+
+ testOriginalContext();
+ WEBGL_lose_context.loseContext();
+ // The context should be lost immediately.
+ shouldBeTrue("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.CONTEXT_LOST_WEBGL");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ // gl methods should be no-ops
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendFunc(gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP)");
+ // but the event should not have been fired.
+ shouldBeFalse("contextLostEventFired");
+}
+
+function testRendering()
+{
+ gl.clearColor(0, 0, 0, 255);
+ gl.colorMask(1, 1, 1, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ program = wtu.setupSimpleTextureProgram(gl);
+ bufferObjects = wtu.setupUnitQuad(gl);
+ texture = wtu.createColoredTexture(gl, canvas.width, canvas.height, texColor);
+
+ gl.uniform1i(gl.getUniformLocation(program, "tex"), 0);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+
+ var compare = texColor.slice(0, 3);
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, compare, "shouldBe " + compare);
+
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+}
+
+function testOriginalContext()
+{
+ debug("Test valid context");
+ shouldBeFalse("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ testRendering();
+ debug("");
+}
+
+function testLostContext(e)
+{
+ debug("Test lost context");
+ shouldBeFalse("contextLostEventFired");
+ contextLostEventFired = true;
+ shouldBeTrue("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ debug("");
+ if (allowRestore)
+ e.preventDefault();
+}
+
+function testShouldNotRestoreContext(e)
+{
+ testFailed("Should not restore the context unless preventDefault is called on the context lost event");
+ debug("");
+}
+
+function testResources(expected)
+{
+ var tests = [
+ "gl.bindTexture(gl.TEXTURE_2D, texture)",
+ "gl.useProgram(program)",
+ "gl.bindBuffer(gl.ARRAY_BUFFER, bufferObjects[0])",
+ ];
+
+ for (var i = 0; i < tests.length; ++i)
+ shouldGenerateGLError(gl, expected, tests[i]);
+}
+
+function testOESTextureFloat() {
+ if (OES_texture_float) {
+ // Extension must still be lost.
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.FLOAT, null)");
+ // Try re-enabling extension
+ OES_texture_float = reGetExtensionAndTestForProperty(gl, "OES_texture_float", false);
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.FLOAT, null)");
+ }
+}
+
+function testOESVertexArrayObject() {
+ if (OES_vertex_array_object) {
+ // Extension must still be lost.
+ shouldBeNull("OES_vertex_array_object.createVertexArrayOES()");
+ // Try re-enabling extension
+
+ old_OES_vertex_array_object = OES_vertex_array_object;
+ OES_vertex_array_object = reGetExtensionAndTestForProperty(gl, "OES_vertex_array_object", false);
+ shouldBeTrue("OES_vertex_array_object.createVertexArrayOES() != null");
+ shouldBeTrue("old_OES_vertex_array_object.createVertexArrayOES() == null");
+ }
+}
+
+function testExtensions() {
+ testOESTextureFloat();
+ testOESVertexArrayObject();
+ // Only the WEBGL_lose_context extension should be the same object after context lost.
+ new_WEBGL_lose_context = reGetExtensionAndTestForProperty(gl, "WEBGL_lose_context", true);
+}
+
+function testRestoredContext()
+{
+ debug("Test restored context");
+ shouldBeFalse("contextRestoredEventFired");
+ contextRestoredEventFired = true;
+ shouldBeFalse("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+
+ // Validate that using old resources fails.
+ testResources(gl.INVALID_OPERATION);
+
+ testRendering();
+
+ // Validate new resources created in testRendering().
+ testResources(gl.NO_ERROR);
+
+ testExtensions();
+
+ debug("");
+}
+
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html
new file mode 100644
index 0000000000..31d07a94a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-lost.html
@@ -0,0 +1,379 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script>
+"use strict";
+var wtu;
+var canvas;
+var gl;
+var shouldGenerateGLError;
+var extensionName;
+var extension;
+
+var buffer;
+var framebuffer;
+var program;
+var renderbuffer;
+var shader;
+var texture;
+var uniformLocation;
+var arrayBuffer;
+var arrayBufferView
+var image;
+var video;
+var canvas2d;
+var ctx2d;
+var imageData;
+var float32array;
+var int32array;
+var OES_vertex_array_object;
+var vertexArrayObject;
+
+var secondCanvas;
+var secondGL;
+
+function init()
+{
+ wtu = WebGLTestUtils;
+ canvas = document.getElementById("canvas");
+ gl = wtu.create3DContext(canvas);
+ secondCanvas = document.getElementById("canvas2");
+ secondGL = wtu.create3DContext(secondCanvas);
+ shouldGenerateGLError = wtu.shouldGenerateGLError;
+
+ description("Tests behavior under a lost context");
+
+ // call testValidContext() before checking for the extension, because this is where we check
+ // for the isContextLost() method, which we want to do regardless of the extension's presence.
+ testValidContext();
+
+ extensionName = wtu.getSupportedExtensionWithKnownPrefixes(gl, "WEBGL_lose_context");
+ if (!extensionName) {
+ debug("Could not find WEBGL_lose_context extension");
+ finishTest();
+ return false;
+ }
+ extension = gl.getExtension(extensionName);
+
+ // need an extension that exposes new API methods.
+ OES_vertex_array_object = wtu.getExtensionWithKnownPrefixes(gl, "OES_vertex_array_object");
+
+ canvas.addEventListener("webglcontextlost", testLostContext, false);
+
+ // We need to initialize |uniformLocation| before losing context.
+ // Otherwise gl.getUniform() when context is lost will throw.
+ uniformLocation = gl.getUniformLocation(program, "tex");
+ loseContext();
+}
+
+function loseContext()
+{
+ debug("");
+ debug("Lose context");
+
+ // Note: this will cause the context to be lost, but the
+ // webglcontextlost event listener to be queued.
+ extension.loseContext();
+ debug("");
+}
+
+function testValidContext()
+{
+ debug("Test valid context");
+
+ shouldBeFalse("gl.isContextLost()");
+
+ arrayBuffer = new ArrayBuffer(4);
+ arrayBufferView = new Int8Array(arrayBuffer);
+
+ // Generate resources for testing.
+ buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ framebuffer = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ program = wtu.setupSimpleTextureProgram(gl);
+ renderbuffer = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ shader = gl.createShader(gl.VERTEX_SHADER);
+ texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+
+ // Test is queries that will later be false
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.enable(gl.BLEND)");
+ shouldBeTrue("gl.isBuffer(buffer)");
+ shouldBeTrue("gl.isEnabled(gl.BLEND)");
+ shouldBeTrue("gl.isFramebuffer(framebuffer)");
+ shouldBeTrue("gl.isProgram(program)");
+ shouldBeTrue("gl.isRenderbuffer(renderbuffer)");
+ shouldBeTrue("gl.isShader(shader)");
+ shouldBeTrue("gl.isTexture(texture)");
+
+ if (OES_vertex_array_object) {
+ vertexArrayObject = OES_vertex_array_object.createVertexArrayOES();
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ shouldBeTrue("OES_vertex_array_object.isVertexArrayOES(vertexArrayObject)");
+ }
+}
+
+function testGLNOErrorFunctions(tests) {
+ tests.forEach(function(test) {
+ shouldGenerateGLError(gl, gl.NO_ERROR, test);
+ });
+}
+
+function testFunctionsThatReturnNULL(tests) {
+ tests.forEach(function(test) {
+ shouldBeNull(test);
+ });
+}
+
+function testUploadingLostContextToTexture() {
+ debug("Testing uploading a canvas with a lost WebGL context to a texture");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors at beginning");
+ let texture = secondGL.createTexture();
+ secondGL.bindTexture(secondGL.TEXTURE_2D, texture);
+ secondGL.texImage2D(secondGL.TEXTURE_2D, 0, secondGL.RGBA, secondGL.RGBA, secondGL.UNSIGNED_BYTE, canvas);
+ wtu.glErrorShouldBe(secondGL, [secondGL.INVALID_OPERATION, secondGL.NO_ERROR], "Should not crash when uploading canvas with lost WebGL context to a texture");
+}
+
+function testLostContext()
+{
+ debug("Test lost context");
+
+ // Functions with special return values.
+ shouldBeTrue("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.CONTEXT_LOST_WEBGL");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_UNSUPPORTED");
+ shouldBe("gl.getAttribLocation(program, 'u_modelViewProjMatrix')", "-1");
+ shouldBe("gl.getVertexAttribOffset(0, gl.VERTEX_ATTRIB_ARRAY_POINTER)", "0");
+
+ // Attempt resize of lost context should succeed, still lost.
+ gl.canvas.width = gl.canvas.width; // Try to hit any same-size resize path.
+ shouldBeTrue("gl.isContextLost()");
+
+ const newSize = gl.canvas.width + 1;
+ gl.canvas.width = newSize;
+ shouldBe("gl.canvas.width", newSize);
+ shouldBeTrue("gl.isContextLost()");
+
+ // Test the extension itself.
+ shouldGenerateGLError(gl, gl.INVALID_OPERATION, "extension.loseContext()");
+
+ image = document.createElement("img");
+ video = document.createElement("video");
+ canvas2d = document.createElement("canvas");
+ ctx2d = canvas2d.getContext("2d");
+ imageData = ctx2d.createImageData(1, 1);
+ float32array = new Float32Array(1);
+ int32array = new Int32Array(1);
+
+ // Functions returning void should return immediately.
+ // This is untestable, but we can at least be sure they cause no errors
+ // and the codepaths are exercised.
+ var voidTests = [
+ "gl.activeTexture(gl.TEXTURE0)",
+ "gl.attachShader(program, shader)",
+ "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)",
+ "gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)",
+ "gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer)",
+ "gl.bindTexture(gl.TEXTURE_2D, texture)",
+ "gl.blendColor(1.0, 1.0, 1.0, 1.0)",
+ "gl.blendEquation(gl.FUNC_ADD)",
+ "gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD)",
+ "gl.blendFunc(gl.ONE, gl.ONE)",
+ "gl.blendFuncSeparate(gl.ONE, gl.ONE, gl.ONE, gl.ONE)",
+ "gl.bufferData(gl.ARRAY_BUFFER, 0, gl.STATIC_DRAW)",
+ "gl.bufferData(gl.ARRAY_BUFFER, arrayBufferView, gl.STATIC_DRAW)",
+ "gl.bufferData(gl.ARRAY_BUFFER, arrayBuffer, gl.STATIC_DRAW)",
+ "gl.bufferSubData(gl.ARRAY_BUFFRE, 0, arrayBufferView)",
+ "gl.bufferSubData(gl.ARRAY_BUFFRE, 0, arrayBuffer)",
+ "gl.clear(gl.COLOR_BUFFER_BIT)",
+ "gl.clearColor(1, 1, 1, 1)",
+ "gl.clearDepth(1)",
+ "gl.clearStencil(0)",
+ "gl.colorMask(1, 1, 1, 1)",
+ "gl.compileShader(shader)",
+ "gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 0, 0, 0)",
+ "gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 0, 0)",
+ "gl.cullFace(gl.FRONT)",
+ "gl.deleteBuffer(buffer)",
+ "gl.deleteFramebuffer(framebuffer)",
+ "gl.deleteProgram(program)",
+ "gl.deleteRenderbuffer(renderbuffer)",
+ "gl.deleteShader(shader)",
+ "gl.deleteTexture(texture)",
+ "gl.depthFunc(gl.NEVER)",
+ "gl.depthMask(0)",
+ "gl.depthRange(0, 1)",
+ "gl.detachShader(program, shader)",
+ "gl.disable(gl.BLEND)",
+ "gl.disableVertexAttribArray(0)",
+ "gl.drawArrays(gl.POINTS, 0, 0)",
+ "gl.drawElements(gl.POINTS, 0, gl.UNSIGNED_SHORT, 0)",
+ "gl.enable(gl.BLEND)",
+ "gl.enableVertexAttribArray(0)",
+ "gl.finish()",
+ "gl.flush()",
+ "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, renderbuffer)",
+ "gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0)",
+ "gl.frontFace(gl.CW)",
+ "gl.generateMipmap(gl.TEXTURE_2D)",
+ "gl.hint(gl.GENERATE_MIPMAP_HINT, gl.FASTEST)",
+ "gl.lineWidth(0)",
+ "gl.linkProgram(program)",
+ "gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 0)",
+ "gl.polygonOffset(0, 0)",
+ "gl.readPixels(0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, arrayBufferView)",
+ "gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 0, 0)",
+ "gl.sampleCoverage(0, 0)",
+ "gl.scissor(0, 0, 0, 0)",
+ "gl.shaderSource(shader, '')",
+ "gl.stencilFunc(gl.NEVER, 0, 0)",
+ "gl.stencilFuncSeparate(gl.FRONT, gl.NEVER, 0, 0)",
+ "gl.stencilMask(0)",
+ "gl.stencilMaskSeparate(gl.FRONT, 0)",
+ "gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP)",
+ "gl.stencilOpSeparate(gl.FRONT, gl.KEEP, gl.KEEP, gl.KEEP)",
+ "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, arrayBufferView)",
+ "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, imageData)",
+ "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image)",
+ "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d)",
+ "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video)",
+ "gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)",
+ "gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)",
+ "gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, arrayBufferView)",
+ "gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, imageData)",
+ "gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, image)",
+ "gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d)",
+ "gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, video)",
+ "gl.uniform1f(uniformLocation, 0)",
+ "gl.uniform1fv(uniformLocation, float32array)",
+ "gl.uniform1fv(uniformLocation, [0])",
+ "gl.uniform1i(uniformLocation, 0)",
+ "gl.uniform1iv(uniformLocation, int32array)",
+ "gl.uniform1iv(uniformLocation, [0])",
+ "gl.uniform2f(uniformLocation, 0, 0)",
+ "gl.uniform2fv(uniformLocation, float32array)",
+ "gl.uniform2fv(uniformLocation, [0, 0])",
+ "gl.uniform2i(uniformLocation, 0, 0)",
+ "gl.uniform2iv(uniformLocation, int32array)",
+ "gl.uniform2iv(uniformLocation, [0, 0])",
+ "gl.uniform3f(uniformLocation, 0, 0, 0)",
+ "gl.uniform3fv(uniformLocation, float32array)",
+ "gl.uniform3fv(uniformLocation, [0, 0, 0])",
+ "gl.uniform3i(uniformLocation, 0, 0, 0)",
+ "gl.uniform3iv(uniformLocation, int32array)",
+ "gl.uniform3iv(uniformLocation, [0, 0, 0])",
+ "gl.uniform4f(uniformLocation, 0, 0, 0, 0)",
+ "gl.uniform4fv(uniformLocation, float32array)",
+ "gl.uniform4fv(uniformLocation, [0, 0, 0, 0])",
+ "gl.uniform4i(uniformLocation, 0, 0, 0, 0)",
+ "gl.uniform4iv(uniformLocation, int32array)",
+ "gl.uniform4iv(uniformLocation, [0, 0, 0, 0])",
+ "gl.uniformMatrix2fv(uniformLocation, false, float32array)",
+ "gl.uniformMatrix2fv(uniformLocation, false, [0, 0, 0, 0])",
+ "gl.uniformMatrix3fv(uniformLocation, false, float32array)",
+ "gl.uniformMatrix3fv(uniformLocation, false, [0, 0, 0, 0, 0, 0, 0, 0, 0])",
+ "gl.uniformMatrix4fv(uniformLocation, false, float32array)",
+ "gl.uniformMatrix4fv(uniformLocation, false, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])",
+ "gl.useProgram(program)",
+ "gl.validateProgram(program)",
+ "gl.vertexAttrib1f(0, 0)",
+ "gl.vertexAttrib1fv(0, float32array)",
+ "gl.vertexAttrib1fv(0, [0])",
+ "gl.vertexAttrib2f(0, 0, 0)",
+ "gl.vertexAttrib2fv(0, float32array)",
+ "gl.vertexAttrib2fv(0, [0, 0])",
+ "gl.vertexAttrib3f(0, 0, 0, 0)",
+ "gl.vertexAttrib3fv(0, float32array)",
+ "gl.vertexAttrib3fv(0, [0, 0, 0])",
+ "gl.vertexAttrib4f(0, 0, 0, 0, 0)",
+ "gl.vertexAttrib4fv(0, float32array)",
+ "gl.vertexAttrib4fv(0, [0, 0, 0, 0])",
+ "gl.vertexAttribPointer(0, 0, gl.FLOAT, false, 0, 0)",
+ "gl.viewport(0, 0, 0, 0)",
+ ];
+ testGLNOErrorFunctions(voidTests);
+
+ // Functions return nullable values should all return null.
+ var nullTests = [
+ "gl.createBuffer()",
+ "gl.createFramebuffer()",
+ "gl.createProgram()",
+ "gl.createRenderbuffer()",
+ "gl.createShader(gl.GL_VERTEX_SHADER)",
+ "gl.createTexture()",
+ "gl.getActiveAttrib(program, 0)",
+ "gl.getActiveUniform(program, 0)",
+ "gl.getAttachedShaders(program)",
+ "gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE)",
+ "gl.getContextAttributes()",
+ "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)",
+ "gl.getParameter(gl.CURRENT_PROGRAM)",
+ "gl.getProgramInfoLog(program)",
+ "gl.getProgramParameter(program, gl.LINK_STATUS)",
+ "gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)",
+ "gl.getShaderInfoLog(shader)",
+ "gl.getShaderParameter(shader, gl.SHADER_TYPE)",
+ "gl.getShaderSource(shader)",
+ "gl.getTexParameter(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S)",
+ "gl.getUniform(program, uniformLocation)",
+ "gl.getUniformLocation(program, 'vPosition')",
+ "gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)",
+ "gl.getSupportedExtensions()",
+ "gl.getExtension('" + extensionName + "')",
+ ];
+ testFunctionsThatReturnNULL(nullTests);
+
+ // "Is" queries should all return false.
+ shouldBeFalse("gl.isBuffer(buffer)");
+ shouldBeFalse("gl.isEnabled(gl.BLEND)");
+ shouldBeFalse("gl.isFramebuffer(framebuffer)");
+ shouldBeFalse("gl.isProgram(program)");
+ shouldBeFalse("gl.isRenderbuffer(renderbuffer)");
+ shouldBeFalse("gl.isShader(shader)");
+ shouldBeFalse("gl.isTexture(texture)");
+
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+
+ // test extensions
+ if (OES_vertex_array_object) {
+ testGLNOErrorFunctions(
+ [
+ "OES_vertex_array_object.bindVertexArrayOES(vertexArrayObject)",
+ "OES_vertex_array_object.isVertexArrayOES(vertexArrayObject)",
+ "OES_vertex_array_object.deleteVertexArrayOES(vertexArrayObject)",
+ ]);
+ testFunctionsThatReturnNULL(
+ [
+ "OES_vertex_array_object.createVertexArrayOES()",
+ ]);
+ }
+
+ testUploadingLostContextToTexture();
+
+ debug("");
+
+ finishTest();
+}
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas">
+<canvas id="canvas2">
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html
new file mode 100644
index 0000000000..81fc80ee5f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-no-alpha-fbo-with-alpha.html
@@ -0,0 +1,77 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+
+<script>
+"use strict";
+
+var wtu = WebGLTestUtils;
+
+// This declaration needs to be global for "shouldBe" to see it
+var gl;
+
+function init()
+{
+ description('Verify that a WebGL context with alpha:false still works correctly after handling textures with an alpha channel.');
+
+ runTest();
+}
+
+function getWebGL(contextAttribs)
+{
+ return wtu.create3DContext("c", contextAttribs);
+}
+
+function runTest()
+{
+ var buf = new Uint8Array(1 * 1 * 4);
+ shouldBeNonNull("gl = getWebGL({ alpha: false, antialias: false })");
+
+ // Clear to black. Alpha channel of clearColor() is ignored.
+ gl.clearColor(0.0, 0.0, 0.0, 0.7);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 255],
+ "Alpha channel of clearColor should be ignored");
+
+ wtu.waitForComposite(function() {
+ // Make a new framebuffer and attach a texture with an alpha channel.
+ 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, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+
+ // Clear texture. Note that alpha channel is not 1.0.
+ gl.clearColor(1.0, 0.0, 0.0, 0.5);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 0, 0, 128],
+ "Alpha channel of clearColor should be obeyed for FBO with alpha channel",
+ 1);
+
+ // Bind back buffer and check that its alpha channel is still 1.0.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 255],
+ "Alpha channel of back buffer should still be 255");
+ finishTest();
+ });
+}
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+<canvas width="20" height="20" style="border: 1px solid blue;" id="c"></canvas>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html
new file mode 100644
index 0000000000..fbd3a61741
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-upon-reload.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Context Release 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>
+</head>
+<body>
+<iframe id="host" style="width: 256px; height: 256px; border: 0;"></iframe>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test ensures that WebGL contexts are released properly upon page reload");
+
+var wtu = WebGLTestUtils;
+
+var host = document.getElementById("host");
+var testIterations = 25;
+var currentIteration = 0;
+
+function refreshFrame() {
+ if(currentIteration < testIterations) {
+ currentIteration++;
+ debug("");
+ debug("Test " + currentIteration + " of " + testIterations);
+ host.src = "resources/context-release-upon-reload-child.html";
+ } else {
+ finishTest();
+ }
+}
+
+function testContext() {
+ var gl = host.contentWindow.glContext;
+ assertMsg(gl != null, "context was created properly");
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+
+ if(gl.canvas.width != gl.drawingBufferWidth ||
+ gl.canvas.height != gl.drawingBufferHeight) {
+ testFailed("Buffer was the wrong size: " +
+ gl.drawingBufferWidth + "x" + gl.drawingBufferHeight);
+ } else {
+ testPassed("Buffer was the correct size: " +
+ gl.drawingBufferWidth + "x" + gl.drawingBufferHeight);
+ refreshFrame();
+ }
+
+ gl = null;
+}
+
+window.addEventListener("message", function(event) {
+ if(event.data == "Ready") {
+ testContext();
+ }
+});
+
+refreshFrame();
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html
new file mode 100644
index 0000000000..23037fd3c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-release-with-workers.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Context Release 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>
+</head>
+<body>
+<iframe id="host" style="width: 256px; height: 256px; border: 0;"></iframe>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test ensures that WebGL contexts are released properly when a worker is used");
+
+var wtu = WebGLTestUtils;
+
+var host = document.getElementById("host");
+var testIterations = 25;
+var currentIteration = 0;
+
+function refreshFrame() {
+ if(currentIteration < testIterations) {
+ currentIteration++;
+ debug("");
+ debug("Test " + currentIteration + " of " + testIterations);
+ host.src = "resources/context-release-child-with-worker.html";
+ } else {
+ finishTest();
+ }
+}
+
+function testContext() {
+ var gl = host.contentWindow.glContext;
+ assertMsg(gl != null, "context was created properly");
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+
+ if(gl.canvas.width != gl.drawingBufferWidth ||
+ gl.canvas.height != gl.drawingBufferHeight) {
+ testFailed("Buffer was the wrong size: " +
+ gl.drawingBufferWidth + "x" + gl.drawingBufferHeight);
+ } else {
+ testPassed("Buffer was the correct size: " +
+ gl.drawingBufferWidth + "x" + gl.drawingBufferHeight);
+ refreshFrame();
+ }
+
+ gl = null;
+}
+
+window.addEventListener("message", function(event) {
+ if(event.data == "Ready") {
+ testContext();
+ }
+});
+
+refreshFrame();
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html
new file mode 100644
index 0000000000..638d7a7099
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-size-change.html
@@ -0,0 +1,92 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+
+<script>
+"use strict";
+
+// These declarations need to be global for "shouldBe" to see them
+var gl;
+var pixel = [0, 0, 0, 1];
+var canvas;
+
+function init()
+{
+ description('Verify that changing the size of an antialiased WebGL context does not cause it to stop working.');
+
+ runTest();
+}
+
+function getWebGL(canvasWidth, canvasHeight, contextAttribs)
+{
+ canvas = document.createElement("canvas");
+ if (!canvas)
+ return null;
+ canvas.width = canvasWidth;
+ canvas.height = canvasHeight;
+
+ gl = WebGLTestUtils.create3DContext(canvas, contextAttribs);
+ if (!gl)
+ return null;
+
+ return gl;
+}
+
+function runTest()
+{
+ shouldBeNonNull("gl = getWebGL(1, 1, { alpha: false, antialias: true })");
+
+ // Clear to black.
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Check that the pixel's R channel is 0.
+ var buf = new Uint8Array(1 * 1 * 4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ pixel[0] = buf[0];
+ shouldBeTrue("pixel[0] == 0");
+
+ // Change the size of the canvas.
+ canvas.width = 3;
+ canvas.height = 3;
+
+ // Clear to black.
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Clear the top-left pixel to white.
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(0, 0, 1, 1);
+ gl.clearColor(1.0, 1.0, 1.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Check that the top-left pixel has R channel 255.
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ pixel[0] = buf[0];
+ shouldBeTrue("pixel[0] == 255");
+
+ // Check that the bottom-right pixel has R channel 0.
+ gl.readPixels(2, 2, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ pixel[0] = buf[0];
+ shouldBeTrue("pixel[0] == 0");
+
+ finishTest();
+}
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html
new file mode 100644
index 0000000000..1aa315219a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/context-type-test.html
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Canvas Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<canvas id="canvas2d" width="40" height="40"> </canvas>
+<script>
+"use strict";
+description("This test ensures WebGL implementations interact correctly with the canvas tag.");
+
+debug("");
+debug("Canvas.getContext");
+
+assertMsg(window.WebGLRenderingContext,
+ "WebGLRenderingContext should be a member of window");
+assertMsg('WebGLRenderingContext' in window,
+ "WebGLRenderingContext should be 'in' window");
+assertMsg(Object.getPrototypeOf(WebGLRenderingContext.prototype) === Object.prototype,
+ "WebGLRenderingContext should only have Object in it's prototype chain");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("Checking context type");
+ assertMsg(gl instanceof WebGLRenderingContext,
+ "context type should be WebGLRenderingContext");
+}
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/deleted-object-behavior.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/deleted-object-behavior.html
new file mode 100644
index 0000000000..525f399678
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/deleted-object-behavior.html
@@ -0,0 +1,237 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Deleted Object Behavior</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="canvases">
+<canvas id="canvas1">
+</div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Verifies behavior of deleted objects");
+
+const wtu = WebGLTestUtils;
+const canvas1 = document.getElementById("canvas1");
+const sz = 64;
+canvas1.width = sz;
+canvas1.height = sz;
+const gl = wtu.create3DContext("canvas1");
+let tex, rb; // for shouldBe
+
+function testBoundFBOTexture() {
+ debug("Verifies that a texture attached to a bound framebuffer and then deleted is automatically detached");
+
+ let fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, sz, sz, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors during framebuffer setup");
+ // The WebGL 1.0 spec guarantees that this combination of attachments results
+ // in a complete framebuffer.
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE",
+ "Framebuffer should be complete after setup");
+ debug("Texture should still be bound to the context");
+ shouldBe("gl.getParameter(gl.TEXTURE_BINDING_2D)", "tex");
+ // Delete the texture.
+ gl.deleteTexture(tex);
+ debug("Texture should have been unbound from the context");
+ shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
+ debug("Framebuffer should report that the texture was detached");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+ debug("Framebuffer should be incomplete after texture was deleted");
+ shouldNotBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ debug("Texture should not report that it's still a texture after deletion");
+ shouldBe("gl.isTexture(tex)", "false");
+ // Framebuffer should not function.
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "Framebuffer should not work after deleting its only attachment");
+ // Default framebuffer shouldn't have been touched.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.checkCanvasRect(gl, 0, 0, sz, sz, [0, 0, 0, 0], "default framebuffer should be transparent black");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors after verifying default framebuffer's contents");
+ // Attempt to bind deleted texture should fail.
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "from binding deleted texture");
+ debug("");
+ gl.deleteFramebuffer(fb);
+}
+
+function testUnboundFBOTexture() {
+ debug("Verifies that a texture attached to an unbound framebuffer and then deleted remains usable until detached");
+
+ let fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, sz, sz, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors during framebuffer setup");
+ // The WebGL 1.0 spec guarantees that this combination of attachments results
+ // in a complete framebuffer.
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE",
+ "Framebuffer should be complete after setup");
+ // Unbind the framebuffer from the context so that deleting the texture
+ // doesn't automatically unbind it from the framebuffer.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ debug("Texture should still be bound to the context");
+ shouldBe("gl.getParameter(gl.TEXTURE_BINDING_2D)", "tex");
+ // Delete the texture.
+ gl.deleteTexture(tex);
+ debug("Texture should have been unbound from the context");
+ shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
+ // Framebuffer should still be complete.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ debug("Framebuffer should still be complete after texture was deleted");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ debug("Framebuffer should report that the texture is still attached");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "tex");
+ debug("Texture should not report that it's still a texture after deletion");
+ shouldBe("gl.isTexture(tex)", "false");
+ // Framebuffer should still function.
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvasRect(gl, 0, 0, sz, sz, [0, 255, 0, 255], "framebuffer should be green");
+ // Deleting texture a second time should not unbind it from the framebuffer.
+ gl.deleteTexture(tex);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "deleting an object twice is not an error");
+ debug("Framebuffer should still report that the texture is attached");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "tex");
+ // Default framebuffer shouldn't have been touched.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.checkCanvasRect(gl, 0, 0, sz, sz, [0, 0, 0, 0], "default framebuffer should be transparent black");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors after verifying framebuffers' contents");
+ // Attempt to bind deleted texture should fail.
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "from binding deleted texture");
+ debug("");
+ gl.deleteFramebuffer(fb);
+}
+
+function testBoundFBORenderbuffer() {
+ debug("Verifies that a renderbuffer attached to a bound framebuffer and then deleted is automatically detached");
+
+ let fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ rb = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, sz, sz)
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors during framebuffer setup");
+ // The WebGL 1.0 spec doesn't guarantee that this framebuffer configuration
+ // will be complete.
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Framebuffer with GL_RGBA4 renderbuffer was incomplete; skipping test");
+ return;
+ }
+ debug("Renderbuffer should still be bound to the context");
+ shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rb");
+ // Delete the renderbuffer.
+ gl.deleteRenderbuffer(rb);
+ debug("Renderbuffer should have been unbound from the context");
+ shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
+ debug("Framebuffer should report that the texture was detached");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+ debug("Framebuffer should be incomplete after renderbuffer was deleted");
+ shouldNotBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ debug("Renderbuffer should not report that it's still a renderbuffer after deletion");
+ shouldBe("gl.isRenderbuffer(rb)", "false");
+ // Framebuffer should not function.
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "Framebuffer should not work after deleting its only attachment");
+ // Default framebuffer shouldn't have been touched.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.checkCanvasRect(gl, 0, 0, sz, sz, [0, 0, 0, 0], "default framebuffer should be transparent black");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors after verifying framebuffers' contents");
+ // Attempt to bind deleted renderbuffer should fail.
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "from binding deleted renderbuffer");
+ debug("");
+ gl.deleteFramebuffer(fb);
+}
+
+function testUnboundFBORenderbuffer() {
+ debug("Verifies that a renderbuffer attached to an unbound framebuffer and then deleted remains usable until detached");
+
+ let fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ rb = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, sz, sz)
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors during framebuffer setup");
+ // The WebGL 1.0 spec doesn't guarantee that this framebuffer configuration
+ // will be complete.
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Framebuffer with GL_RGBA4 renderbuffer was incomplete; skipping test");
+ return;
+ }
+ // Unbind the framebuffer from the context so that deleting the renderbuffer
+ // doesn't automatically unbind it from the framebuffer.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ debug("Renderbuffer should still be bound to the context");
+ shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rb");
+ // Delete the renderbuffer.
+ gl.deleteRenderbuffer(rb);
+ debug("Renderbuffer should have been unbound from the context");
+ shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
+ // Framebuffer should still be complete.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ debug("Framebuffer should still be complete after renderbuffer was deleted");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ debug("Framebuffer should report that the renderbuffer is still attached");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rb");
+ debug("Renderbuffer should not report that it's still a renderbuffer after deletion");
+ shouldBe("gl.isRenderbuffer(rb)", "false");
+ // Framebuffer should still function.
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ // Use a high tolerance to accommodate low bit depth precision.
+ wtu.checkCanvasRect(gl, 0, 0, sz, sz, [0, 255, 0, 255], "framebuffer should be green", 20);
+ // Deleting renderbuffer a second time should not unbind it from the framebuffer.
+ gl.deleteRenderbuffer(rb);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "deleting an object twice is not an error");
+ debug("Framebuffer should still report that the renderbuffer is attached");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rb");
+ // Default framebuffer shouldn't have been touched.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.checkCanvasRect(gl, 0, 0, sz, sz, [0, 0, 0, 0], "default framebuffer should be transparent black");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors after verifying framebuffers' contents");
+ // Attempt to bind deleted renderbuffer should fail.
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "from binding deleted renderbuffer");
+ debug("");
+ gl.deleteFramebuffer(fb);
+}
+
+function runTests() {
+ testBoundFBOTexture();
+ testUnboundFBOTexture();
+ testBoundFBORenderbuffer();
+ testUnboundFBORenderbuffer();
+ finishTest();
+}
+
+requestAnimationFrame(runTests);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html
new file mode 100644
index 0000000000..30d9b04708
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/incorrect-context-object-behaviour.html
@@ -0,0 +1,165 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Tests calling WebGL APIs with objects from other contexts");
+
+var wtu = WebGLTestUtils;
+var contextA = wtu.create3DContext();
+var contextB = wtu.create3DContext();
+var bufferA = contextA.createBuffer();
+var bufferB = contextB.createBuffer();
+var frameBufferA = contextA.createFramebuffer();
+var frameBufferB = contextB.createFramebuffer();
+var programA = wtu.loadStandardProgram(contextA);
+var programB = wtu.loadStandardProgram(contextB);
+var renderBufferA = contextA.createRenderbuffer();
+var renderBufferB = contextB.createRenderbuffer();
+var shaderA = wtu.loadStandardVertexShader(contextA);
+var shaderB = wtu.loadStandardVertexShader(contextB);
+var textureA = contextA.createTexture();
+var textureB = contextB.createTexture();
+var locationA = contextA.getUniformLocation(programA, 'u_modelViewProjMatrix');
+var locationB = contextB.getUniformLocation(programB, 'u_modelViewProjMatrix');
+var uniformData = [];
+
+function generateFloat32Array(length) {
+ uniformData = new Float32Array(length);
+}
+
+function generateFloatArray(length) {
+ uniformData = new Array(length);
+ for (var i = 0; i < length; i++) {
+ uniformData[i] = 0.0;
+ }
+}
+
+function generateInt32Array(length) {
+ uniformData = new Int32Array(length);
+}
+
+function generateIntArray(length) {
+ uniformData = new Array(length);
+ for (var i = 0; i < length; i++) {
+ uniformData[i] = 0;
+ }
+}
+
+// Make the bindable objects valid in both contexts first.
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindBuffer(contextA.ARRAY_BUFFER, bufferA)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindBuffer(contextA.ARRAY_BUFFER, null)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindBuffer(contextB.ARRAY_BUFFER, bufferB)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindBuffer(contextB.ARRAY_BUFFER, null)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindFramebuffer(contextA.FRAMEBUFFER, frameBufferA)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindFramebuffer(contextA.FRAMEBUFFER, null)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindFramebuffer(contextB.FRAMEBUFFER, frameBufferB)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindFramebuffer(contextB.FRAMEBUFFER, null)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindRenderbuffer(contextA.RENDERBUFFER, renderBufferA)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindRenderbuffer(contextA.RENDERBUFFER, null)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindRenderbuffer(contextB.RENDERBUFFER, renderBufferB)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindRenderbuffer(contextB.RENDERBUFFER, null)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindTexture(contextA.TEXTURE_2D, textureA)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.bindTexture(contextA.TEXTURE_2D, null)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindTexture(contextB.TEXTURE_2D, textureB)");
+wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "contextB.bindTexture(contextB.TEXTURE_2D, null)");
+
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.attachShader(programA, shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.attachShader(programB, shaderA)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.attachShader(programB, shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.bindAttribLocation(programB, 0, 'foo')");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.bindBuffer(contextA.ARRAY_BUFFER, bufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.bindFramebuffer(contextA.FRAMEBUFFER, frameBufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.bindRenderbuffer(contextA.RENDERBUFFER, renderBufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.bindTexture(contextA.TEXTURE_2D, textureB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.compileShader(shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.deleteBuffer(bufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.deleteFramebuffer(frameBufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.deleteProgram(programB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.deleteRenderbuffer(renderBufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.deleteShader(shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.deleteShader(shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.deleteTexture(textureB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.detachShader(programA, shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.detachShader(programB, shaderA)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.detachShader(programB, shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.framebufferRenderbuffer(contextA.FRAMEBUFFER, contextA.DEPTH_ATTACHMENT, contextA.RENDERBUFFER, renderBufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.framebufferTexture2D(contextA.FRAMEBUFFER, contextA.COLOR_ATTACHMENT0, contextA.TEXTURE_2D, textureB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getActiveAttrib(programB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getActiveUniform(programB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getAttachedShaders(programB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getAttribLocation(programB, 'a_vertex')");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getProgramParameter(programB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getProgramInfoLog(programB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getShaderParameter(shaderB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getShaderInfoLog(shaderB, 0)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getShaderSource(shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getUniform(programB, locationA)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getUniform(programA, locationB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getUniformLocation(programB, 'u_modelViewProjMatrix')");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.isBuffer(bufferB)");
+shouldBeFalse("contextA.isBuffer(bufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.isFramebuffer(frameBufferB)");
+shouldBeFalse("contextA.isFramebuffer(frameBufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.isProgram(programB)");
+shouldBeFalse("contextA.isProgram(programB)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.isRenderbuffer(renderBufferB)");
+shouldBeFalse("contextA.isRenderbuffer(renderBufferB)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.isShader(shaderB)");
+shouldBeFalse("contextA.isShader(shaderB)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.isTexture(textureB)");
+shouldBeFalse("contextA.isTexture(textureB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.linkProgram(programB)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.shaderSource(shaderB, 'foo')");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1f(locationB, 0.0)");
+generateFloat32Array(1); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1fv(locationB, uniformData)");
+generateFloatArray(1); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1fv(locationB, uniformData)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1i(locationB, 0)");
+generateInt32Array(1); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1iv(locationB, uniformData)");
+generateIntArray(1); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1iv(locationB, uniformData)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform2f(locationB, 0.0, 0.0)");
+generateFloat32Array(2); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform2fv(locationB, uniformData)");
+generateFloatArray(2); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform2fv(locationB, uniformData)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform2i(locationB, 0, 0)");
+generateInt32Array(2); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform2iv(locationB, uniformData)");
+generateIntArray(2); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform2iv(locationB, uniformData)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform3f(locationB, 0.0, 0.0, 0.0)");
+generateFloat32Array(3); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform3fv(locationB, uniformData)");
+generateFloatArray(3); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform3fv(locationB, uniformData)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform3i(locationB, 0, 0, 0)");
+generateInt32Array(3); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform3iv(locationB, uniformData)");
+generateIntArray(3); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform3iv(locationB, uniformData)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform4f(locationB, 0.0, 0.0, 0.0, 0.0)");
+generateFloat32Array(4); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform4fv(locationB, uniformData)");
+generateFloatArray(4); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform4fv(locationB, uniformData)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform4i(locationB, 0, 0, 0, 0)");
+generateInt32Array(4); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform4iv(locationB, uniformData)");
+generateIntArray(4); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform4iv(locationB, uniformData)");
+generateFloat32Array(4); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix2fv(locationB, false, uniformData)");
+generateFloatArray(4); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix2fv(locationB, false, uniformData)");
+generateFloat32Array(9); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix3fv(locationB, false, uniformData)");
+generateFloatArray(9); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix3fv(locationB, false, uniformData)");
+generateFloat32Array(16); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix4fv(locationB, false, uniformData)");
+generateFloatArray(16); wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix4fv(locationB, false, uniformData)");
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html
new file mode 100644
index 0000000000..d1e47f32a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/methods.html
@@ -0,0 +1,178 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Methods 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="../../js/tests/context-methods.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<script>
+"use strict";
+description("This test ensures that the WebGL context has all the methods in the specification.");
+
+const methods = [
+ "getContextAttributes",
+ "activeTexture",
+ "attachShader",
+ "bindAttribLocation",
+ "bindBuffer",
+ "bindFramebuffer",
+ "bindRenderbuffer",
+ "bindTexture",
+ "blendColor",
+ "blendEquation",
+ "blendEquationSeparate",
+ "blendFunc",
+ "blendFuncSeparate",
+ "bufferData",
+ "bufferSubData",
+ "checkFramebufferStatus",
+ "clear",
+ "clearColor",
+ "clearDepth",
+ "clearStencil",
+ "colorMask",
+ "compileShader",
+ "compressedTexImage2D",
+ "compressedTexSubImage2D",
+ "copyTexImage2D",
+ "copyTexSubImage2D",
+ "createBuffer",
+ "createFramebuffer",
+ "createProgram",
+ "createRenderbuffer",
+ "createShader",
+ "createTexture",
+ "cullFace",
+ "deleteBuffer",
+ "deleteFramebuffer",
+ "deleteProgram",
+ "deleteRenderbuffer",
+ "deleteShader",
+ "deleteTexture",
+ "depthFunc",
+ "depthMask",
+ "depthRange",
+ "detachShader",
+ "disable",
+ "disableVertexAttribArray",
+ "drawArrays",
+ "drawElements",
+ "enable",
+ "enableVertexAttribArray",
+ "finish",
+ "flush",
+ "framebufferRenderbuffer",
+ "framebufferTexture2D",
+ "frontFace",
+ "generateMipmap",
+ "getActiveAttrib",
+ "getActiveUniform",
+ "getAttachedShaders",
+ "getAttribLocation",
+ "getParameter",
+ "getBufferParameter",
+ "getError",
+ "getExtension",
+ "getFramebufferAttachmentParameter",
+ "getProgramParameter",
+ "getProgramInfoLog",
+ "getRenderbufferParameter",
+ "getShaderParameter",
+ "getShaderInfoLog",
+ "getShaderPrecisionFormat",
+ "getShaderSource",
+ "getSupportedExtensions",
+ "getTexParameter",
+ "getUniform",
+ "getUniformLocation",
+ "getVertexAttrib",
+ "getVertexAttribOffset",
+ "hint",
+ "isBuffer",
+ "isContextLost",
+ "isEnabled",
+ "isFramebuffer",
+ "isProgram",
+ "isRenderbuffer",
+ "isShader",
+ "isTexture",
+ "lineWidth",
+ "linkProgram",
+ "pixelStorei",
+ "polygonOffset",
+ "readPixels",
+ "renderbufferStorage",
+ "sampleCoverage",
+ "scissor",
+ "shaderSource",
+ "stencilFunc",
+ "stencilFuncSeparate",
+ "stencilMask",
+ "stencilMaskSeparate",
+ "stencilOp",
+ "stencilOpSeparate",
+ "texImage2D",
+ "texParameterf",
+ "texParameteri",
+ "texSubImage2D",
+ "uniform1f",
+ "uniform1fv",
+ "uniform1i",
+ "uniform1iv",
+ "uniform2f",
+ "uniform2fv",
+ "uniform2i",
+ "uniform2iv",
+ "uniform3f",
+ "uniform3fv",
+ "uniform3i",
+ "uniform3iv",
+ "uniform4f",
+ "uniform4fv",
+ "uniform4i",
+ "uniform4iv",
+ "uniformMatrix2fv",
+ "uniformMatrix3fv",
+ "uniformMatrix4fv",
+ "useProgram",
+ "validateProgram",
+ "vertexAttrib1f",
+ "vertexAttrib1fv",
+ "vertexAttrib2f",
+ "vertexAttrib2fv",
+ "vertexAttrib3f",
+ "vertexAttrib3fv",
+ "vertexAttrib4f",
+ "vertexAttrib4fv",
+ "vertexAttribPointer",
+ "viewport"
+];
+
+debug("");
+debug("Canvas.getContext");
+
+const wtu = WebGLTestUtils;
+const canvas = document.getElementById("canvas");
+const gl = wtu.create3DContext(canvas);
+
+testContextMethods(gl, methods);
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html
new file mode 100644
index 0000000000..ecbe251611
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/premultiplyalpha-test.html
@@ -0,0 +1,251 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test the WebGL premultipliedAlpha context creation flag.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<div id="description"></div><div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+// wtu.create3DContext(...) will set antialias to false by default
+// if the antialias property is not set to true explicitly.
+// To cover the antialias case, it needs to set antialias to true
+// explicitly.
+var tests = [
+ // If premultipliedAlpha is true and antialias is false then
+ // [texture] [canvas] [dataURL]
+ // 32, 64, 128, 128 -> 64, 128, 255, 128 -> 64, 128, 255, 128
+ { creationAttributes: {},
+ sentColor: [32, 64, 128, 128],
+ expectedColor: [64, 128, 255, 128],
+ errorRange: 2,
+ imageFormat: "image/png"
+ },
+ // If premultipliedAlpha is true and antialias is true then
+ // [texture] [canvas] [dataURL]
+ // 32, 64, 128, 128 -> 64, 128, 255, 128 -> 64, 128, 255, 128
+ { creationAttributes: {antialias: true},
+ sentColor: [32, 64, 128, 128],
+ expectedColor: [64, 128, 255, 128],
+ errorRange: 2,
+ imageFormat: "image/png"
+ },
+ // If premultipliedAlpha is true and antialias is false then
+ // [texture] [canvas] [texture]
+ // 32, 64, 128, 128 -> 64, 128, 255, 128 -> 64, 128, 255, 128
+ { creationAttributes: {},
+ sentColor: [32, 64, 128, 128],
+ expectedColor: [64, 128, 255, 128],
+ errorRange: 2,
+ },
+ // If premultipliedAlpha is true and antialias is true then
+ // [texture] [canvas] [texture]
+ // 32, 64, 128, 128 -> 64, 128, 255, 128 -> 64, 128, 255, 128
+ { creationAttributes: {antialias: true},
+ sentColor: [32, 64, 128, 128],
+ expectedColor: [64, 128, 255, 128],
+ errorRange: 2,
+ },
+ // If premultipliedAlpha is false and antialias is false then
+ // [texture] [canvas] [dataURL]
+ // 255, 192, 128, 1 -> 255, 192, 128, 1 -> 255, 192, 128, 1
+ { creationAttributes: {premultipliedAlpha: false},
+ sentColor: [255, 192, 128, 1],
+ expectedColor: [255, 192, 128, 1],
+ errorRange: 0,
+ imageFormat: "image/png"
+ },
+ // If premultipliedAlpha is false and antialias is true then
+ // [texture] [canvas] [dataURL]
+ // 255, 192, 128, 1 -> 255, 192, 128, 1 -> 255, 192, 128, 1
+ { creationAttributes: {premultipliedAlpha: false, antialias: true},
+ sentColor: [255, 192, 128, 1],
+ expectedColor: [255, 192, 128, 1],
+ errorRange: 0,
+ imageFormat: "image/png"
+ },
+ // If premultipliedAlpha is false and antialias is false then
+ // [texture] [canvas] [texture]
+ // 255, 192, 128, 1 -> 255, 192, 128, 1 -> 255, 192, 128, 1
+ { creationAttributes: {premultipliedAlpha: false},
+ sentColor: [255, 192, 128, 1],
+ expectedColor: [255, 192, 128, 1],
+ errorRange: 0,
+ },
+ // If premultipliedAlpha is false and antialias is true then
+ // [texture] [canvas] [texture]
+ // 255, 192, 128, 1 -> 255, 192, 128, 1 -> 255, 192, 128, 1
+ { creationAttributes: {premultipliedAlpha: false, antialias: true},
+ sentColor: [255, 192, 128, 1],
+ expectedColor: [255, 192, 128, 1],
+ errorRange: 0,
+ },
+ // If premultipliedAlpha is false and antialias is false then
+ // [texture] [canvas] [dataURL]
+ // 255, 255, 255, 128 -> 255, 255, 255, 128 -> 128, 128, 128, 255
+ { creationAttributes: {premultipliedAlpha: false},
+ sentColor: [255, 255, 255, 128],
+ expectedColor: [128, 128, 128, 255],
+ errorRange: 2,
+ imageFormat: "image/jpeg"
+ },
+ // If premultipliedAlpha is false and antialias is true then
+ // [texture] [canvas] [dataURL]
+ // 255, 255, 255, 128 -> 255, 255, 255, 128 -> 128, 128, 128, 255
+ { creationAttributes: {premultipliedAlpha: false, antialias: true},
+ sentColor: [255, 255, 255, 128],
+ expectedColor: [128, 128, 128, 255],
+ errorRange: 2,
+ imageFormat: "image/jpeg"
+ },
+ // If premultipliedAlpha is true and antialias is false then
+ // [texture] [canvas] [dataURL]
+ // 128, 128, 128, 128 -> 255, 255, 255, 128 -> 128, 128, 128, 255
+ { creationAttributes: {},
+ sentColor: [128, 128, 128, 128],
+ expectedColor: [128, 128, 128, 255],
+ errorRange: 2,
+ imageFormat: "image/jpeg"
+ },
+ // If premultipliedAlpha is true and antialias is true then
+ // [texture] [canvas] [dataURL]
+ // 128, 128, 128, 128 -> 255, 255, 255, 128 -> 128, 128, 128, 255
+ { creationAttributes: {antialias: true},
+ sentColor: [128, 128, 128, 128],
+ expectedColor: [128, 128, 128, 255],
+ errorRange: 2,
+ imageFormat: "image/jpeg"
+ }
+];
+
+var g_count = 0;
+var gl;
+var canvas;
+var premultipliedAlpha;
+
+enableJSTestPreVerboseLogging();
+description("Test the WebGL premultipliedAlpha context creation flag.");
+doNextTest();
+function doNextTest() {
+ if (g_count < tests.length) {
+ var test = tests[g_count++];
+ canvas = document.createElement("canvas");
+ // Need to preserve drawing buffer to load it in a callback
+ test.creationAttributes.preserveDrawingBuffer = true;
+ gl = wtu.create3DContext(canvas, test.creationAttributes);
+ var premultipliedAlpha = test.creationAttributes.premultipliedAlpha != false;
+ var antialias = test.creationAttributes.antialias == true;
+ debug("")
+ debug("testing: premultipliedAlpha: " + premultipliedAlpha
+ + ", antialias: " + antialias
+ + ", imageFormat: " + test.imageFormat);
+
+ if (!gl) {
+ testFailed("context does not exist");
+ doNextTest();
+ return;
+ }
+
+ shouldBe('gl.getContextAttributes().premultipliedAlpha', premultipliedAlpha.toString());
+ shouldBeTrue('gl.getContextAttributes().preserveDrawingBuffer');
+
+ wtu.log(gl.getContextAttributes());
+ var program = wtu.setupTexturedQuad(gl);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+ var tex = gl.createTexture();
+ wtu.fillTexture(gl, tex, 2, 2, test.sentColor, 0);
+ var loc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(loc, 0);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ 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);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from drawing.");
+
+ var loadTexture = function() {
+ debug("loadTexture called");
+ var pngTex = gl.createTexture();
+ // not needed as it's the default
+ // gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);');
+ gl.bindTexture(gl.TEXTURE_2D, pngTex);
+ if (test.imageFormat) {
+ // create texture from image
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this);
+ } else {
+ // create texture from canvas
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
+ }
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ 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);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from creating copy.");
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from 2nd drawing.");
+ wtu.checkCanvas(
+ gl, test.expectedColor,
+ "should draw with " + test.expectedColor, test.errorRange);
+
+ doNextTest();
+ }
+
+ var loadTextureError = function() {
+ testFailed("Creating image from canvas failed. Image src: " + this.src);
+ finishTest();
+ }
+
+ var shrinkString = function(string) {
+ if (string.length < 63) {
+ return string;
+ }
+ return string.substr(0, 30) + "..." + string.substr(string.length - 30);
+ }
+
+ if (test.imageFormat) {
+ // Load canvas into string using toDataURL
+ debug("Calling canvas.toDataURL('" + test.imageFormat + "')");
+ var imageUrl = canvas.toDataURL(test.imageFormat);
+ debug("imageUrl = '" + shrinkString(imageUrl) + "'");
+ if (test.imageFormat != "image/png" &&
+ (imageUrl.indexOf("data:image/png,") == 0 ||
+ imageUrl.indexOf("data:image/png;") == 0)) {
+ debug("Image format " + test.imageFormat + " not supported; skipping");
+ setTimeout(doNextTest, 0);
+ } else {
+ // Load string into the texture
+ debug("Waiting for image.onload");
+ var input = wtu.makeImage(imageUrl, loadTexture, loadTextureError);
+ }
+ } else {
+ // Load canvas into the texture asynchronously (to prevent unbounded stack consumption)
+ debug("Waiting for setTimeout");
+ setTimeout(loadTexture, 0);
+ }
+ } else {
+ var successfullyParsed = true;
+ finishTest();
+ }
+}
+
+</script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html
new file mode 100644
index 0000000000..66408c0ef2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-child-with-worker.html
@@ -0,0 +1,55 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html style="margin: 0; padding: 0;">
+<head>
+<meta charset="utf-8">
+<title>Simple WebGL context with Worker</title>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body style="margin: 0; padding: 0; overflow: hidden;">
+<canvas id="c" width="1680" height="1050" style="width: 256px; height: 256px;"> <!-- scaled to fit page better -->
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var myWorker = new Worker("context-release-worker.js");
+
+var gl = wtu.create3DContext("c", { antialias: false });
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+var vertexObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.75,0, -0.75,-0.75,0, 0.75,-0.75,0 ]), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+gl.clearColor(0.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+if (parent) {
+ window.glContext = gl;
+ parent.postMessage("Ready", "*");
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html
new file mode 100644
index 0000000000..9f06c41d4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-upon-reload-child.html
@@ -0,0 +1,54 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html style="margin: 0; padding: 0;">
+<head>
+<meta charset="utf-8">
+<title>Simple WebGL context</title>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body style="margin: 0; padding: 0; overflow: hidden;">
+<canvas id="c" width="1680" height="1050" style="width: 256px; height: 256px;"> <!-- scaled to fit page better -->
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+var gl = wtu.create3DContext("c", { antialias: false });
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+var vertexObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.75,0, -0.75,-0.75,0, 0.75,-0.75,0 ]), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+gl.clearColor(0.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+if (parent) {
+ window.glContext = gl;
+ parent.postMessage("Ready", "*");
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js
new file mode 100644
index 0000000000..3680117c25
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/resources/context-release-worker.js
@@ -0,0 +1,4 @@
+// Simple worker used to provoke WebGL context release bugs on Chrome
+
+postMessage("Hello World");
+close(); \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html
new file mode 100644
index 0000000000..4029087c1f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/user-defined-properties-on-context.html
@@ -0,0 +1,49 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL User-Defined Properties 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>
+</head>
+<body onload="initialize()">
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<script>
+"use strict";
+description("This test ensures that if user-defined properties are set on the WebGL context object, that they don't disappear after garbage collection.");
+
+var gl2 = null;
+
+function initialize() {
+ var wtu = WebGLTestUtils;
+ var canvas = document.getElementById("canvas");
+ var gl1 = wtu.create3DContext(canvas);
+ if (!gl1) {
+ testFailed("WebGL context does not exist");
+ finishTest();
+ } else {
+ testPassed("WebGL context exists");
+ gl1.myProperty = 2;
+ wtu.requestAnimFrame(runTest);
+ }
+}
+
+function runTest() {
+ webglHarnessCollectGarbage();
+ var wtu = WebGLTestUtils;
+ var canvas = document.getElementById("canvas");
+ gl2 = wtu.create3DContext(canvas);
+ shouldBe('gl2.myProperty', '2');
+ finishTest();
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/context/zero-sized-canvas.html b/dom/canvas/test/webgl-conf/checkout/conformance/context/zero-sized-canvas.html
new file mode 100644
index 0000000000..13e1338865
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/context/zero-sized-canvas.html
@@ -0,0 +1,59 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+// Global declarations so that "shouldBe" can eval with them:
+let gl;
+
+(function() {
+ description('Check that zero-sized canvases work with WebGL.');
+
+ testZero();
+
+ finishTest();
+})();
+
+function testZero() {
+ const canvas = document.createElement('canvas');
+ canvas.width = 0;
+ canvas.height = 0;
+ gl = WebGLTestUtils.create3DContext(canvas);
+
+ expectTrue(gl, `Context creation with ${canvas.width}x${canvas.height} canvas should succeed.`);
+ shouldBe('gl.drawingBufferWidth', '1');
+ shouldBe('gl.drawingBufferHeight', '1');
+ shouldBeFalse('gl.isContextLost()');
+
+ const version = gl.getParameter(gl.VERSION);
+ expectTrue(version && version.length, `getParameter() should return something.`);
+
+ debug('canvas.width = 2');
+ canvas.width = 2;
+ shouldBe('gl.drawingBufferWidth', '2');
+ shouldBeFalse('gl.isContextLost()');
+
+ debug('canvas.width = 0');
+ canvas.width = 0;
+ shouldBe('gl.drawingBufferWidth', '1');
+ shouldBeFalse('gl.isContextLost()');
+}
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt
new file mode 100644
index 0000000000..9a72b67ef0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/00_test_list.txt
@@ -0,0 +1,46 @@
+--min-version 1.0.3 --max-version 1.9.9 angle-instanced-arrays.html
+--min-version 1.0.3 --max-version 1.9.9 angle-instanced-arrays-out-of-bounds.html
+--min-version 1.0.3 --max-version 1.9.9 ext-blend-minmax.html
+--min-version 1.0.4 ext-color-buffer-half-float.html
+--min-version 1.0.4 ext-float-blend.html
+--min-version 1.0.4 ext-texture-compression-bptc.html
+--min-version 1.0.4 ext-texture-compression-rgtc.html
+--min-version 1.0.4 ext-disjoint-timer-query.html
+--min-version 1.0.3 --max-version 1.9.9 ext-frag-depth.html
+--min-version 1.0.3 --max-version 1.9.9 ext-shader-texture-lod.html
+--min-version 1.0.3 --max-version 1.9.9 ext-sRGB.html
+--min-version 1.0.2 ext-texture-filter-anisotropic.html
+--min-version 1.0.2 get-extension.html
+--min-version 1.0.4 khr-parallel-shader-compile.html
+--max-version 1.9.9 oes-standard-derivatives.html
+--max-version 1.9.9 oes-texture-float-with-canvas.html
+--max-version 1.9.9 oes-texture-float-with-image-data.html
+--max-version 1.9.9 oes-texture-float-with-image.html
+--max-version 1.9.9 oes-texture-float-with-video.html
+--max-version 1.9.9 oes-texture-float.html
+--max-version 1.9.9 oes-vertex-array-object.html
+--min-version 1.0.3 --max-version 1.9.9 oes-vertex-array-object-bufferData.html
+--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float.html
+--min-version 1.0.3 oes-texture-float-linear.html
+--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-linear.html
+--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-canvas.html
+--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-image-data.html
+--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-image.html
+--min-version 1.0.3 --max-version 1.9.9 oes-texture-half-float-with-video.html
+--min-version 1.0.2 --max-version 1.9.9 oes-element-index-uint.html
+--min-version 1.0.4 --max-version 1.9.9 oes-fbo-render-mipmap.html
+webgl-debug-renderer-info.html
+webgl-debug-shaders.html
+--min-version 1.0.4 webgl-compressed-texture-astc.html
+--min-version 1.0.4 webgl-compressed-texture-etc.html
+--min-version 1.0.4 webgl-compressed-texture-etc1.html
+--min-version 1.0.3 webgl-compressed-texture-pvrtc.html
+--min-version 1.0.4 s3tc-and-rgtc.html
+--min-version 1.0.4 webgl-compressed-texture-s3tc-srgb.html
+--min-version 1.0.3 webgl-compressed-texture-size-limit.html
+--min-version 1.0.2 --max-version 1.9.9 webgl-depth-texture.html
+--min-version 1.0.3 --max-version 1.9.9 webgl-draw-buffers.html
+--min-version 1.0.4 --max-version 1.9.9 webgl-draw-buffers-broadcast-return.html
+--min-version 1.0.4 --max-version 1.9.9 webgl-draw-buffers-framebuffer-unsupported.html
+--min-version 1.0.4 --max-version 1.9.9 webgl-draw-buffers-max-draw-buffers.html
+--min-version 1.0.4 webgl-multi-draw.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html
new file mode 100644
index 0000000000..64a063854e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays-out-of-bounds.html
@@ -0,0 +1,56 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/out-of-bounds-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test of drawArraysInstancedANGLE and drawElementsInstancedANGLE with out-of-bounds parameters");
+
+var wtu = WebGLTestUtils;
+
+var gl = wtu.create3DContext();
+var ext = wtu.getExtensionWithKnownPrefixes(gl, "ANGLE_instanced_arrays");
+if (!ext) {
+ testPassed("No ANGLE_instanced_arrays support -- this is legal");
+} else {
+ testPassed("Successfully enabled ANGLE_instanced_arrays extension");
+ debug("");
+ debug("Test with 1 instance without instanced attributes");
+ debug("");
+ OutOfBoundsTest.runDrawArraysTest("ext.drawArraysInstancedANGLE(gl.TRIANGLES, $(offset), $(count), 1)", gl, wtu, ext);
+ debug("");
+ OutOfBoundsTest.runDrawElementsTest("ext.drawElementsInstancedANGLE(gl.TRIANGLES, $(count), $(type), $(offset), 1)", gl, wtu, ext);
+ debug("");
+ debug("Test with 2 instances without instanced attributes");
+ debug("");
+ OutOfBoundsTest.runDrawArraysTest("ext.drawArraysInstancedANGLE(gl.TRIANGLES, $(offset), $(count), 2)", gl, wtu, ext);
+ debug("");
+ OutOfBoundsTest.runDrawElementsTest("ext.drawElementsInstancedANGLE(gl.TRIANGLES, $(count), $(type), $(offset), 2)", gl, wtu, ext);
+ debug("");
+ OutOfBoundsTest.runDrawArraysInstancedTest("ext.drawArraysInstancedANGLE(gl.TRIANGLES, $(offset), $(count), $(primcount))", gl, wtu, ext);
+ debug("");
+ OutOfBoundsTest.runDrawElementsInstancedTest("ext.drawElementsInstancedANGLE(gl.TRIANGLES, $(count), $(type), $(offset), $(primcount))", gl, wtu, ext);
+ debug("");
+}
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html
new file mode 100644
index 0000000000..f96c732bb2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/angle-instanced-arrays.html
@@ -0,0 +1,723 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ANGLE_instanced_arrays Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compositing-test.js"></script>
+<script src="../../js/tests/invalid-vertex-attrib-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders for testing instanced draws -->
+<script id="outputVertexShader" type="x-shader/x-vertex">
+attribute vec4 aPosition;
+attribute vec2 aOffset;
+attribute vec4 aColor;
+varying vec4 vColor;
+void main() {
+ vColor = aColor;
+ gl_Position = aPosition + vec4(aOffset, 0.0, 0.0);
+}
+</script>
+
+<script id="outputFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 vColor;
+void main() {
+ gl_FragColor = vColor;
+}
+</script>
+
+<script id="drawArraysTestVertexShader" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+attribute vec3 aInstancePos;
+uniform vec3 uOffset;
+void main() {
+ gl_Position = vec4(aPosition.xyz + aInstancePos.xyz + uOffset, 1.0);
+}
+</script>
+
+<script id="drawArraysTestFragmentShader" type="x-shader/x-fragment">
+void main() {
+ gl_FragColor = vec4(1.0, 0, 0, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+description("This test verifies the functionality of the ANGLE_instanced_arrays extension, if it is available.");
+
+debug("");
+
+const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+var vaoext = null;
+
+var positionLoc = 0;
+var offsetLoc = 2;
+var colorLoc = 3;
+var program;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+ finishTest();
+} else {
+ testPassed("WebGL context exists");
+
+ runDivisorTestDisabled();
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "ANGLE_instanced_arrays");
+ if (!ext) {
+ testPassed("No ANGLE_instanced_arrays support -- this is legal");
+
+ runSupportedTest(false);
+ finishTest();
+ } else {
+ testPassed("Successfully enabled ANGLE_instanced_arrays extension");
+
+ (async function() {
+ runSupportedTest(true);
+
+ runDivisorTestEnabled();
+ runUniqueObjectTest();
+
+ setupCanvas();
+ runOutputTests();
+ runDrawArraysWithOffsetTest();
+ runVAOInstancingInteractionTest();
+ await runANGLECorruptionTest();
+ await runInvalidAttribTests(gl);
+ await runCompositingTests();
+ finishTest();
+ }());
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("ANGLE_instanced_arrays") >= 0) {
+ if (extensionEnabled) {
+ testPassed("ANGLE_instanced_arrays listed as supported and getExtension succeeded");
+ } else {
+ testFailed("ANGLE_instanced_arrays listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("ANGLE_instanced_arrays not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("ANGLE_instanced_arrays not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runDivisorTestDisabled() {
+ debug("Testing VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE with extension disabled");
+
+ var VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
+
+ gl.getVertexAttrib(0, VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE should not be queryable if extension is disabled");
+}
+
+function runDivisorTestEnabled() {
+ debug("Testing VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE with extension enabled");
+
+ shouldBe("ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE", "0x88FE");
+
+ var max_vertex_attribs = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
+
+ for (var i = 0; i < max_vertex_attribs; ++i) {
+ var queried_value = gl.getVertexAttrib(i, ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
+ if(queried_value == 0){
+ testPassed("Vertex attribute " + i + " must has a default divisor of 0");
+ }
+ else{
+ testFailed("Default divisor of vertex attribute " + i + " should be: 0, returned value was: " + queried_value);
+ }
+ }
+
+ ext.vertexAttribDivisorANGLE(max_vertex_attribs, 2);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "vertexAttribDivisorANGLE index set greater than or equal to MAX_VERTEX_ATTRIBS should be an invalid value");
+
+ ext.vertexAttribDivisorANGLE(max_vertex_attribs-1, 2);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "vertexAttribDivisorANGLE index set less than MAX_VERTEX_ATTRIBS should succeed");
+
+ var queried_value = gl.getVertexAttrib(max_vertex_attribs-1, ext.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
+ if(queried_value == 2){
+ testPassed("Set value of VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE matches expecation");
+ }
+ else{
+ testFailed("Set value of VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE should be: 2, returned value was: " + queried_value);
+ }
+
+ // Reset vertex attrib divisors so they cannot affect following subtests.
+ ext.vertexAttribDivisorANGLE(max_vertex_attribs-1, 0);
+}
+
+function setupCanvas() {
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+ gl.clearColor(0, 0, 0, 0);
+
+ program = wtu.setupProgram(gl, ["outputVertexShader", "outputFragmentShader"], ['aPosition', 'aOffset', 'aColor'], [positionLoc, offsetLoc, colorLoc]);
+ ext = gl.getExtension("ANGLE_instanced_arrays");
+}
+
+function runOutputTests() {
+ var instanceCount = 4;
+
+ debug("Testing various draws for valid built-in function behavior");
+
+ var offsets = new Float32Array([
+ -1.0, 1.0,
+ 1.0, 1.0,
+ -1.0, -1.0,
+ 1.0, -1.0,
+ ]);
+ var offsetBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, offsetBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, offsets, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(offsetLoc);
+ gl.vertexAttribPointer(offsetLoc, 2, gl.FLOAT, false, 0, 0);
+ ext.vertexAttribDivisorANGLE(offsetLoc, 1);
+
+ var colors = new Float32Array([
+ 1.0, 0.0, 0.0, 1.0, // Red
+ 0.0, 1.0, 0.0, 1.0, // Green
+ 0.0, 0.0, 1.0, 1.0, // Blue
+ 1.0, 1.0, 0.0, 1.0, // Yellow
+ // extra data when colorLoc divisor is set back to 0
+ 1.0, 1.0, 0.0, 1.0, // Yellow
+ 1.0, 1.0, 0.0, 1.0, // Yellow
+ ]);
+ var colorBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(colorLoc);
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+ ext.vertexAttribDivisorANGLE(colorLoc, 1);
+
+ wtu.setupUnitQuad(gl, 0);
+
+ // Draw 1: Regular drawArrays
+ debug("");
+ debug("Testing drawArrays with non-zero divisor");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "vertex attrib divisor should affect regular drawArrays when the extension is enabled");
+ wtu.checkCanvasRect(gl, 0, canvas.height/2, canvas.width/2, canvas.height/2, [255, 0, 0, 255]);
+
+ // Draw 2: Draw Non-indexed instances
+ debug("");
+ debug("Testing drawArraysInstancedANGLE");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Test drawArraysInstancedANGLE error conditions
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 6, instanceCount);
+ wtu.checkCanvasRect(gl, 0, canvas.height/2, canvas.width/2, canvas.height/2, [255, 0, 0, 255]);
+ wtu.checkCanvasRect(gl, canvas.width/2, canvas.height/2, canvas.width/2, canvas.height/2, [0, 255, 0, 255]);
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width/2, canvas.height/2, [0, 0, 255, 255]);
+ wtu.checkCanvasRect(gl, canvas.width/2, 0, canvas.width/2, canvas.height/2, [255, 255, 0, 255]);
+
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 6, -1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "drawArraysInstancedANGLE cannot have a primcount less than 0");
+
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, -1, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "drawArraysInstancedANGLE cannot have a count less than 0");
+
+ ext.vertexAttribDivisorANGLE(positionLoc, 1);
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "There must be at least one vertex attribute with a divisor of zero when calling drawArraysInstancedANGLE");
+ ext.vertexAttribDivisorANGLE(positionLoc, 0);
+
+ ext.drawArraysInstancedANGLE(gl.POINTS, 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawArraysInstancedANGLE with POINTS should succeed");
+ ext.drawArraysInstancedANGLE(gl.LINES, 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawArraysInstancedANGLE with LINES should succeed");
+ ext.drawArraysInstancedANGLE(gl.LINE_LIST, 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawArraysInstancedANGLE with LINE_LIST should return succeed");
+ ext.drawArraysInstancedANGLE(gl.TRIANGLE_LIST, 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawArraysInstancedANGLE with TRIANGLE_LIST should succeed");
+
+ ext.drawArraysInstancedANGLE(desktopGL['QUAD_STRIP'], 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "drawArraysInstancedANGLE with QUAD_STRIP should return INVALID_ENUM");
+ ext.drawArraysInstancedANGLE(desktopGL['QUADS'], 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "drawArraysInstancedANGLE with QUADS should return INVALID_ENUM");
+ ext.drawArraysInstancedANGLE(desktopGL['POLYGON'], 0, 6, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "drawArraysInstancedANGLE with POLYGON should return INVALID_ENUM");
+
+ debug("");
+ debug("Testing drawArraysInstancedANGLE with param 'first' > 0");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.setupQuad(gl, {
+ positionLocation: 0,
+ scale: 0.5
+ });
+ var offsetsHalf = new Float32Array([
+ -0.5, 0.5,
+ 0.5, 0.5,
+ -0.5, -0.5,
+ 0.5, -0.5
+ ]);
+ gl.bindBuffer(gl.ARRAY_BUFFER, offsetBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, offsetsHalf, gl.STATIC_DRAW);
+
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 3, 3, instanceCount);
+ var w = Math.floor(0.25*canvas.width),
+ h = Math.floor(0.25*canvas.height);
+ wtu.checkCanvasRect(gl, Math.ceil(0.25*canvas.width), 0.5*canvas.height, w, h, [255, 0, 0, 255]);
+ wtu.checkCanvasRect(gl, Math.ceil(0.75*canvas.width), 0.5*canvas.height, w, h, [0, 255, 0, 255]);
+ wtu.checkCanvasRect(gl, Math.ceil(0.25*canvas.width), 0, w, h, [0, 0, 255, 255]);
+ wtu.checkCanvasRect(gl, Math.ceil(0.75*canvas.width), 0, w, h, [255, 255, 0, 255]);
+
+ debug("");
+ debug("Testing drawArraysInstancedANGLE with attributes 'divisor' reset to 0");
+ debug("Correct rendering output: 4 yellow triangles");
+ debug("Possible incorrect rendering output: missing triangles, or triangles with different color at each vertex");
+ ext.vertexAttribDivisorANGLE(colorLoc, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 3, 3, instanceCount);
+ wtu.checkCanvasRect(gl, Math.ceil(0.25*canvas.width), 0.5*canvas.height, w, h, [255, 255, 0, 255]);
+ wtu.checkCanvasRect(gl, Math.ceil(0.75*canvas.width), 0.5*canvas.height, w, h, [255, 255, 0, 255]);
+ wtu.checkCanvasRect(gl, Math.ceil(0.25*canvas.width), 0, w, h, [255, 255, 0, 255]);
+ wtu.checkCanvasRect(gl, Math.ceil(0.75*canvas.width), 0, w, h, [255, 255, 0, 255]);
+ ext.vertexAttribDivisorANGLE(colorLoc, 1);
+
+ wtu.setupUnitQuad(gl, 0);
+ wtu.setupIndexedQuad(gl, 1, 0);
+ gl.bindBuffer(gl.ARRAY_BUFFER, offsetBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, offsets, gl.STATIC_DRAW);
+
+ // Draw 3: Regular drawElements
+ debug("");
+ debug("Testing drawElements with non-zero divisor");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ // Point to another location in the buffer so that the draw would overflow without the divisor
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 48);
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "vertex attrib divisor should affect regular drawElements when the extension is enabled");
+ wtu.checkCanvasRect(gl, 0, canvas.height/2, canvas.width/2, canvas.height/2, [255, 255, 0, 255]);
+ // Restore the vertex attrib pointer
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+
+ // Draw 4: Draw indexed instances
+ debug("");
+ debug("Testing drawElementsInstancedANGLE");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ ext.drawElementsInstancedANGLE(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.checkCanvasRect(gl, 0, canvas.height/2, canvas.width/2, canvas.height/2, [255, 0, 0, 255]);
+ wtu.checkCanvasRect(gl, canvas.width/2, canvas.height/2, canvas.width/2, canvas.height/2, [0, 255, 0, 255]);
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width/2, canvas.height/2, [0, 0, 255, 255]);
+ wtu.checkCanvasRect(gl, canvas.width/2, 0, canvas.width/2, canvas.height/2, [255, 255, 0, 255]);
+
+ // Test drawElementsInstancedANGLE error conditions
+ ext.drawElementsInstancedANGLE(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0, -1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "drawElementsInstancedANGLE cannot have a primcount less than 0");
+
+ ext.drawElementsInstancedANGLE(gl.TRIANGLES, -1, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "drawElementsInstancedANGLE cannot have a count less than 0");
+
+ ext.vertexAttribDivisorANGLE(positionLoc, 1);
+ ext.drawElementsInstancedANGLE(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "There must be at least one vertex attribute with a divisor of zero when calling drawElementsInstancedANGLE");
+ ext.vertexAttribDivisorANGLE(positionLoc, 0);
+
+ ext.drawElementsInstancedANGLE(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawElementsInstancedANGLE with UNSIGNED_BYTE should succeed");
+
+ ext.drawElementsInstancedANGLE(gl.POINTS, 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawElementsInstancedANGLE with POINTS should succeed");
+ ext.drawElementsInstancedANGLE(gl.LINES, 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawElementsInstancedANGLE with LINES should succeed");
+ ext.drawElementsInstancedANGLE(gl.LINE_LIST, 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawElementsInstancedANGLE with LINE_LIST should return succeed");
+ ext.drawElementsInstancedANGLE(gl.TRIANGLE_LIST, 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawElementsInstancedANGLE with TRIANGLE_LIST should succeed");
+
+ ext.drawElementsInstancedANGLE(desktopGL['QUAD_STRIP'], 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "drawElementsInstancedANGLE with QUAD_STRIP should return INVALID_ENUM");
+ ext.drawElementsInstancedANGLE(desktopGL['QUADS'], 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "drawElementsInstancedANGLE with QUADS should return INVALID_ENUM");
+ ext.drawElementsInstancedANGLE(desktopGL['POLYGON'], 6, gl.UNSIGNED_SHORT, 0, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "drawElementsInstancedANGLE with POLYGON should return INVALID_ENUM");
+
+ // Reset vertex attrib divisors so they cannot affect following subtests.
+ ext.vertexAttribDivisorANGLE(colorLoc, 0);
+ ext.vertexAttribDivisorANGLE(offsetLoc, 0);
+}
+
+function runDrawArraysTest(program, first, count, instanceCount, offset)
+{
+ // Get the attribute and uniform locations
+ var positionLoc = gl.getAttribLocation(program, "aPosition");
+ var instancePosLoc = gl.getAttribLocation(program, "aInstancePos");
+ var uniformLoc = gl.getUniformLocation(program, "uOffset");
+
+ // Load the vertex positions
+ var positions = new Float32Array([
+ -1, -1,
+ -1, 0,
+ 0, 0,
+
+ 0, 0,
+ 0, -1,
+ -1, -1,
+
+ 1, -1,
+ 1, 0,
+ 0, 0,
+
+ 0, 0,
+ 0, -1,
+ 1, -1,
+ ]);
+ var positionBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(positionLoc);
+ gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);
+
+ // Load the instance positions
+ var instancePositions = new Float32Array([
+ 0, 0,
+ 1, 0
+ ]);
+ var instancePositionBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, instancePositionBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, instancePositions, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(instancePosLoc);
+ gl.vertexAttribPointer(instancePosLoc, 2, gl.FLOAT, false, 0, 0);
+
+ // Enable instancing
+ ext.vertexAttribDivisorANGLE(instancePosLoc, 1);
+
+ // Offset
+ gl.uniform3fv(uniformLoc, offset);
+
+ // Do the instanced draw
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, first, count, instanceCount);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawArraysInstancedANGLE should succeed");
+
+ // Reset vertex attrib divisors so they cannot affect following subtests.
+ ext.vertexAttribDivisorANGLE(instancePosLoc, 0);
+}
+
+function runDrawArraysWithOffsetTest()
+{
+ debug("");
+ debug("Testing that the 'first' parameter to drawArraysInstancedANGLE is only an offset into the non-instanced vertex attributes.");
+ // See: http://crbug.com/457269 and http://crbug.com/447140
+
+ var drawArraysProgram = wtu.setupProgram(gl, ["drawArraysTestVertexShader", "drawArraysTestFragmentShader"]);
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ runDrawArraysTest(drawArraysProgram, 0, 6, 2, [0, 0, 0]);
+
+ runDrawArraysTest(drawArraysProgram, 6, 6, 2, [-1, 1, 0]);
+
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [255, 0, 0, 255]);
+}
+
+function runUniqueObjectTest()
+{
+ debug("");
+ debug("Testing that getExtension() returns the same object each time");
+ ext = null;
+ gl.getExtension("ANGLE_instanced_arrays").myProperty = 2;
+ webglHarnessCollectGarbage();
+ shouldBe('gl.getExtension("ANGLE_instanced_arrays").myProperty', '2');
+}
+
+function runVAOInstancingInteractionTest()
+{
+ debug("")
+ debug("Testing that ANGLE_instanced_arrays interacts correctly with OES_vertex_array_object if present");
+ // See: https://github.com/KhronosGroup/WebGL/issues/1228
+
+ // Query the extension and store globally so shouldBe can access it
+ vaoext = gl.getExtension("OES_vertex_array_object");
+ if (!vaoext) {
+ testPassed("No OES_vertex_array_object support -- this is legal");
+ return;
+ }
+
+ testPassed("Successfully enabled OES_vertex_array_object extension");
+
+ gl.useProgram(program);
+
+ var positions = new Float32Array([
+ 0.0, 1.0, // Left quad
+ -1.0, 1.0,
+ -1.0, -1.0,
+ 0.0, 1.0,
+ -1.0, -1.0,
+ 0.0, -1.0,
+
+ 1.0, 1.0, // Right quad
+ 0.0, 1.0,
+ 0.0, -1.0,
+ 1.0, 1.0,
+ 0.0, -1.0,
+ 1.0, -1.0
+ ]);
+ var positionBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, positions, gl.STATIC_DRAW);
+
+ var colors = new Float32Array([
+ 1.0, 0.0, 0.0, 1.0, // Red
+ 1.0, 0.0, 0.0, 1.0,
+ 1.0, 0.0, 0.0, 1.0,
+ 1.0, 0.0, 0.0, 1.0,
+ 1.0, 0.0, 0.0, 1.0,
+ 1.0, 0.0, 0.0, 1.0,
+
+ 0.0, 0.0, 1.0, 1.0, // Blue
+ 0.0, 0.0, 1.0, 1.0,
+ 0.0, 0.0, 1.0, 1.0,
+ 0.0, 0.0, 1.0, 1.0,
+ 0.0, 0.0, 1.0, 1.0,
+ 0.0, 0.0, 1.0, 1.0,
+ ]);
+ var colorBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, colors, gl.STATIC_DRAW);
+
+ // Reset the divisor of the default VAO to 0
+ ext.vertexAttribDivisorANGLE(colorLoc, 0);
+
+ // Set up VAO with an attrib divisor
+ var vao1 = vaoext.createVertexArrayOES();
+ vaoext.bindVertexArrayOES(vao1);
+ {
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.enableVertexAttribArray(positionLoc);
+ gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.enableVertexAttribArray(colorLoc);
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+ ext.vertexAttribDivisorANGLE(colorLoc, 1);
+
+ gl.vertexAttrib2fv(offsetLoc, [0.0, 0.0]);
+ }
+ vaoext.bindVertexArrayOES(null);
+
+ // Set up VAO with no attrib divisor
+ var vao2 = vaoext.createVertexArrayOES();
+ vaoext.bindVertexArrayOES(vao2);
+ {
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.enableVertexAttribArray(positionLoc);
+ gl.vertexAttribPointer(positionLoc, 2, gl.FLOAT, false, 0, 0);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.enableVertexAttribArray(colorLoc);
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+ // Note that no divisor is set here, which implies that it's 0
+
+ gl.vertexAttrib2fv(offsetLoc, [0.0, 0.0]);
+ }
+ vaoext.bindVertexArrayOES(null);
+
+ debug("");
+ debug("Ensure that Vertex Array Objects retain attrib divisors");
+
+ vaoext.bindVertexArrayOES(vao1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 12);
+ // If the divisor is properly managed by the VAO a single red quad will be drawn
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "entire canvas should be red");
+
+ vaoext.bindVertexArrayOES(vao2);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 12);
+ // If the divisor is properly managed by the VAO a red and blue quad will be drawn.
+ wtu.checkCanvasRects(gl, [
+ wtu.makeCheckRect(0, 0, canvas.width * 0.5, canvas.height, [255, 0, 0, 255], "left half of canvas should be red", 1),
+ wtu.makeCheckRect(canvas.width * 0.5, 0, canvas.width * 0.5, canvas.height, [0, 0, 255, 255], "right half of canvas should be blue", 1)
+ ]);
+
+ vaoext.bindVertexArrayOES(null);
+}
+
+async function runANGLECorruptionTest()
+{
+ debug("")
+ debug("Testing to ensure that rendering isn't corrupt due to an ANGLE bug");
+ // See: https://code.google.com/p/angleproject/issues/detail?id=467
+
+ setupCanvas();
+
+ var tolerance = 2; // Amount of variance to allow in result pixels - may need to be tweaked higher
+ var instanceCount = 10; // Must be higher than 6
+
+ var offsets = new Float32Array([
+ 0.0, 0.0,
+ 0.2, 0.0,
+ 0.4, 0.0,
+ 0.6, 0.0,
+ 0.8, 0.0,
+ 1.0, 0.0,
+ 1.2, 0.0,
+ 1.4, 0.0,
+ 1.6, 0.0,
+ 1.8, 0.0,
+ ]);
+ var offsetBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, offsetBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, offsets.byteLength * 2, gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, offsets);
+ gl.enableVertexAttribArray(offsetLoc);
+ gl.vertexAttribPointer(offsetLoc, 2, gl.FLOAT, false, 0, 0);
+ ext.vertexAttribDivisorANGLE(offsetLoc, 1);
+
+ var colors = new Float32Array([
+ 1.0, 0.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0, 1.0,
+ 0.0, 1.0, 1.0, 1.0,
+ 0.0, 0.0, 1.0, 1.0,
+ 1.0, 0.0, 1.0, 1.0,
+ 1.0, 0.0, 0.0, 1.0,
+ 1.0, 1.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0, 1.0,
+ 0.0, 1.0, 1.0, 1.0,
+ ]);
+ var colorBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, colors.byteLength * 2, gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, colors);
+ gl.enableVertexAttribArray(colorLoc);
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+ ext.vertexAttribDivisorANGLE(colorLoc, 1);
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.setupUnitQuad(gl, 0);
+
+ const totalIterations = 10;
+ for (let iteration = 0; iteration < totalIterations; ++iteration)
+ {
+ // Update the instanced data buffers outside the accessed range.
+ // This, plus rendering more instances than vertices, triggers the bug.
+ var nullData = new Float32Array(offsets.length);
+ gl.bindBuffer(gl.ARRAY_BUFFER, offsetBuffer);
+ gl.bufferSubData(gl.ARRAY_BUFFER, offsets.byteLength, nullData);
+
+ nullData = new Float32Array(colors.length);
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferSubData(gl.ARRAY_BUFFER, colors.byteLength, nullData);
+
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 6, instanceCount);
+
+ // Make sure each color was drawn correctly
+ var i;
+ var passed = true;
+ for (i = 0; i < instanceCount; ++i) {
+ var w = canvas.width / instanceCount;
+ var x = w * i;
+ var color = [colors[(i*4)] * 255, colors[(i*4)+1] * 255, colors[(i*4)+2] * 255, 255]
+
+ wtu.checkCanvasRectColor(
+ gl, x, 0, w, canvas.height, color, tolerance,
+ function() {},
+ function() {
+ passed = false;
+ }, debug);
+ }
+
+ if (passed) {
+ testPassed("Passed test " + iteration + " of " + totalIterations);
+ } else {
+ testFailed("Failed test " + iteration + " of " + totalIterations);
+ break;
+ }
+ await wait();
+ }
+ ext.vertexAttribDivisorANGLE(offsetLoc, 0);
+ ext.vertexAttribDivisorANGLE(colorLoc, 0);
+}
+
+async function runDrawTests(testFn) {
+ function drawArrays(gl) {
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+
+ function drawElements(gl) {
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ }
+
+ function drawArraysInstancedANGLE(gl) {
+ const ext = gl.getExtension('ANGLE_instanced_arrays');
+ if (!ext) {
+ return true;
+ }
+
+ ext.drawArraysInstancedANGLE(gl.TRIANGLES, 0, 6, 1);
+ }
+
+ function drawElementsInstancedANGLE(gl) {
+ const ext = gl.getExtension('ANGLE_instanced_arrays');
+ if (!ext) {
+ return true;
+ }
+
+ ext.drawElementsInstancedANGLE(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0, 1);
+ }
+
+ await testFn(drawArrays); // sanity check
+ await testFn(drawElements); // sanity check
+
+ await testFn(drawArraysInstancedANGLE);
+ await testFn(drawElementsInstancedANGLE);
+}
+
+async function runCompositingTests() {
+ const compositingTestFn = createCompositingTestFn({
+ webglVersion: 1,
+ shadersFn(gl) {
+ const vs = `\
+ attribute vec4 position;
+ void main() {
+ gl_Position = position;
+ }
+ `;
+ const fs = `\
+ precision mediump float;
+ void main() {
+ gl_FragColor = vec4(1, 0, 0, 1);
+ }
+ `;
+ return [vs, fs];
+ },
+ });
+ await runDrawTests(compositingTestFn);
+}
+
+async function runInvalidAttribTests(gl) {
+ const invalidAttribTestFn = createInvalidAttribTestFn(gl);
+ await runDrawTests(invalidAttribTestFn);
+}
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html
new file mode 100644
index 0000000000..445dcb92d4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-blend-minmax.html
@@ -0,0 +1,225 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_blend_minmax Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders to test output -->
+<script id="outputVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main() {
+ gl_Position = vPosition;
+}
+</script>
+<script id="outputFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 uColor;
+void main() {
+ gl_FragColor = uColor;
+}
+</script>
+
+<script>
+"use strict";
+description("This test verifies the functionality of the EXT_blend_minmax extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+
+// Use the constant directly when we don't have the extension
+var MIN_EXT = 0x8007;
+var MAX_EXT = 0x8008;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ runBlendTestDisabled();
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "EXT_blend_minmax");
+ if (!ext) {
+ testPassed("No EXT_blend_minmax support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ debug("");
+ testPassed("Successfully enabled EXT_blend_minmax extension");
+
+ runSupportedTest(true);
+
+ runBlendTestEnabled();
+ runOutputTests();
+ runUniqueObjectTest();
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("EXT_blend_minmax") >= 0) {
+ if (extensionEnabled) {
+ testPassed("EXT_blend_minmax listed as supported and getExtension succeeded");
+ } else {
+ testFailed("EXT_blend_minmax listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("EXT_blend_minmax not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("EXT_blend_minmax not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runBlendTestDisabled() {
+ debug("");
+ debug("Testing blending enums with extension disabled");
+
+ // Set the blend equation to a known-good enum first
+ gl.blendEquation(gl.FUNC_ADD);
+
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.blendEquation(MIN_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION)", "gl.FUNC_ADD");
+
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.blendEquation(MAX_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION)", "gl.FUNC_ADD");
+
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.blendEquationSeparate(MIN_EXT, gl.FUNC_ADD)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_RGB)", "gl.FUNC_ADD");
+
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.blendEquationSeparate(gl.FUNC_ADD, MIN_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_ALPHA)", "gl.FUNC_ADD");
+
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.blendEquationSeparate(MAX_EXT, gl.FUNC_ADD)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_RGB)", "gl.FUNC_ADD");
+
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.blendEquationSeparate(gl.FUNC_ADD, MAX_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_ALPHA)", "gl.FUNC_ADD");
+}
+
+function runBlendTestEnabled() {
+ debug("");
+ debug("Testing blending enums with extension enabled");
+
+ shouldBe("ext.MIN_EXT", "0x8007");
+ shouldBe("ext.MAX_EXT", "0x8008");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendEquation(ext.MIN_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION)", "ext.MIN_EXT");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendEquation(ext.MAX_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION)", "ext.MAX_EXT");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendEquationSeparate(ext.MIN_EXT, gl.FUNC_ADD)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_RGB)", "ext.MIN_EXT");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_ALPHA)", "gl.FUNC_ADD");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendEquationSeparate(gl.FUNC_ADD, ext.MIN_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_RGB)", "gl.FUNC_ADD");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_ALPHA)", "ext.MIN_EXT");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendEquationSeparate(ext.MAX_EXT, gl.FUNC_ADD)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_RGB)", "ext.MAX_EXT");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_ALPHA)", "gl.FUNC_ADD");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.blendEquationSeparate(gl.FUNC_ADD, ext.MAX_EXT)");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_RGB)", "gl.FUNC_ADD");
+ shouldBe("gl.getParameter(gl.BLEND_EQUATION_ALPHA)", "ext.MAX_EXT");
+}
+
+function runOutputTests() {
+ var e = 2; // Amount of variance to allow in result pixels - may need to be tweaked higher
+
+ debug("");
+ debug("Testing various draws for valid blending behavior");
+
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.ONE, gl.ONE);
+
+ var program = wtu.setupProgram(gl, ["outputVertexShader", "outputFragmentShader"], ['vPosition'], [0]);
+ var quadParameters = wtu.setupUnitQuad(gl, 0, 1);
+ var colorUniform = gl.getUniformLocation(program, "uColor");
+
+
+ // Draw 1
+ gl.blendEquation(ext.MIN_EXT);
+
+ gl.clearColor(0.2, 0.4, 0.6, 0.8);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.uniform4f(colorUniform, 0.8, 0.6, 0.4, 0.2);
+ wtu.drawUnitQuad(gl);
+
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [51, 102, 102, 51]);
+
+ // Draw 2:
+ gl.blendEquation(ext.MAX_EXT);
+
+ gl.clearColor(0.2, 0.4, 0.6, 0.8);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.uniform4f(colorUniform, 0.8, 0.6, 0.4, 0.2);
+ wtu.drawUnitQuad(gl);
+
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [204, 153, 153, 204]);
+
+ // Draw 3
+ gl.blendEquationSeparate(ext.MIN_EXT, ext.MAX_EXT);
+
+ gl.clearColor(0.2, 0.4, 0.6, 0.8);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.uniform4f(colorUniform, 0.8, 0.6, 0.4, 0.2);
+ wtu.drawUnitQuad(gl);
+
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [51, 102, 102, 204]);
+
+ // Draw 4
+ gl.blendEquationSeparate(ext.MAX_EXT, ext.MIN_EXT);
+
+ gl.clearColor(0.2, 0.4, 0.6, 0.8);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.uniform4f(colorUniform, 0.8, 0.6, 0.4, 0.2);
+ wtu.drawUnitQuad(gl);
+
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [204, 153, 153, 51]);
+}
+
+function runUniqueObjectTest()
+{
+ debug("");
+ debug("Testing that getExtension() returns the same object each time");
+ ext = null;
+ gl.getExtension("EXT_blend_minmax").myProperty = 2;
+ webglHarnessCollectGarbage();
+ shouldBe('gl.getExtension("EXT_blend_minmax").myProperty', '2');
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-color-buffer-half-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-color-buffer-half-float.html
new file mode 100644
index 0000000000..752fe98e45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-color-buffer-half-float.html
@@ -0,0 +1,27 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_color_buffer_half_float Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head> 
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<script>
+var version = 1;
+</script>
+<script src="../../js/tests/ext-color-buffer-half-float.js"></script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html
new file mode 100644
index 0000000000..1fc29cc445
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-disjoint-timer-query.html
@@ -0,0 +1,312 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_disjoint_timer_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>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("This test verifies the functionality of the EXT_disjoint_timer_query extension, if it is available.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+var query = null;
+var query2 = null;
+var elapsed_query = null;
+var timestamp_query1 = null;
+var timestamp_query2 = null;
+var availability_retry = 500;
+var timestamp_counter_bits = 0;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+ finishTest();
+} else {
+ testPassed("WebGL context exists");
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "EXT_disjoint_timer_query");
+ if (!ext) {
+ testPassed("No EXT_disjoint_timer_query support -- this is legal");
+ finishTest();
+ } else {
+ if (wtu.getDefault3DContextVersion() > 1) {
+ testFailed("EXT_disjoint_timer_query must not be advertised on WebGL 2.0 contexts");
+ finishTest();
+ } else {
+ runSanityTests();
+
+ // Clear disjoint value.
+ gl.getParameter(ext.GPU_DISJOINT_EXT);
+
+ runElapsedTimeTest();
+ timestamp_counter_bits = ext.getQueryEXT(ext.TIMESTAMP_EXT, ext.QUERY_COUNTER_BITS_EXT);
+ if (timestamp_counter_bits > 0) {
+ runTimeStampTest();
+ }
+ verifyQueryResultsNotAvailable();
+
+ window.requestAnimationFrame(checkQueryResults);
+ }
+ }
+}
+
+function runSanityTests() {
+ debug("");
+ debug("Testing timer query expectations");
+
+ shouldBe("ext.QUERY_COUNTER_BITS_EXT", "0x8864");
+ shouldBe("ext.CURRENT_QUERY_EXT", "0x8865");
+ shouldBe("ext.QUERY_RESULT_EXT", "0x8866");
+ shouldBe("ext.QUERY_RESULT_AVAILABLE_EXT", "0x8867");
+ shouldBe("ext.TIME_ELAPSED_EXT", "0x88BF");
+ shouldBe("ext.TIMESTAMP_EXT", "0x8E28");
+ shouldBe("ext.GPU_DISJOINT_EXT", "0x8FBB");
+
+ shouldBe("ext.isQueryEXT(null)", "false");
+
+ shouldBeTrue("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT) === null");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeTrue("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.QUERY_COUNTER_BITS_EXT) >= 30");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ shouldBeTrue("ext.getQueryEXT(ext.TIMESTAMP_EXT, ext.CURRENT_QUERY_EXT) === null");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ // Certain drivers set timestamp counter bits to 0 as they don't support timestamps
+ shouldBeTrue("ext.getQueryEXT(ext.TIMESTAMP_EXT, ext.QUERY_COUNTER_BITS_EXT) >= 30 || " +
+ "ext.getQueryEXT(ext.TIMESTAMP_EXT, ext.QUERY_COUNTER_BITS_EXT) === 0");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("");
+ debug("Testing time elapsed query lifecycle");
+ query = ext.createQueryEXT();
+ shouldBe("ext.isQueryEXT(query)", "false");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Query creation must succeed.");
+ shouldThrow("ext.beginQueryEXT(ext.TIMESTAMP_EXT, null)");
+ ext.beginQueryEXT(ext.TIMESTAMP_EXT, query);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Beginning a timestamp query should fail.");
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
+ shouldBe("ext.isQueryEXT(query)", "true");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Beginning an inactive time elapsed query should succeed.");
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Attempting to begin an active query should fail.");
+ ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Fetching query result availability of an active query should fail.");
+ ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Fetching query result of an active query should fail.");
+ shouldBe("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT)", "query");
+ ext.endQueryEXT(ext.TIME_ELAPSED_EXT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Ending an active time elapsed query should succeed.");
+ shouldThrow("ext.getQueryObjectEXT(null, ext.QUERY_RESULT_AVAILABLE_EXT)");
+ ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Fetching query result availability after query end should succeed.");
+ ext.endQueryEXT(ext.TIME_ELAPSED_EXT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Attempting to end an inactive query should fail.");
+ ext.queryCounterEXT(query, ext.TIMESTAMP_EXT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Should not be able to use time elapsed query to store a timestamp.");
+ ext.deleteQueryEXT(query);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Query deletion must succeed.");
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Beginning a deleted query must fail.");
+ ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Fetching query result availability after query deletion should fail.");
+ shouldBe("ext.isQueryEXT(query)", "false");
+
+ debug("");
+ debug("Testing timestamp counter");
+ query = ext.createQueryEXT();
+ shouldThrow("ext.queryCounterEXT(null, ext.TIMESTAMP_EXT)");
+ ext.queryCounterEXT(query, ext.TIMESTAMP_EXT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Timestamp counter queries should work.");
+ ext.deleteQueryEXT(query);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("");
+ debug("Performing parameter sanity checks");
+ gl.getParameter(ext.TIMESTAMP_EXT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "getParameter timestamp calls should work.");
+ gl.getParameter(ext.GPU_DISJOINT_EXT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "getParameter disjoint calls should work.");
+
+ debug("");
+ debug("Testing current query conditions");
+ query = ext.createQueryEXT();
+ query2 = ext.createQueryEXT();
+ shouldBe("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT)", "null");
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
+ shouldBe("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT)", "query");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("");
+ debug("Testing failed begin query should not change the current query.");
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query2);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Beginning an elapsed query without ending should fail.");
+ shouldBe("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT)", "query");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("");
+ debug("Testing beginning a timestamp query is invalid and should not change the elapsed query.");
+ ext.beginQueryEXT(ext.TIMESTAMP_EXT, query2)
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM);
+ shouldBe("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT)", "query");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("");
+ debug("Testing timestamp queries end immediately so are never current.");
+ ext.queryCounterEXT(query2, ext.TIMESTAMP_EXT);
+ shouldBe("ext.getQueryEXT(ext.TIMESTAMP_EXT, ext.CURRENT_QUERY_EXT)", "null");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("");
+ debug("Testing ending the query should clear the current query.");
+ ext.endQueryEXT(ext.TIME_ELAPSED_EXT);
+ shouldBe("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT)", "null");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("");
+ debug("Testing beginning a elapsed query using a timestamp query should fail and not affect current query.")
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query2);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Switching query targets should fail.");
+ shouldBe("ext.getQueryEXT(ext.TIME_ELAPSED_EXT, ext.CURRENT_QUERY_EXT)", "null");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ ext.deleteQueryEXT(query);
+ ext.deleteQueryEXT(query2);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors at end of sanity tests");
+}
+
+function runElapsedTimeTest() {
+ debug("");
+ debug("Testing elapsed time query");
+
+ elapsed_query = ext.createQueryEXT();
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, elapsed_query);
+ gl.clearColor(0, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ ext.endQueryEXT(ext.TIME_ELAPSED_EXT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Time elapsed query should have no errors");
+}
+
+function runTimeStampTest() {
+ debug("");
+ debug("Testing timestamp query");
+
+ timestamp_query1 = ext.createQueryEXT();
+ timestamp_query2 = ext.createQueryEXT();
+ ext.queryCounterEXT(timestamp_query1, ext.TIMESTAMP_EXT);
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ ext.queryCounterEXT(timestamp_query2, ext.TIMESTAMP_EXT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Timestamp queries should have no errors");
+}
+
+function verifyQueryResultsNotAvailable() {
+ debug("");
+ debug("Verifying queries' results don't become available too early");
+
+ // Verify as best as possible that the implementation doesn't
+ // allow a query's result to become available the same frame, by
+ // spin-looping for some time and ensuring that none of the
+ // queries' results become available.
+ var startTime = Date.now();
+ while (Date.now() - startTime < 2000) {
+ gl.finish();
+ if (ext.getQueryObjectEXT(elapsed_query, ext.QUERY_RESULT_AVAILABLE_EXT)) {
+ testFailed("One of the queries' results became available too early");
+ return;
+ }
+ if (timestamp_counter_bits > 0) {
+ if (ext.getQueryObjectEXT(timestamp_query1, ext.QUERY_RESULT_AVAILABLE_EXT) ||
+ ext.getQueryObjectEXT(timestamp_query2, ext.QUERY_RESULT_AVAILABLE_EXT)) {
+ testFailed("One of the queries' results became available too early");
+ return;
+ }
+ }
+ }
+
+ testPassed("Queries' results didn't become available in a spin loop");
+}
+
+function checkQueryResults() {
+ if (availability_retry > 0) {
+ // Make a reasonable attempt to wait for the queries' results to become available.
+ if (!ext.getQueryObjectEXT(elapsed_query, ext.QUERY_RESULT_AVAILABLE_EXT) ||
+ (timestamp_counter_bits > 0 && !ext.getQueryObjectEXT(timestamp_query2, ext.QUERY_RESULT_AVAILABLE_EXT))) {
+ var error = gl.getError();
+ if (error != gl.NO_ERROR) {
+ testFailed("getQueryObjectEXT should have no errors: " + wtu.glEnumToString(gl, error));
+ debug("");
+ finishTest();
+ return;
+ }
+ availability_retry--;
+ window.requestAnimationFrame(checkQueryResults);
+ return;
+ }
+ }
+
+ debug("");
+ debug("Testing query results");
+
+ // Make sure queries are available.
+ shouldBe("ext.getQueryObjectEXT(elapsed_query, ext.QUERY_RESULT_AVAILABLE_EXT)", "true");
+ if (timestamp_counter_bits > 0) {
+ shouldBe("ext.getQueryObjectEXT(timestamp_query1, ext.QUERY_RESULT_AVAILABLE_EXT)", "true");
+ shouldBe("ext.getQueryObjectEXT(timestamp_query2, ext.QUERY_RESULT_AVAILABLE_EXT)", "true");
+ }
+
+ var disjoint_value = gl.getParameter(ext.GPU_DISJOINT_EXT);
+ if (disjoint_value) {
+ // Cannot validate results make sense, but this is okay.
+ testPassed("Disjoint triggered.");
+ } else {
+ var elapsed_result = ext.getQueryObjectEXT(elapsed_query, ext.QUERY_RESULT_EXT);
+ if (timestamp_counter_bits > 0) {
+ var timestamp_result1 = ext.getQueryObjectEXT(timestamp_query1, ext.QUERY_RESULT_EXT);
+ var timestamp_result2 = ext.getQueryObjectEXT(timestamp_query2, ext.QUERY_RESULT_EXT);
+ }
+ // Do some basic validity checking of the elapsed time query. There's no way it should
+ // take more than about half a second for a no-op query.
+ var halfSecondInNanos = 0.5 * 1000 * 1000 * 1000;
+ if (elapsed_result < 0 || elapsed_result > halfSecondInNanos) {
+ testFailed("Time elapsed query returned invalid data: " + elapsed_result);
+ } else {
+ testPassed("Time elapsed query results were valid.");
+ }
+
+ if (timestamp_counter_bits > 0) {
+ if (timestamp_result1 <= 0 ||
+ timestamp_result2 <= 0 ||
+ timestamp_result2 <= timestamp_result1) {
+ testFailed("Timestamp queries returned invalid data: timestamp_result1 = " +
+ timestamp_result1 + ", timestamp_result2 = " + timestamp_result2);
+ } else {
+ testPassed("Timestamp query results were valid.");
+ }
+ }
+ }
+
+ debug("");
+ finishTest();
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-float-blend.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-float-blend.html
new file mode 100644
index 0000000000..a825d78bef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-float-blend.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_float_blend Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/ext-float-blend.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the EXT_float_blend extension, if it is available.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+
+function extFloatBlendTests(version, config) {
+ debug("");
+ debug("Testing float32 blending without EXT_float_blend");
+ testExtFloatBlend(config.internalFormat);
+ testExtFloatBlendMRT(version, config.drawBuffers);
+ testExtFloatBlendNonFloat32Type(version, config.oesTextureHalfFloat);
+
+ const floatBlend = gl.getExtension("EXT_float_blend");
+ if (!floatBlend) {
+ testPassed("EXT_float_blend is allowed to be missing.");
+ return;
+ }
+
+ debug("");
+ debug("Testing that float32 blending is allowed with EXT_float_blend");
+ testExtFloatBlend(config.internalFormat);
+ testExtFloatBlendMRT(version, config.drawBuffers);
+ testExtFloatBlendNonFloat32Type(version, config.oesTextureHalfFloat);
+}
+
+(function(){
+ if (wtu.getDefault3DContextVersion() < 2) {
+ const oesTextureFloat = gl.getExtension("OES_texture_float");
+ if (!oesTextureFloat) {
+ testPassed("OES_texture_float is allowed to be missing.");
+ return;
+ }
+
+ const colorBufferFloat = gl.getExtension("WEBGL_color_buffer_float");
+ if (!colorBufferFloat) {
+ testPassed("WEBGL_color_buffer_float is allowed to be missing.");
+ return;
+ }
+
+ const drawBuffers = gl.getExtension("WEBGL_draw_buffers");
+ if (!drawBuffers) {
+ debug("WEBGL_draw_buffers is allowed to be missing. MRT tests will be skipped.");
+ }
+
+ const oesTextureHalfFloat = gl.getExtension("OES_texture_half_float");
+ const extColorBufferHalfFloat = gl.getExtension("EXT_color_buffer_half_float");
+ const testHalfFloat = !(!oesTextureHalfFloat || !extColorBufferHalfFloat);
+ if (!testHalfFloat) {
+ debug("OES_texture_half_float or EXT_color_buffer_half_float is allowed to be missing. NonFloat32Type tests will be skipped.");
+ }
+
+ const internalFormat = gl.RGBA;
+ extFloatBlendTests(1, {
+ internalFormat, drawBuffers, oesTextureHalfFloat
+ });
+ } else {
+ const colorBufferFloat = gl.getExtension("EXT_color_buffer_float");
+ if (!colorBufferFloat) {
+ testPassed("EXT_color_buffer_float is allowed to be missing.");
+ return;
+ }
+
+ const internalFormat = gl.RGBA32F;
+ extFloatBlendTests(2, {
+ internalFormat
+ });
+ }
+})();
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+<!--
+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.
+-->
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html
new file mode 100644
index 0000000000..ee2a6df0cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-frag-depth.html
@@ -0,0 +1,289 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_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>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders for testing fragment depth writing -->
+
+<!-- Shader omitting the required #extension pragma -->
+<script id="missingPragmaFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragDepthEXT = 1.0;
+}
+</script>
+
+<!-- Shader to test macro definition -->
+<script id="macroFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+#ifdef GL_EXT_frag_depth
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+#else
+ // Error expected
+ #error no GL_EXT_frag_depth;
+#endif
+}
+</script>
+
+<!-- Shader with required #extension pragma -->
+<script id="testFragmentShader" type="x-shader/x-fragment">
+#extension GL_EXT_frag_depth : enable
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragDepthEXT = 1.0;
+}
+</script>
+<!-- Shaders to link with test fragment shaders -->
+<script id="goodVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main() {
+ gl_Position = vPosition;
+}
+</script>
+<!-- Shaders to test output -->
+<script id="outputVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main() {
+ gl_Position = vPosition;
+}
+</script>
+<script id="outputFragmentShader" type="x-shader/x-fragment">
+#extension GL_EXT_frag_depth : enable
+precision mediump float;
+uniform float uDepth;
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragDepthEXT = uDepth;
+}
+</script>
+
+<script>
+"use strict";
+description("This test verifies the functionality of the EXT_frag_depth extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+
+// Run all tests once.
+runAllTests();
+
+// Run all tests against with a new context to test for any cache issues.
+debug("");
+debug("Testing new context to catch cache errors");
+gl = wtu.create3DContext();
+ext = null;
+runAllTests();
+
+function runAllTests() {
+ if (!gl) {
+ testFailed("WebGL context does not exist");
+ } else {
+ testPassed("WebGL context exists");
+
+ runShaderTests(false);
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "EXT_frag_depth");
+ if (!ext) {
+ testPassed("No EXT_frag_depth support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled EXT_frag_depth extension");
+
+ runSupportedTest(true);
+
+ runShaderTests(true);
+ runOutputTests();
+ runUniqueObjectTest();
+
+ // Run deferred link tests.
+ runDeferredLinkTests();
+ }
+ }
+
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("EXT_frag_depth") >= 0) {
+ if (extensionEnabled) {
+ testPassed("EXT_frag_depth listed as supported and getExtension succeeded");
+ } else {
+ testFailed("EXT_frag_depth listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("EXT_frag_depth not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("EXT_frag_depth not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runShaderTests(extensionEnabled) {
+ debug("");
+ debug("Testing various shader compiles with extension " + (extensionEnabled ? "enabled" : "disabled"));
+
+ // Expect the macro shader to succeed ONLY if enabled
+ var macroFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "macroFragmentShader");
+ if (extensionEnabled) {
+ if (macroFragmentProgram) {
+ // Expected result
+ testPassed("GL_EXT_frag_depth defined in shaders when extension is enabled");
+ } else {
+ testFailed("GL_EXT_frag_depth not defined in shaders when extension is enabled");
+ }
+ } else {
+ if (macroFragmentProgram) {
+ testFailed("GL_EXT_frag_depth defined in shaders when extension is disabled");
+ } else {
+ testPassed("GL_EXT_frag_depth not defined in shaders when extension disabled");
+ }
+ }
+
+ // Always expect the shader missing the #pragma to fail (whether enabled or not)
+ var missingPragmaFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "missingPragmaFragmentShader");
+ if (missingPragmaFragmentProgram) {
+ testFailed("Shader built-ins allowed without #extension pragma");
+ } else {
+ testPassed("Shader built-ins disallowed without #extension pragma");
+ }
+
+ // Try to compile a shader using the built-ins that should only succeed if enabled
+ var testFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "testFragmentShader");
+ if (extensionEnabled) {
+ if (testFragmentProgram) {
+ testPassed("Shader built-ins compiled successfully when extension enabled");
+ } else {
+ testFailed("Shader built-ins failed to compile when extension enabled");
+ }
+ } else {
+ if (testFragmentProgram) {
+ testFailed("Shader built-ins compiled successfully when extension disabled");
+ } else {
+ testPassed("Shader built-ins failed to compile when extension disabled");
+ }
+ }
+}
+
+function runOutputTests() {
+ var e = 2; // Amount of variance to allow in result pixels - may need to be tweaked higher
+
+ debug("Testing various draws for valid built-in function behavior");
+
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+
+ // Enable depth testing with a clearDepth of 0.5
+ // This makes it so that fragments are only rendered when
+ // gl_fragDepthEXT is < 0.5
+ gl.clearDepth(0.5);
+ gl.enable(gl.DEPTH_TEST);
+
+ var positionLoc = 0;
+ var texcoordLoc = 1;
+ var program = wtu.setupProgram(gl, ["outputVertexShader", "outputFragmentShader"], ['vPosition'], [0]);
+ var quadParameters = wtu.setupUnitQuad(gl, 0, 1);
+ var depthUniform = gl.getUniformLocation(program, "uDepth");
+
+ // Draw 1: Greater than clear depth
+ gl.uniform1f(depthUniform, 1.0);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [255, 255, 255, 255]);
+
+ // Draw 2: Less than clear depth
+ gl.uniform1f(depthUniform, 0.0);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [255, 0, 0, 255]);
+}
+
+function runUniqueObjectTest()
+{
+ debug("Testing that getExtension() returns the same object each time");
+ ext = null;
+ gl.getExtension("EXT_frag_depth").myProperty = 2;
+ webglHarnessCollectGarbage();
+ shouldBe('gl.getExtension("EXT_frag_depth").myProperty', '2');
+}
+
+function runDeferredLinkTests() {
+ debug("");
+ debug("Testing deferred shader compilation tests.");
+
+ // Test for compilation failures that are caused by missing extensions
+ // do not succeed if extensions are enabled during linking. This would
+ // only happen for deferred shader compilations.
+
+ // First test if link succeeds with extension enabled.
+ var glEnabled = wtu.create3DContext();
+ var extEnabled = glEnabled.getExtension("EXT_frag_depth");
+ if (!extEnabled) {
+ testFailed("Deferred link test expects the extension to be supported");
+ }
+
+ var vertexShader = wtu.loadShaderFromScript(glEnabled, "goodVertexShader");
+ var fragmentShader = wtu.loadShaderFromScript(glEnabled, "macroFragmentShader");
+
+ if (!vertexShader || !fragmentShader) {
+ testFailed("Could not create good shaders.");
+ return;
+ }
+
+ var program = wtu.setupProgram(glEnabled, [vertexShader, fragmentShader]);
+
+ if (!program) {
+ testFailed("Compilation with extension enabled failed.");
+ return;
+ }
+
+ // Create new context to test link failure without extension enabled.
+ var glDeferred = wtu.create3DContext();
+
+ var vertexShader = wtu.loadShaderFromScript(glDeferred, "goodVertexShader", glDeferred.VERTEX_SHADER, undefined, undefined, true);
+ var fragmentShader = wtu.loadShaderFromScript(glDeferred, "macroFragmentShader", glDeferred.FRAGMENT_SHADER, undefined, undefined, true);
+
+ if (vertexShader == null || fragmentShader == null) {
+ testFailed("Could not create shaders.");
+ return;
+ }
+
+ // Shader compilations should have failed due to extensions not enabled.
+ glDeferred.getExtension("EXT_frag_depth");
+ var program = wtu.setupProgram(glDeferred, [vertexShader, fragmentShader]);
+ if (program) {
+ testFailed("Compilation with extension disabled then linking with extension enabled should have failed.");
+ return;
+ }
+
+ testPassed("Compilation with extension disabled then linking with extension enabled.");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html
new file mode 100644
index 0000000000..7e8353f7f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-sRGB.html
@@ -0,0 +1,468 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8"/>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="16" height="16" style="width: 50px; height: 50px; border: 1px solid black;"></canvas>
+
+<!-- Shaders to test output -->
+<script id="vertexShader" type="x-shader/x-vertex">
+attribute vec4 aPosition;
+void main() {
+ gl_Position = aPosition;
+}
+</script>
+
+<script id="fragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+uniform float uColor;
+void main() {
+ gl_FragColor = vec4(uColor, uColor, uColor, 1);
+}
+</script>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+varying vec2 texCoord;
+void main()
+{
+ gl_FragColor = texture2D(tex, texCoord);
+}
+</script>
+
+<script>
+"use strict";
+
+var wtu = WebGLTestUtils;
+var canvas;
+var gl;
+var ext = null;
+
+var extConstants = {
+ "SRGB_EXT": 0x8C40,
+ "SRGB_ALPHA_EXT": 0x8C42,
+ "SRGB8_ALPHA8_EXT": 0x8C43,
+ "FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT": 0x8210
+};
+
+function getExtension() {
+ ext = gl.getExtension("EXT_sRGB");
+}
+
+function listsExtension() {
+ var supported = gl.getSupportedExtensions();
+ return (supported.indexOf("EXT_sRGB") >= 0);
+}
+
+function toVec3String(val) {
+ if (typeof(val) == 'number') {
+ return toVec3String([val, val, val]);
+ }
+ return '[' + val[0] + ', ' + val[1] + ', ' + val[2] + ']';
+}
+
+var e = 2; // Amount of variance to allow in result pixels - may need to be tweaked higher
+
+function expectResult(target) {
+ wtu.checkCanvasRect(gl,
+ Math.floor(gl.drawingBufferWidth / 2),
+ Math.floor(gl.drawingBufferHeight / 2),
+ 1,
+ 1,
+ [target, target, target, 255],
+ undefined,
+ e);
+}
+
+function createGreysRGBTexture(gl, color, format) {
+ var numPixels = gl.drawingBufferWidth * gl.drawingBufferHeight;
+ var elements;
+ switch (format) {
+ case ext.SRGB_EXT: elements = 3; break;
+ case ext.SRGB_ALPHA_EXT: elements = 4; break;
+ default: return null;
+ }
+
+ var size = numPixels * elements;
+ var buf = new Uint8Array(size);
+ for (var ii = 0; ii < numPixels; ++ii) {
+ var off = ii * elements;
+ buf[off + 0] = color;
+ buf[off + 1] = color;
+ buf[off + 2] = color;
+ if (format == ext.SRGB_ALPHA_EXT) {
+ buf[off + 3] = 255;
+ }
+ }
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D,
+ 0,
+ format,
+ gl.drawingBufferWidth,
+ gl.drawingBufferHeight,
+ 0,
+ format,
+ gl.UNSIGNED_BYTE,
+ buf);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_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);
+ return tex;
+}
+
+function testValidFormat(fn, internalFormat, formatName, enabled) {
+ if (enabled) {
+ fn(internalFormat);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "was able to create type " + formatName);
+ } else {
+ testInvalidFormat(fn, internalFormat, formatName, enabled);
+ }
+}
+
+function testInvalidFormat(fn, internalFormat, formatName, enabled) {
+ fn(internalFormat);
+ var err = gl.getError();
+ if (err == gl.NO_ERROR) {
+ testFailed("should NOT be able to create type " + formatName);
+ } else if (err == gl.INVALID_ENUM || err == gl.INVALID_VALUE) {
+ testPassed("not able to create invalid format: " + formatName);
+ }
+}
+
+var textureFormatFixture = {
+ desc: "Checking texture formats",
+ create: function(format) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D,
+ 0, // level
+ format, // internalFormat
+ gl.drawingBufferWidth, // width
+ gl.drawingBufferHeight, // height
+ 0, // border
+ format, // format
+ gl.UNSIGNED_BYTE, // type
+ null); // data
+ },
+ tests: [
+ {
+ desc: "Checking valid formats",
+ fn: testValidFormat,
+ formats: [ 'SRGB_EXT', 'SRGB_ALPHA_EXT' ]
+ },
+ {
+ desc: "Checking invalid formats",
+ fn: testInvalidFormat,
+ formats: [ 'SRGB8_ALPHA8_EXT' ]
+ }
+ ]
+};
+
+var renderbufferFormatFixture = {
+ desc: "Checking renderbuffer formats",
+ create: function(format) {
+ var rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.renderbufferStorage(gl.RENDERBUFFER,
+ format,
+ gl.drawingBufferWidth,
+ gl.drawingBufferHeight);
+ },
+ tests: [
+ {
+ desc: "Checking valid formats",
+ fn: testValidFormat,
+ formats: [ 'SRGB8_ALPHA8_EXT' ]
+ },
+ {
+ desc: "Checking invalid formats",
+ fn: testInvalidFormat,
+ formats: [ 'SRGB_EXT', 'SRGB_ALPHA_EXT' ]
+ }
+ ]
+};
+
+
+description("Test sRGB texture support");
+
+debug("");
+debug("Canvas.getContext");
+
+canvas = document.getElementById("canvas");
+gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking sRGB texture support with extension disabled");
+
+ runFormatTest(textureFormatFixture, false);
+ runFormatTest(renderbufferFormatFixture, false);
+
+ debug("");
+ debug("Checking sRGB texture support");
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("EXT_sRGB");
+
+ if (!ext) {
+ testPassed("No EXT_sRGB support -- this is legal");
+
+ runSupportedTest(false);
+ finishTest();
+ } else {
+ testPassed("Successfully enabled EXT_sRGB extension");
+
+ runSupportedTest(true);
+
+ gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
+
+ runConstantsTest();
+ runFormatTest(textureFormatFixture, true);
+ runFormatTest(renderbufferFormatFixture, true);
+ runTextureReadConversionTest();
+ runFramebufferTextureConversionTest(ext.SRGB_EXT);
+ runFramebufferTextureConversionTest(ext.SRGB_ALPHA_EXT);
+ runFramebufferRenderbufferConversionTest();
+ runGenerateMipmapTest();
+ runLoadFromImageTest(function() {
+ finishTest();
+ });
+ }
+}
+
+function runConstantsTest() {
+ debug("");
+ debug("Checking extension constants values");
+
+ for (var constant in extConstants) {
+ if (constant in ext) {
+ if (extConstants[constant] != ext[constant]) {
+ testFailed("Value of " + constant + " should be: " + extConstants[constant] + ", was: " + ext[constant]);
+ } else {
+ testPassed("Value of " + constant + " was expected value: " + extConstants[constant]);
+ }
+ } else {
+ testFailed(constant + " not found in extension object");
+ }
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ if (listsExtension()) {
+ if (extensionEnabled) {
+ testPassed("EXT_sRGB listed as supported and getExtension succeeded");
+ } else {
+ testFailed("EXT_sRGB listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("EXT_sRGB not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("EXT_sRGB not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runFormatTest(fixture, enabled) {
+ debug("");
+ debug(fixture.desc);
+
+ for (var tt = 0; tt < fixture.tests.length; ++tt) {
+ var test = fixture.tests[tt];
+ debug(test.desc);
+
+ for (var ii = 0; ii < test.formats.length; ++ii) {
+ var formatName = test.formats[ii];
+ test.fn(fixture.create, extConstants[formatName], "ext." + formatName, enabled);
+ }
+
+ if (tt != fixture.tests.length - 1)
+ debug("");
+ }
+}
+
+function runTextureReadConversionTest() {
+ debug("");
+ debug("Test the conversion of colors from sRGB to linear on texture read");
+
+ // Draw
+ var conversions = [
+ [ 0, 0 ],
+ [ 63, 13 ],
+ [ 127, 54 ],
+ [ 191, 133 ],
+ [ 255, 255 ]
+ ];
+
+ var program = wtu.setupTexturedQuad(gl);
+ gl.uniform1i(gl.getUniformLocation(program, "tex"), 0);
+
+ for (var ii = 0; ii < conversions.length; ii++) {
+ var tex = createGreysRGBTexture(gl, conversions[ii][0], ext.SRGB_EXT);
+ wtu.drawUnitQuad(gl);
+ expectResult(conversions[ii][1]);
+ }
+}
+
+function runFramebufferTextureConversionTest(format) {
+ var formatString;
+ var validFormat;
+ switch (format) {
+ case ext.SRGB_EXT: formatString = "sRGB"; validFormat = false; break;
+ case ext.SRGB_ALPHA_EXT: formatString = "sRGB_ALPHA"; validFormat = true; break;
+ default: return null;
+ }
+ debug("");
+ debug("Test " + formatString + " framebuffer attachments." + (validFormat ? "" : " (Invalid)"));
+
+ var program = wtu.setupProgram(gl, ['vertexShader', 'fragmentShader'], ['aPosition'], [0]);
+ var tex = createGreysRGBTexture(gl, 0, format);
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)', 'ext.SRGB_EXT');
+
+ if (validFormat) {
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+
+ debug("");
+ debug("Test the conversion of colors from linear to " + formatString + " on framebuffer (texture) write");
+
+ // Draw
+ var conversions = [
+ [ 0, 0 ],
+ [ 13, 63 ],
+ [ 54, 127 ],
+ [ 133, 191 ],
+ [ 255, 255 ]
+ ];
+
+ wtu.setupUnitQuad(gl, 0);
+
+ for (var ii = 0; ii < conversions.length; ii++) {
+ gl.uniform1f(gl.getUniformLocation(program, "uColor"), conversions[ii][0]/255.0);
+ wtu.drawUnitQuad(gl, [0, 0, 0, 0]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ expectResult(conversions[ii][1]);
+ }
+ } else {
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT");
+
+ wtu.setupUnitQuad(gl, 0);
+ gl.uniform1f(gl.getUniformLocation(program, "uColor"), 0.5);
+ wtu.drawUnitQuad(gl, [0, 0, 0, 0]);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
+ }
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+}
+
+function runFramebufferRenderbufferConversionTest() {
+ debug("");
+ debug("Test the conversion of colors from linear to sRGB on framebuffer (renderbuffer) write");
+
+ function createsRGBFramebuffer(gl, width, height) {
+ var rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.renderbufferStorage(gl.RENDERBUFFER, ext.SRGB8_ALPHA8_EXT, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.RENDERBUFFER, rbo);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ shouldBe('gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, ext.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT)', 'ext.SRGB_EXT');
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+
+ return fbo;
+ }
+
+ // Draw
+ var conversions = [
+ [ 0, 0 ],
+ [ 13, 63 ],
+ [ 54, 127 ],
+ [ 133, 191 ],
+ [ 255, 255 ]
+ ];
+
+ var program = wtu.setupProgram(gl, ['vertexShader', 'fragmentShader'], ['aPosition'], [0]);
+ wtu.setupUnitQuad(gl, 0);
+ var fbo = createsRGBFramebuffer(gl, gl.drawingBufferWidth, gl.drawingBufferHeight);
+
+ for (var ii = 0; ii < conversions.length; ii++) {
+ gl.uniform1f(gl.getUniformLocation(program, "uColor"), conversions[ii][0]/255.0);
+ wtu.drawUnitQuad(gl, [0, 0, 0, 0]);
+ expectResult(conversions[ii][1]);
+ }
+}
+
+function runLoadFromImageTest(callback) {
+ debug("");
+ debug("Tests to ensure that SRGB textures can successfully use image elements as their source");
+
+ var img = wtu.makeImage("../../resources/gray-1024x1024.jpg", function() {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.SRGB_EXT, ext.SRGB_EXT, gl.UNSIGNED_BYTE, img);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.SRGB_ALPHA_EXT, ext.SRGB_ALPHA_EXT, gl.UNSIGNED_BYTE, img);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ callback();
+ }, function() {
+ testFailed("Image could not be loaded");
+ callback();
+ });
+}
+
+function runGenerateMipmapTest()
+{
+ debug("");
+ debug("GenerateMipmaps for sRGB textures is forbidden");
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.SRGB_ALPHA_EXT, 2, 2, 0, ext.SRGB_ALPHA_EXT,
+ gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
+
+ gl.deleteTexture(tex);
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html
new file mode 100644
index 0000000000..30176bd590
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-shader-texture-lod.html
@@ -0,0 +1,341 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_shader_texture_lod Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 256px; height: 256px;"> </canvas>
+<canvas id="canvas2" style="width: 256px; height: 256px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders for testing texture LOD functions -->
+
+<!-- Shader omitting the required #extension pragma -->
+<script id="missingPragmaFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec2 texCoord0v;
+uniform float lod;
+uniform sampler2D tex;
+void main() {
+ vec4 color = texture2DLodEXT(tex, texCoord0v, lod);
+ gl_FragColor = color;
+}
+</script>
+
+<!-- Shader to test macro definition -->
+<script id="macroFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+#ifdef GL_EXT_shader_texture_lod
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+#else
+ // Error expected
+ #error no GL_EXT_shader_texture_lod;
+#endif
+}
+</script>
+
+<!-- Shader with required #extension pragma -->
+<script id="testFragmentShader" type="x-shader/x-fragment">
+#extension GL_EXT_shader_texture_lod : enable
+precision mediump float;
+varying vec2 texCoord0v;
+uniform float lod;
+uniform sampler2D tex;
+void main() {
+ vec4 color = texture2DLodEXT(tex, texCoord0v, lod);
+ gl_FragColor = color;
+}
+</script>
+
+<!-- Shaders to link with test fragment shaders -->
+<script id="goodVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord0v;
+void main() {
+ texCoord0v = texCoord0;
+ gl_Position = vPosition;
+}
+</script>
+
+<!-- Shaders to test output -->
+<script id="outputVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord0v;
+void main() {
+ texCoord0v = texCoord0;
+ gl_Position = vPosition;
+}
+</script>
+<script id="outputFragmentShader" type="x-shader/x-fragment">
+#extension GL_EXT_shader_texture_lod : require
+precision mediump float;
+varying vec2 texCoord0v;
+uniform float lod;
+uniform sampler2D tex;
+void main() {
+ vec4 color = texture2DLodEXT(tex, texCoord0v, lod);
+ gl_FragColor = color;
+}
+</script>
+
+<script>
+description("This test verifies the functionality of the EXT_shader_texture_lod extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+
+// Run all tests once.
+runAllTests();
+
+// Run all tests against with a new context to test for any cache issues.
+debug("");
+debug("Testing new context to catch cache errors");
+var canvas2 = document.getElementById("canvas2");
+gl = wtu.create3DContext(canvas2);
+ext = null;
+runAllTests();
+
+function runAllTests() {
+ if (!gl) {
+ testFailed("WebGL context does not exist");
+ } else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ runShaderTests(false);
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("EXT_shader_texture_lod");
+ if (!ext) {
+ testPassed("No EXT_shader_texture_lod support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled EXT_shader_texture_lod extension");
+
+ runSupportedTest(true);
+
+ runShaderTests(true);
+ runOutputTests();
+ runUniqueObjectTest();
+ runReferenceCycleTest();
+
+ // Run deferred link tests.
+ runDeferredLinkTests();
+ }
+ }
+
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("EXT_shader_texture_lod") >= 0) {
+ if (extensionEnabled) {
+ testPassed("EXT_shader_texture_lod listed as supported and getExtension succeeded");
+ } else {
+ testFailed("EXT_shader_texture_lod listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("EXT_shader_texture_lod not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("EXT_shader_texture_lod not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runShaderTests(extensionEnabled) {
+ debug("");
+ debug("Testing various shader compiles with extension " + (extensionEnabled ? "enabled" : "disabled"));
+
+ // Expect the macro shader to succeed ONLY if enabled
+ var macroFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "macroFragmentShader");
+ if (extensionEnabled) {
+ if (macroFragmentProgram) {
+ // Expected result
+ testPassed("GL_EXT_shader_texture_lod defined in shaders when extension is enabled");
+ } else {
+ testFailed("GL_EXT_shader_texture_lod not defined in shaders when extension is enabled");
+ }
+ } else {
+ if (macroFragmentProgram) {
+ testFailed("GL_EXT_shader_texture_lod defined in shaders when extension is disabled");
+ } else {
+ testPassed("GL_EXT_shader_texture_lod not defined in shaders when extension disabled");
+ }
+ }
+
+ // Always expect the shader missing the #pragma to fail (whether enabled or not)
+ var missingPragmaFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "missingPragmaFragmentShader");
+ if (missingPragmaFragmentProgram) {
+ testFailed("Shader built-ins allowed without #extension pragma");
+ } else {
+ testPassed("Shader built-ins disallowed without #extension pragma");
+ }
+
+ // Try to compile a shader using the built-ins that should only succeed if enabled
+ var testFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "testFragmentShader");
+ if (extensionEnabled) {
+ if (testFragmentProgram) {
+ testPassed("Shader built-ins compiled successfully when extension enabled");
+ } else {
+ testFailed("Shader built-ins failed to compile when extension enabled");
+ }
+ } else {
+ if (testFragmentProgram) {
+ testFailed("Shader built-ins compiled successfully when extension disabled");
+ } else {
+ testPassed("Shader built-ins failed to compile when extension disabled");
+ }
+ }
+}
+
+function runOutputTests() {
+ debug("");
+ debug("Testing various draws for valid built-in function behavior");
+ gl.viewport(0, 0, canvas.width, canvas.height);
+
+ var program = wtu.setupProgram(gl, ["outputVertexShader", "outputFragmentShader"], ['vPosition', 'texCoord0'], [0, 1]);
+ var quadParameters = wtu.setupUnitQuad(gl, 0, 1);
+
+ var colors = [
+ {name: 'red', color:[255, 0, 0, 255]},
+ {name: 'green', color:[0, 255, 0, 255]},
+ {name: 'blue', color:[0, 0, 255, 255]},
+ {name: 'yellow', color:[255, 255, 0, 255]},
+ {name: 'magenta', color:[255, 0, 255, 255]},
+ {name: 'cyan', color:[0, 255, 255, 255]},
+ {name: 'pink', color:[255, 128, 128, 255]},
+ {name: 'gray', color:[128, 128, 128, 255]},
+ {name: 'light green', color:[128, 255, 128, 255]},
+ ];
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+ for (var ii = 0; ii < colors.length; ++ii) {
+ var color = colors[ii];
+ var size = Math.pow(2, colors.length - ii - 1);
+ wtu.fillTexture(gl, tex, size, size, color.color, ii);
+ }
+
+ var loc = gl.getUniformLocation(program, "lod");
+
+ for (var ii = 0; ii < colors.length; ++ii) {
+ gl.uniform1f(loc, ii);
+ var color = colors[ii];
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, color.color,
+ "256x256 texture drawn to 256x256 dest with lod = " + ii +
+ " should be " + color.name);
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+}
+
+function runUniqueObjectTest()
+{
+ debug("");
+ debug("Testing that getExtension() returns the same object each time");
+ ext = null;
+ gl.getExtension("EXT_shader_texture_lod").myProperty = 2;
+ webglHarnessCollectGarbage();
+ shouldBe('gl.getExtension("EXT_shader_texture_lod").myProperty', '2');
+}
+
+function runReferenceCycleTest()
+{
+ // create some reference cycles. The goal is to see if they cause leaks. The point is that
+ // some browser test runners have instrumentation to detect leaked refcounted objects.
+ debug("");
+ debug("Testing reference cycles between context and extension objects");
+ var ext = gl.getExtension("EXT_shader_texture_lod");
+
+ // create cycle between extension and context, since the context has to hold a reference to the extension
+ ext.context = gl;
+
+ // create a self-cycle on the extension object
+ ext.ext = ext;
+}
+
+function runDeferredLinkTests() {
+ debug("");
+ debug("Testing deferred shader compilation tests.");
+
+ // Test for compilation failures that are caused by missing extensions
+ // do not succeed if extensions are enabled during linking. This would
+ // only happen for deferred shader compilations.
+
+ // First test if link succeeds with extension enabled.
+ var glEnabled = wtu.create3DContext();
+ var extEnabled = glEnabled.getExtension("EXT_shader_texture_lod");
+ if (!extEnabled) {
+ testFailed("Deferred link test expects the extension to be supported");
+ }
+
+ var vertexShader = wtu.loadShaderFromScript(glEnabled, "goodVertexShader");
+ var fragmentShader = wtu.loadShaderFromScript(glEnabled, "macroFragmentShader");
+
+ if (!vertexShader || !fragmentShader) {
+ testFailed("Could not create good shaders.");
+ return;
+ }
+
+ var program = wtu.setupProgram(glEnabled, [vertexShader, fragmentShader]);
+
+ if (!program) {
+ testFailed("Compilation with extension enabled failed.");
+ return;
+ }
+
+ // Create new context to test link failure without extension enabled.
+ var glDeferred = wtu.create3DContext();
+
+ var vertexShader = wtu.loadShaderFromScript(glDeferred, "goodVertexShader", glDeferred.VERTEX_SHADER, undefined, undefined, true);
+ var fragmentShader = wtu.loadShaderFromScript(glDeferred, "macroFragmentShader", glDeferred.FRAGMENT_SHADER, undefined, undefined, true);
+
+ if (vertexShader == null || fragmentShader == null) {
+ testFailed("Could not create shaders.");
+ return;
+ }
+
+ // Shader compilations should have failed due to extensions not enabled.
+ glDeferred.getExtension("EXT_shader_texture_lod");
+ var program = wtu.setupProgram(glDeferred, [vertexShader, fragmentShader]);
+ if (program) {
+ testFailed("Compilation with extension disabled then linking with extension enabled should have failed.");
+ return;
+ }
+
+ testPassed("Compilation with extension disabled then linking with extension enabled.");
+}
+
+debug("");
+successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-bptc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-bptc.html
new file mode 100644
index 0000000000..5b6c10f044
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-bptc.html
@@ -0,0 +1,159 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_texture_compression_bptc Conformance Tests</title>
+<LINK rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compressed-texture-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the EXT_texture_compression_bptc extension, if it is available.");
+
+debug("");
+
+var validFormats = {
+ COMPRESSED_RGBA_BPTC_UNORM_EXT: 0x8E8C,
+ COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: 0x8E8D,
+ COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: 0x8E8E,
+ COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: 0x8E8F
+};
+
+function expectedByteLength(width, height, format) {
+ return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;
+}
+
+function getBlockDimensions(format) {
+ return {width: 4, height: 4};
+}
+
+var wtu = WebGLTestUtils;
+var ctu = CompressedTextureUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var gl = wtu.create3DContext();
+var ext;
+
+var formats = null;
+
+function runTestExtension() {
+ // Test that enum values are listed correctly in supported formats and in the extension object.
+ ctu.testCompressedFormatsListed(gl, validFormats);
+ ctu.testCorrectEnumValuesInExt(ext, validFormats);
+ // Test that texture upload buffer size is validated correctly.
+ ctu.testFormatRestrictionsOnBufferSize(gl, validFormats, expectedByteLength, getBlockDimensions);
+ // Test TexSubImage validation on dimensions
+ // CompressedTexSubImage* will result in an
+ // INVALID_OPERATION error only if one of the following conditions occurs:
+ // * <width> is not a multiple of four, and <width> plus <xoffset> is not
+ // equal to TEXTURE_WIDTH;
+ // * <height> is not a multiple of four, and <height> plus <yoffset> is
+ // not equal to TEXTURE_HEIGHT; or
+ // * <xoffset> or <yoffset> is not a multiple of four.
+ ctu.testTexSubImageDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ 16, 16, [
+ { xoffset: 0, yoffset: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "height is not a multiple of 4" },
+ { xoffset: 0, yoffset: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "width is not a multiple of 4" },
+ { xoffset: 1, yoffset: 0, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "xoffset is not a multiple of 4" },
+ { xoffset: 0, yoffset: 1, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "yoffset is not a multiple of 4" },
+ { xoffset: 12, yoffset: 12, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ ]);
+
+ // Test TexImage validation on level dimensions combinations.
+ // When level equals 0, width and height must be a multiple of 4.
+ // When level is larger than 0, this constraint doesn't apply.
+
+ let npotExpectation, npotMessage;
+ if (contextVersion >= 2) {
+ npotExpectation = gl.NO_ERROR;
+ npotMessage = "valid";
+ } else {
+ npotExpectation = gl.INVALID_VALUE;
+ npotMessage = "invalid";
+ }
+
+ ctu.testTexImageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { level: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "level is 0, height is not a multiple of 4" },
+ { level: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "level is 0, width is not a multiple of 4" },
+ { level: 0, width: 2, height: 2,
+ expectation: gl.INVALID_OPERATION, message: "level is 0, width is not a multiple of 4" },
+ { level: 0, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ { level: 1, width: 1, height: 1,
+ expectation: gl.INVALID_OPERATION, message: "implied base mip 2x2 is invalid" },
+ { level: 1, width: 1, height: 2,
+ expectation: gl.INVALID_OPERATION, message: "implied base mip 2x4 is invalid" },
+ { level: 1, width: 2, height: 1,
+ expectation: gl.INVALID_OPERATION, message: "implied base mip 4x2 is invalid" },
+ { level: 1, width: 2, height: 2,
+ expectation: gl.NO_ERROR, message: "implied base mip 4x4 is valid" },
+ { level: 2, width: 1, height: 3,
+ expectation: npotExpectation, message: "implied base mip 4x12 is " + npotMessage },
+ ]);
+
+ // Test that BPTC enums are not accepted by texImage2D
+ {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RGBA_BPTC_UNORM_EXT, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_RGBA_BPTC_UNORM_EXT fails with texImage2D");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT, 4, 4, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT fails with texImage2D");
+
+ if (contextVersion >= 2) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT, 4, 4, 0, gl.RGB, gl.FLOAT, null);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT fails with texImage2D");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT, 4, 4, 0, gl.RGB, gl.FLOAT, null);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT fails with texImage2D");
+ }
+
+ gl.deleteTexture(tex);
+ }
+};
+
+function runTest() {
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ ctu.testCompressedFormatsUnavailableWhenExtensionDisabled(gl, validFormats, expectedByteLength, 4);
+
+ ext = gl.getExtension("EXT_texture_compression_bptc");
+
+ wtu.runExtensionSupportedTest(gl, "EXT_texture_compression_bptc", ext !== null);
+
+ if (ext !== null) {
+ runTestExtension();
+ }
+ }
+}
+
+runTest();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html
new file mode 100644
index 0000000000..70dcf9ba7b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-compression-rgtc.html
@@ -0,0 +1,162 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_texture_compression_rgtc Conformance Tests</title>
+<LINK rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compressed-texture-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the EXT_texture_compression_rgtc extension, if it is available.");
+
+debug("");
+
+var validFormats = {
+ COMPRESSED_RED_RGTC1_EXT: 0x8DBB,
+ COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8DBC,
+ COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8DBD,
+ COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8DBE
+};
+
+function expectedByteLength(width, height, format) {
+ if (format == validFormats.COMPRESSED_RED_RGTC1_EXT || format == validFormats.COMPRESSED_SIGNED_RED_RGTC1_EXT) {
+ return Math.ceil(width / 4) * Math.ceil(height / 4) * 8;
+ }
+ else {
+ return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;
+ }
+}
+
+function getBlockDimensions(format) {
+ return {width: 4, height: 4};
+}
+
+var wtu = WebGLTestUtils;
+var ctu = CompressedTextureUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var gl = wtu.create3DContext();
+var ext;
+
+var formats = null;
+
+function runTestExtension() {
+ // Test that enum values are listed correctly in supported formats and in the extension object.
+ ctu.testCompressedFormatsListed(gl, validFormats);
+ ctu.testCorrectEnumValuesInExt(ext, validFormats);
+ // Test that texture upload buffer size is validated correctly.
+ ctu.testFormatRestrictionsOnBufferSize(gl, validFormats, expectedByteLength, getBlockDimensions);
+ // Test TexSubImage validation on dimensions
+ // CompressedTexSubImage* will result in an
+ // INVALID_OPERATION error only if one of the following conditions occurs:
+ // * <width> is not a multiple of four, and <width> plus <xoffset> is not
+ // equal to TEXTURE_WIDTH;
+ // * <height> is not a multiple of four, and <height> plus <yoffset> is
+ // not equal to TEXTURE_HEIGHT; or
+ // * <xoffset> or <yoffset> is not a multiple of four.
+ ctu.testTexSubImageDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ 16, 16, [
+ { xoffset: 0, yoffset: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "height is not a multiple of 4" },
+ { xoffset: 0, yoffset: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "width is not a multiple of 4" },
+ { xoffset: 1, yoffset: 0, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "xoffset is not a multiple of 4" },
+ { xoffset: 0, yoffset: 1, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "yoffset is not a multiple of 4" },
+ { xoffset: 12, yoffset: 12, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ ]);
+
+ // Test TexImage validation on level dimensions combinations.
+ // When level equals 0, width and height must be a multiple of 4.
+ // When level is larger than 0, this constraint doesn't apply.
+
+ let npotExpectation, npotMessage;
+ if (contextVersion >= 2) {
+ npotExpectation = gl.NO_ERROR;
+ npotMessage = "valid";
+ } else {
+ npotExpectation = gl.INVALID_VALUE;
+ npotMessage = "invalid";
+ }
+
+ ctu.testTexImageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { level: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "level is 0, height is not a multiple of 4" },
+ { level: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "level is 0, width is not a multiple of 4" },
+ { level: 0, width: 2, height: 2,
+ expectation: gl.INVALID_OPERATION, message: "level is 0, width is not a multiple of 4" },
+ { level: 0, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ { level: 1, width: 1, height: 1,
+ expectation: gl.INVALID_OPERATION, message: "implied base mip 2x2 is invalid" },
+ { level: 1, width: 1, height: 2,
+ expectation: gl.INVALID_OPERATION, message: "implied base mip 2x4 is invalid" },
+ { level: 1, width: 2, height: 1,
+ expectation: gl.INVALID_OPERATION, message: "implied base mip 4x2 is invalid" },
+ { level: 1, width: 2, height: 2,
+ expectation: gl.NO_ERROR, message: "implied base mip 4x4 is valid" },
+ { level: 2, width: 1, height: 3,
+ expectation: npotExpectation, message: "implied base mip 4x12 is " + npotMessage },
+ ]);
+
+ // Test that RGTC enums are not accepted by texImage2D
+ if (contextVersion >= 2) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RED_RGTC1_EXT, 4, 4, 0, gl.RED, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_RED_RGTC1_EXT fails with texImage2D");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_SIGNED_RED_RGTC1_EXT, 4, 4, 0, gl.RED, gl.BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_SIGNED_RED_RGTC1_EXT fails with texImage2D");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_RED_GREEN_RGTC2_EXT, 4, 4, 0, gl.RG, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_RED_GREEN_RGTC2_EXT fails with texImage2D");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, ext.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT, 4, 4, 0, gl.RG, gl.BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT fails with texImage2D");
+
+ gl.deleteTexture(tex);
+ }
+};
+
+function runTest() {
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ ctu.testCompressedFormatsUnavailableWhenExtensionDisabled(gl, validFormats, expectedByteLength, 4);
+
+ ext = gl.getExtension("EXT_texture_compression_rgtc");
+
+ wtu.runExtensionSupportedTest(gl, "EXT_texture_compression_rgtc", ext !== null);
+
+ if (ext !== null) {
+ runTestExtension();
+ }
+ }
+}
+
+runTest();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html
new file mode 100644
index 0000000000..1376d3e402
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/ext-texture-filter-anisotropic.html
@@ -0,0 +1,26 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL EXT_texture_filter_anisotropic Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../js/tests/ext-texture-filter-anisotropic.js"></script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html
new file mode 100644
index 0000000000..8d9a9bc6de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/get-extension.html
@@ -0,0 +1,99 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Extension Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<script>
+"use strict";
+
+var pseudoRandom = (function() {
+ var seed = 3;
+ return function() {
+ seed = (seed * 11 + 17) % 25;
+ return seed / 25;
+ };
+})();
+
+var randomizeCase = function(str) {
+ var newChars = [];
+ for (var ii = 0; ii < str.length; ++ii) {
+ var c = str.substr(ii, 1);
+ var m = (pseudoRandom() > 0.5) ? c.toLowerCase() : c.toUpperCase();
+ newChars.push(m);
+ }
+ return newChars.join("");
+};
+
+description();
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+
+var ii;
+
+debug("check every extension advertised can be enabled");
+debug("");
+var extensionNames = gl.getSupportedExtensions();
+var extensionNamesLower = [];
+for (ii = 0; ii < extensionNames.length; ++ii) {
+ extensionNamesLower.push(extensionNames[ii].toLowerCase());
+}
+
+for (ii = 0; ii < extensionNames.length; ++ii) {
+ var originalName = extensionNames[ii];
+ var mixedName = randomizeCase(originalName);
+ var extension = gl.getExtension(mixedName);
+ assertMsg(extension, "able to get " + originalName + " as " + mixedName);
+ if (extension) {
+ var kTestString = "this is a test";
+ var kTestNumber = 123;
+ var kTestFunction = function() { };
+ var kTestObject = { };
+ extension.testStringProperty = kTestString;
+ extension.testNumberProperty = kTestNumber;
+ extension.testFunctionProperty = kTestFunction;
+ extension.testObjectProperty = kTestObject;
+ webglHarnessCollectGarbage();
+ var extension2 = gl.getExtension(originalName);
+ assertMsg(
+ extension === extension2,
+ "calling getExtension twice for the same extension returns the same object");
+ assertMsg(
+ extension2.testStringProperty === kTestString &&
+ extension2.testFunctionProperty === kTestFunction &&
+ extension2.testObjectProperty === kTestObject &&
+ extension2.testNumberProperty === kTestNumber,
+ "object returned by 2nd call to getExtension has same properties");
+
+ var prefixedVariants = wtu.getExtensionPrefixedNames(originalName);
+ for (var jj = 0; jj < prefixedVariants.length; ++jj) {
+ assertMsg(
+ gl.getExtension(prefixedVariants[jj]) === null ||
+ extensionNamesLower.indexOf(prefixedVariants[jj].toLowerCase()) !== -1,
+ "getExtension('" + prefixedVariants[jj] + "') returns an object only if the name is returned by getSupportedExtensions");
+ }
+ }
+ debug("");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html
new file mode 100644
index 0000000000..2915a2d2de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/khr-parallel-shader-compile.html
@@ -0,0 +1,220 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<style>
+.spinner {
+ width: 100px;
+ height: 100px;
+ border: 20px solid transparent;
+ border-top: 20px solid black;
+ border-radius: 100%;
+ text-align: center;
+ padding: 10px;
+}
+@keyframes rotation {
+ from { transorm: rotate(0); }
+ to { transform: rotate(360deg); }
+}
+</style>
+</head>
+<body>
+<div id="description"></div>
+<button onclick='compileShaders()'>The spinners below should not stutter when you click this button.</button>
+<div class="spinner" style="animation: rotation 2s infinite linear;">CSS</div>
+<div class="spinner" id=spinner>JS</div>
+<div id="console"></div>
+<canvas id=canvas></canvas>
+<script>
+"use strict";
+description("Test KHR_parallel_shader_compile");
+
+function spinSpinner() {
+ let degrees = (performance.now() / 1000 / 2 % 1.) * 360;
+ spinner.style.transform = `rotate(${degrees}deg)`;
+ requestAnimationFrame(spinSpinner);
+}
+spinSpinner();
+
+const wtu = WebGLTestUtils;
+
+const gl = wtu.create3DContext();
+const loseContext = wtu.getExtensionWithKnownPrefixes(gl, "WEBGL_lose_context");
+
+let counter = 0;
+const vertexSource = (extra) => `
+void main() {
+ vec4 result = vec4(0.${counter++});
+${extra || ''}
+ gl_Position = result;
+}`;
+const fragmentSource = (extra) => `
+precision highp float;
+void main() {
+ vec4 result = vec4(0.${counter++});
+${extra || ''}
+ gl_FragColor = result;
+}`;
+
+let vs = gl.createShader(gl.VERTEX_SHADER);
+let fs = gl.createShader(gl.FRAGMENT_SHADER);
+let program = gl.createProgram();
+gl.attachShader(program, vs);
+gl.attachShader(program, fs);
+
+const COMPLETION_STATUS_KHR = 0x91B1;
+
+gl.shaderSource(vs, vertexSource());
+gl.compileShader(vs);
+let status = gl.getShaderParameter(vs, COMPLETION_STATUS_KHR);
+if (status !== null) testFailed('Extension disabled, status should be null');
+wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "extension disabled");
+
+gl.shaderSource(fs, fragmentSource());
+gl.compileShader(fs);
+
+gl.linkProgram(program);
+status = gl.getProgramParameter(program, COMPLETION_STATUS_KHR);
+if (status !== null) testFailed('Extension disabled, status should be null');
+wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "extension disabled");
+
+const ext = wtu.getExtensionWithKnownPrefixes(gl, "KHR_parallel_shader_compile");
+
+let successfullyParsed = false;
+
+let extraCode = '';
+
+(async () => {
+
+ if (!ext) {
+ testPassed("No KHR_parallel_shader_compile support -- this is legal");
+ } else {
+ testPassed("Successfully enabled KHR_parallel_shader_compile extension");
+
+ shouldBe("ext.COMPLETION_STATUS_KHR", "0x91B1");
+
+ debug("Checking that status is a boolean.");
+ gl.shaderSource(vs, vertexSource());
+ gl.compileShader(vs);
+ let status = gl.getShaderParameter(vs, COMPLETION_STATUS_KHR);
+ if (status !== true && status !== false) testFailed("status should be a boolean");
+
+ gl.linkProgram(program);
+ status = gl.getProgramParameter(program, COMPLETION_STATUS_KHR);
+ if (status !== true && status !== false) testFailed("status should be a boolean");
+
+ const minimumShaderCompileDurationMs = 500;
+ debug(`Constructing shader that takes > ${minimumShaderCompileDurationMs} ms to compile.`);
+ let measuredCompileDuration = 0;
+ extraCode = '\n if (true) { result += vec4(0.0000001); }';
+ for (let i = 0; measuredCompileDuration < minimumShaderCompileDurationMs; i++) {
+ extraCode += extraCode;
+ extraCode += extraCode;
+ if (i < 4) continue;
+ gl.shaderSource(vs, vertexSource(extraCode));
+ gl.shaderSource(fs, fragmentSource(extraCode));
+ gl.compileShader(vs);
+ gl.compileShader(fs);
+ gl.linkProgram(program);
+ const start = performance.now();
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
+ testFailed(`Shaders failed to compile.
+ program: ${gl.getProgramInfoLog(program)}
+ vs: ${gl.getShaderInfoLog(vs)}
+ fs: ${gl.getShaderInfoLog(fs)}`);
+ break;
+ }
+ measuredCompileDuration = performance.now() - start;
+ }
+
+ debug('');
+ gl.shaderSource(vs, vertexSource(extraCode));
+ gl.shaderSource(fs, fragmentSource(extraCode));
+ gl.compileShader(vs);
+ gl.compileShader(fs);
+ gl.linkProgram(program);
+
+ let start = performance.now();
+ gl.getShaderParameter(fs, COMPLETION_STATUS_KHR);
+ gl.getShaderParameter(vs, COMPLETION_STATUS_KHR);
+ let duration = performance.now() - start;
+ if (duration > 100)
+ testFailed(`Querying shader status should not wait for compilation. Took ${duration} ms`);
+
+ let frames = 0;
+ const maximumTimeToWait = measuredCompileDuration * 4;
+ while (!gl.getProgramParameter(program, COMPLETION_STATUS_KHR)
+ && performance.now() - start < maximumTimeToWait) {
+ frames++;
+ await new Promise(requestAnimationFrame);
+ }
+ duration = performance.now() - start;
+ if (!gl.getProgramParameter(program, COMPLETION_STATUS_KHR)) {
+ testFailed(`Program took longer than ${maximumTimeToWait} ms to compile. Expected: ${measuredCompileDuration} ms, actual: ${duration} ms`);
+ } else if (!gl.getShaderParameter(vs, COMPLETION_STATUS_KHR) || !gl.getShaderParameter(fs, COMPLETION_STATUS_KHR)) {
+ testFailed('Program linked before shaders finished compiling.');
+ } else if (frames <= 6) {
+ testFailed(`Program should have taken many more than 6 frames to compile. Actual value: ${frames} frames, duration ${performance.now() - start} ms.`);
+ } else {
+ console.log(`COMPLETION_STATUS_KHR sucessfully transitioned from false to true in ${frames} frames and ${duration} ms.`);
+ testPassed(`COMPLETION_STATUS_KHR sucessfully transitioned from false to true`);
+ }
+
+
+ debug("Checking that status is true when context is lost.");
+ if (loseContext) {
+ gl.shaderSource(vs, vertexSource(extraCode));
+ gl.shaderSource(fs, fragmentSource(extraCode));
+ gl.compileShader(vs);
+ gl.compileShader(fs);
+ gl.linkProgram(program);
+ loseContext.loseContext();
+ status = gl.getShaderParameter(vs, COMPLETION_STATUS_KHR);
+ if (status !== true) testFailed("shader status should be true when context is lost");
+ status = gl.getProgramParameter(program, COMPLETION_STATUS_KHR);
+ if (status !== true) testFailed("program status should be true when context is lost");
+ loseContext.restoreContext();
+ vs = gl.createShader(gl.VERTEX_SHADER);
+ fs = gl.createShader(gl.FRAGMENT_SHADER);
+ program = gl.createProgram();
+ }
+ }
+ finishTest();
+})();
+
+async function compileShaders() {
+ console.log('Compiling shaders');
+ const gl = canvas.getContext('webgl');
+ const vs = gl.createShader(gl.VERTEX_SHADER);
+ const fs = gl.createShader(gl.FRAGMENT_SHADER);
+ const program = gl.createProgram();
+ gl.getExtension(wtu.getExtensionWithKnownPrefixes(gl, "KHR_parallel_shader_compile"));
+ gl.attachShader(program, vs);
+ gl.attachShader(program, fs);
+ gl.shaderSource(vs, vertexSource(extraCode));
+ gl.shaderSource(fs, fragmentSource(extraCode));
+ gl.compileShader(vs);
+ gl.compileShader(fs);
+ gl.linkProgram(program);
+ while (!gl.getProgramParameter(program, COMPLETION_STATUS_KHR)) {
+ gl.getShaderParameter(vs, COMPLETION_STATUS_KHR);
+ gl.getShaderParameter(fs, COMPLETION_STATUS_KHR);
+ await new Promise(requestAnimationFrame);
+ }
+ gl.getProgramParameter(program, gl.LINK_STATUS);
+ console.log('Compilation finished.');
+}
+
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html
new file mode 100644
index 0000000000..f30acaba28
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-element-index-uint.html
@@ -0,0 +1,428 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL OES_element_index_uint Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+
+<script id="vs" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec4 vColor;
+varying vec4 color;
+void main() {
+ gl_Position = vPosition;
+ color = vColor;
+}
+</script>
+<script id="fs" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+void main() {
+ gl_FragColor = color;
+}
+</script>
+
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the OES_element_index_uint extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = null;
+var ext = null;
+var canvas = null;
+
+// Test both STATIC_DRAW and DYNAMIC_DRAW as a regression test
+// for a bug in ANGLE which has since been fixed.
+for (var ii = 0; ii < 2; ++ii) {
+ canvas = document.createElement("canvas");
+ canvas.width = 50;
+ canvas.height = 50;
+
+ gl = wtu.create3DContext(canvas);
+
+ if (!gl) {
+ testFailed("WebGL context does not exist");
+ } else {
+ testPassed("WebGL context exists");
+
+ var drawType = (ii == 0) ? gl.STATIC_DRAW : gl.DYNAMIC_DRAW;
+ debug("Testing " + ((ii == 0) ? "STATIC_DRAW" : "DYNAMIC_DRAW"));
+
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("OES_element_index_uint");
+ if (!ext) {
+ testPassed("No OES_element_index_uint support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled OES_element_index_uint extension");
+
+ runSupportedTest(true);
+
+ runDrawTests(drawType);
+
+ // These tests are tweaked duplicates of the buffers/index-validation* tests
+ // using unsigned int indices to ensure that behavior remains consistent
+ runIndexValidationTests(drawType);
+ runCopiesIndicesTests(drawType);
+ runResizedBufferTests(drawType);
+ runVerifiesTooManyIndicesTests(drawType);
+ runCrashWithBufferSubDataTests(drawType);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ }
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("OES_element_index_uint") >= 0) {
+ if (extensionEnabled) {
+ testPassed("OES_element_index_uint listed as supported and getExtension succeeded");
+ } else {
+ testFailed("OES_element_index_uint listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("OES_element_index_uint not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("OES_element_index_uint not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runDrawTests(drawType) {
+ debug("Test that draws with unsigned integer indices produce the expected results");
+
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+
+ var program = wtu.setupSimpleColorProgram(gl);
+
+ function setupDraw(s) {
+ // Create a vertex buffer that cannot be fully indexed via shorts
+ var quadArrayLen = 65537 * 3;
+ var quadArray = new Float32Array(quadArrayLen);
+
+ // Leave all but the last 4 values zero-ed out
+ var idx = quadArrayLen - 12;
+
+ // Initialized the last 4 values to a quad
+ quadArray[idx++] = 1.0 * s;
+ quadArray[idx++] = 1.0 * s;
+ quadArray[idx++] = 0.0;
+
+ quadArray[idx++] = -1.0 * s;
+ quadArray[idx++] = 1.0 * s;
+ quadArray[idx++] = 0.0;
+
+ quadArray[idx++] = -1.0 * s;
+ quadArray[idx++] = -1.0 * s;
+ quadArray[idx++] = 0.0;
+
+ quadArray[idx++] = 1.0 * s;
+ quadArray[idx++] = -1.0 * s;
+ quadArray[idx++] = 0.0;
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, quadArray, drawType);
+
+ // Create an unsigned int index buffer that indexes the last 4 vertices
+ var baseIndex = (quadArrayLen / 3) - 4;
+
+ var indexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array([
+ baseIndex + 0,
+ baseIndex + 1,
+ baseIndex + 2,
+ baseIndex + 2,
+ baseIndex + 3,
+ baseIndex + 0]), drawType);
+
+ var opt_positionLocation = 0;
+ gl.enableVertexAttribArray(opt_positionLocation);
+ gl.vertexAttribPointer(opt_positionLocation, 3, gl.FLOAT, false, 0, 0);
+ };
+ function testPixel(blockList, allowList) {
+ function testList(list, expected) {
+ for (var n = 0; n < list.length; n++) {
+ var l = list[n];
+ var x = -Math.floor(l * canvas.width / 2) + canvas.width / 2;
+ var y = -Math.floor(l * canvas.height / 2) + canvas.height / 2;
+ wtu.checkCanvasRect(gl, x, y, 1, 1, [expected, expected, expected],
+ "Draw should pass", 2);
+ }
+ }
+ testList(blockList, 0);
+ testList(allowList, 255);
+ };
+ function verifyDraw(s) {
+ gl.clearColor(1.0, 1.0, 1.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ wtu.setFloatDrawColor(gl, [0.0, 0.0, 0.0, 1.0]);
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_INT, 0);
+
+ var blockList = [];
+ var allowList = [];
+ var points = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0];
+ for (var n = 0; n < points.length; n++) {
+ if (points[n] <= s) {
+ blockList.push(points[n]);
+ } else {
+ allowList.push(points[n]);
+ }
+ }
+ testPixel(blockList, allowList);
+ };
+
+ setupDraw(0.5);
+ verifyDraw(0.5);
+}
+
+function runIndexValidationTests(drawType) {
+ description("Tests that index validation verifies the correct number of indices");
+
+ function sizeInBytes(type) {
+ switch (type) {
+ case gl.BYTE:
+ case gl.UNSIGNED_BYTE:
+ return 1;
+ case gl.SHORT:
+ case gl.UNSIGNED_SHORT:
+ return 2;
+ case gl.INT:
+ case gl.UNSIGNED_INT:
+ case gl.FLOAT:
+ return 4;
+ default:
+ throw "unknown type";
+ }
+ }
+
+ var program = wtu.loadStandardProgram(gl);
+
+ // 3 vertices => 1 triangle, interleaved data
+ var dataComplete = new Float32Array([0, 0, 0, 1,
+ 0, 0, 1,
+ 1, 0, 0, 1,
+ 0, 0, 1,
+ 1, 1, 1, 1,
+ 0, 0, 1]);
+ var dataIncomplete = new Float32Array([0, 0, 0, 1,
+ 0, 0, 1,
+ 1, 0, 0, 1,
+ 0, 0, 1,
+ 1, 1, 1, 1]);
+ var indices = new Uint32Array([0, 1, 2]);
+
+ debug("Testing with valid indices");
+
+ var bufferComplete = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, bufferComplete);
+ gl.bufferData(gl.ARRAY_BUFFER, dataComplete, drawType);
+ var elements = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elements);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, drawType);
+ gl.useProgram(program);
+ var vertexLoc = gl.getAttribLocation(program, "a_vertex");
+ var normalLoc = gl.getAttribLocation(program, "a_normal");
+ gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
+ gl.enableVertexAttribArray(vertexLoc);
+ gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
+ gl.enableVertexAttribArray(normalLoc);
+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ debug("Testing with out-of-range indices");
+
+ var bufferIncomplete = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, bufferIncomplete);
+ gl.bufferData(gl.ARRAY_BUFFER, dataIncomplete, drawType);
+ gl.vertexAttribPointer(vertexLoc, 4, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 0);
+ gl.enableVertexAttribArray(vertexLoc);
+ gl.disableVertexAttribArray(normalLoc);
+ debug("Enable vertices, valid");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ debug("Enable normals, out-of-range");
+ gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
+ gl.enableVertexAttribArray(normalLoc);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ wtu.shouldGenerateGLError(gl, [gl.INVALID_OPERATION, gl.NO_ERROR],
+ 'gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
+
+ debug("Test with enabled attribute that does not belong to current program");
+
+ gl.disableVertexAttribArray(normalLoc);
+ var extraLoc = Math.max(vertexLoc, normalLoc) + 1;
+ gl.enableVertexAttribArray(extraLoc);
+ debug("Enable an extra attribute with null");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
+ debug("Enable an extra attribute with insufficient data buffer");
+ gl.vertexAttribPointer(extraLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), 4 * sizeInBytes(gl.FLOAT));
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
+ debug("Pass large negative index to vertexAttribPointer");
+ gl.vertexAttribPointer(normalLoc, 3, gl.FLOAT, false, 7 * sizeInBytes(gl.FLOAT), -2000000000 * sizeInBytes(gl.FLOAT));
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
+ shouldBeUndefined('gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)');
+}
+
+function runCopiesIndicesTests(drawType) {
+ debug("Test that client data is always copied during bufferData and bufferSubData calls");
+
+ var program = wtu.loadStandardProgram(gl);
+
+ gl.useProgram(program);
+ var vertexObject = gl.createBuffer();
+ gl.enableVertexAttribArray(0);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ // 4 vertices -> 2 triangles
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), drawType);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ var indexObject = gl.createBuffer();
+
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
+ var indices = new Uint32Array([ 10000, 0, 1, 2, 3, 10000 ]);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, drawType);
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
+ var indexValidationError = wtu.shouldGenerateGLError(gl, [gl.INVALID_OPERATION, gl.NO_ERROR],
+ "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
+ indices[0] = 2;
+ indices[5] = 1;
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
+}
+
+function runResizedBufferTests(drawType) {
+ debug("Test that updating the size of a vertex buffer is properly noticed by the WebGL implementation.");
+
+ var program = wtu.setupProgram(gl, ["vs", "fs"], ["vPosition", "vColor"]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after initialization");
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+ [-1,1,0, 1,1,0, -1,-1,0,
+ -1,-1,0, 1,1,0, 1,-1,0]), drawType);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after vertex setup");
+
+ var texCoordObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, texCoordObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+ [0,0, 1,0, 0,1,
+ 0,1, 1,0, 1,1]), drawType);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after texture coord setup");
+
+ // Now resize these buffers because we want to change what we're drawing.
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ -1,1,0, 1,1,0, -1,-1,0, 1,-1,0,
+ -1,1,0, 1,1,0, -1,-1,0, 1,-1,0]), drawType);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after vertex redefinition");
+ gl.bindBuffer(gl.ARRAY_BUFFER, texCoordObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array([
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255]), drawType);
+ gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, false, 0, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after texture coordinate / color redefinition");
+
+ var numQuads = 2;
+ var indices = new Uint32Array(numQuads * 6);
+ for (var ii = 0; ii < numQuads; ++ii) {
+ var offset = ii * 6;
+ var quad = (ii == (numQuads - 1)) ? 4 : 0;
+ indices[offset + 0] = quad + 0;
+ indices[offset + 1] = quad + 1;
+ indices[offset + 2] = quad + 2;
+ indices[offset + 3] = quad + 2;
+ indices[offset + 4] = quad + 1;
+ indices[offset + 5] = quad + 3;
+ }
+ var indexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, drawType);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after setting up indices");
+ gl.drawElements(gl.TRIANGLES, numQuads * 6, gl.UNSIGNED_INT, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after drawing");
+}
+
+function runVerifiesTooManyIndicesTests(drawType) {
+ description("Tests that index validation for drawElements does not examine too many indices");
+
+ var program = wtu.loadStandardProgram(gl);
+
+ gl.useProgram(program);
+ var vertexObject = gl.createBuffer();
+ gl.enableVertexAttribArray(0);
+ gl.disableVertexAttribArray(1);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ // 4 vertices -> 2 triangles
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0,0, 0,1,0, 1,0,0, 1,1,0 ]), drawType);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ var indexObject = gl.createBuffer();
+
+ debug("Test out of range indices")
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexObject);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array([ 10000, 0, 1, 2, 3, 10000 ]), drawType);
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 4)");
+ var indexValidationError = wtu.shouldGenerateGLError(gl, [gl.INVALID_OPERATION, gl.NO_ERROR],
+ "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 0)");
+ wtu.shouldGenerateGLError(gl, indexValidationError, "gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, 8)");
+}
+
+function runCrashWithBufferSubDataTests(drawType) {
+ debug('Verifies that the index validation code which is within bufferSubData does not crash.')
+
+ var elementBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, 256, drawType);
+ var data = new Uint32Array(127);
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 64, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "after attempting to update a buffer outside of the allocated bounds");
+ testPassed("bufferSubData, when buffer object was initialized with null, did not crash");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-fbo-render-mipmap.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-fbo-render-mipmap.html
new file mode 100644
index 0000000000..b560a4c89a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-fbo-render-mipmap.html
@@ -0,0 +1,92 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL OES_fbo_render_mipmap Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="128" height="128"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the OES_fbo_render_mipmap extension, if it is available.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+
+(function(){
+
+ const oesFboRenderMipmap = gl.getExtension("OES_fbo_render_mipmap");
+ if (!oesFboRenderMipmap) {
+ testPassed("OES_fbo_render_mipmap is allowed to be missing.");
+ return;
+ }
+
+ let texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST);
+
+ let colors = [
+ [255, 0, 0, 255],
+ [255, 127, 0, 255],
+ [255, 255, 0, 255],
+ [0, 255, 0, 255],
+ [0, 255, 255, 255],
+ [0, 127, 255, 255],
+ [0, 0, 255, 255],
+ [255, 0, 255, 255],
+ ];
+
+ let fbos = [];
+ let maxLevel = 7;
+ for (let level = 0; level <= maxLevel; level++) {
+ let size = Math.pow(2, maxLevel - level);
+ gl.texImage2D(gl.TEXTURE_2D, level, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ let fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, level);
+ fbos.push(fbo);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Any level of a texture can be attached to a framebuffer object.");
+ }
+
+ for (let level = 0; level <= maxLevel; level++) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbos[level]);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.clearColor(colors[level][0] / 255, colors[level][1] / 255, colors[level][2] / 255, colors[level][3] / 255);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ }
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ let program = wtu.setupTexturedQuad(gl);
+
+ for (let level = 0; level <= maxLevel; level++) {
+ let size = Math.pow(2, maxLevel - level);
+ // We use differrent viewport sizes to affect which miplevel is fetched from the texture.
+ gl.viewport(0, 0, size, size);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, colors[level]);
+ }
+
+})();
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+<!--
+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.
+-->
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html
new file mode 100644
index 0000000000..f6f4de0243
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-standard-derivatives.html
@@ -0,0 +1,444 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL OES_standard_derivatives Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders for testing standard derivatives -->
+
+<!-- Shader omitting the required #extension pragma -->
+<script id="missingPragmaFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec2 texCoord;
+void main() {
+ float dx = dFdx(texCoord.x);
+ float dy = dFdy(texCoord.y);
+ float w = fwidth(texCoord.x);
+ gl_FragColor = vec4(dx, dy, w, 1.0);
+}
+</script>
+
+<!-- Shader to test macro definition -->
+<script id="macroFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+#ifdef GL_OES_standard_derivatives
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+#else
+ // Error expected
+ #error no GL_OES_standard_derivatives;
+#endif
+}
+</script>
+
+<!-- Shader with required #extension pragma -->
+<script id="testFragmentShader" type="x-shader/x-fragment">
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+varying vec2 texCoord;
+void main() {
+ float dx = dFdx(texCoord.x);
+ float dy = dFdy(texCoord.y);
+ float w = fwidth(texCoord.x);
+ gl_FragColor = vec4(dx, dy, w, 1.0);
+}
+</script>
+<!-- Shader with #extension after other code -->
+<script id="testFragmentShaderWithExtensionNotAtTop" type="x-shader/x-fragment">
+precision mediump float;
+varying vec2 texCoord;
+void main() {
+#extension GL_OES_standard_derivatives : enable
+ float dx = dFdx(texCoord.x);
+ float dy = dFdy(texCoord.y);
+ float w = fwidth(texCoord.x);
+ gl_FragColor = vec4(dx, dy, w, 1.0);
+}
+</script>
+<!-- Shaders to link with test fragment shaders -->
+<script id="goodVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec2 texCoord;
+void main() {
+ texCoord = vPosition.xy;
+ gl_Position = vPosition;
+}
+</script>
+<!-- Shaders to test output -->
+<script id="outputVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec4 position;
+void main() {
+ position = vPosition;
+ gl_Position = vPosition;
+}
+</script>
+<script id="outputFragmentShader" type="x-shader/x-fragment">
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+varying vec4 position;
+void main() {
+ float dzdx = dFdx(position.z);
+ float dzdy = dFdy(position.z);
+ float fw = fwidth(position.z);
+ gl_FragColor = vec4(abs(dzdx) * 40.0, abs(dzdy) * 40.0, fw * 40.0, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+description("This test verifies the functionality of the OES_standard_derivatives extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+
+// Run all tests once.
+runAllTests();
+
+// Run all tests against with a new context to test for any cache issues.
+debug("");
+debug("Testing new context to catch cache errors");
+gl = wtu.create3DContext();
+ext = null;
+runAllTests();
+
+function runAllTests() {
+ if (!gl) {
+ testFailed("WebGL context does not exist");
+ } else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ runHintTestDisabled();
+ runShaderTests(false);
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("OES_standard_derivatives");
+ if (!ext) {
+ testPassed("No OES_standard_derivatives support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled OES_standard_derivatives extension");
+
+ runSupportedTest(true);
+
+ runHintTestEnabled();
+ runShaderTests(true);
+ runOutputTests();
+ runUniqueObjectTest();
+
+ // Run deferred link tests.
+ runDeferredLinkTests();
+ }
+ }
+
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("OES_standard_derivatives") >= 0) {
+ if (extensionEnabled) {
+ testPassed("OES_standard_derivatives listed as supported and getExtension succeeded");
+ } else {
+ testFailed("OES_standard_derivatives listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("OES_standard_derivatives not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("OES_standard_derivatives not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runHintTestDisabled() {
+ debug("Testing FRAGMENT_SHADER_DERIVATIVE_HINT_OES with extension disabled");
+
+ // Use the constant directly as we don't have the extension
+ var FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
+
+ gl.getParameter(FRAGMENT_SHADER_DERIVATIVE_HINT_OES);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "FRAGMENT_SHADER_DERIVATIVE_HINT_OES should not be queryable if extension is disabled");
+
+ gl.hint(FRAGMENT_SHADER_DERIVATIVE_HINT_OES, gl.DONT_CARE);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "hint should not accept FRAGMENT_SHADER_DERIVATIVE_HINT_OES if extension is disabled");
+}
+
+function runHintTestEnabled() {
+ debug("Testing FRAGMENT_SHADER_DERIVATIVE_HINT_OES with extension enabled");
+
+ shouldBe("ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES", "0x8B8B");
+
+ gl.getParameter(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "FRAGMENT_SHADER_DERIVATIVE_HINT_OES query should succeed if extension is enabled");
+
+ // Default value is DONT_CARE
+ if (gl.getParameter(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES) == gl.DONT_CARE) {
+ testPassed("Default value of FRAGMENT_SHADER_DERIVATIVE_HINT_OES is DONT_CARE");
+ } else {
+ testFailed("Default value of FRAGMENT_SHADER_DERIVATIVE_HINT_OES is not DONT_CARE");
+ }
+
+ // Ensure that we can set the target
+ gl.hint(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES, gl.DONT_CARE);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "hint should accept FRAGMENT_SHADER_DERIVATIVE_HINT_OES");
+
+ // Test all the hint modes
+ var validModes = ["FASTEST", "NICEST", "DONT_CARE"];
+ var anyFailed = false;
+ for (var n = 0; n < validModes.length; n++) {
+ var mode = validModes[n];
+ gl.hint(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES, gl[mode]);
+ if (gl.getParameter(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES) != gl[mode]) {
+ testFailed("Round-trip of hint()/getParameter() failed on mode " + mode);
+ anyFailed = true;
+ }
+ }
+ if (!anyFailed) {
+ testPassed("Round-trip of hint()/getParameter() with all supported modes");
+ }
+}
+
+function runShaderTests(extensionEnabled) {
+ debug("");
+ debug("Testing various shader compiles with extension " + (extensionEnabled ? "enabled" : "disabled"));
+
+ // Expect the macro shader to succeed ONLY if enabled
+ {
+ const macroFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "macroFragmentShader");
+ if (extensionEnabled) {
+ if (macroFragmentProgram) {
+ // Expected result
+ testPassed("GL_OES_standard_derivatives defined in shaders when extension is enabled");
+ } else {
+ testFailed("GL_OES_standard_derivatives not defined in shaders when extension is enabled");
+ }
+ } else {
+ if (macroFragmentProgram) {
+ testFailed("GL_OES_standard_derivatives defined in shaders when extension is disabled");
+ } else {
+ testPassed("GL_OES_standard_derivatives not defined in shaders when extension disabled");
+ }
+ }
+ }
+
+ // Always expect the shader missing the #pragma to fail (whether enabled or not)
+ {
+ const missingPragmaFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "missingPragmaFragmentShader");
+ if (missingPragmaFragmentProgram) {
+ testFailed("Shader built-ins allowed without #extension pragma");
+ } else {
+ testPassed("Shader built-ins disallowed without #extension pragma");
+ }
+ }
+
+ // Try to compile a shader using the built-ins that should only succeed if enabled
+ {
+ const testFragmentProgram = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "testFragmentShader");
+ if (extensionEnabled) {
+ if (testFragmentProgram) {
+ testPassed("Shader built-ins compiled successfully when extension enabled");
+ } else {
+ testFailed("Shader built-ins failed to compile when extension enabled");
+ }
+ } else {
+ if (testFragmentProgram) {
+ testFailed("Shader built-ins compiled successfully when extension disabled");
+ } else {
+ testPassed("Shader built-ins failed to compile when extension disabled");
+ }
+ }
+ }
+
+ // This tests specifically that #extension directives after other code are
+ // valid, per spec (6.35 GLSL ES #extension directive location).
+ //
+ // This test actually has nothing to do with OES_standard_derivatives, but
+ // is inserted here because this extension is ubiquitous.
+ //
+ // This test is not as strict as the spec - it doesn't require that "the
+ // scope ... is always the whole shader", because implementations (ANGLE
+ // shader translator) do not actually implement this correctly. The test
+ // coverage is intentionally left incomplete - in practice, all WebGL
+ // shaders already work with the current implementation, so there's no
+ // practical reason to update them to match the spec. Conversely, the
+ // currently implemented rules are too complex to formalize in spec.
+ //
+ // Regression test for https://crbug.com/971660 .
+ {
+ const testFragmentProgramWithExtensionNotAtTop = wtu.loadProgramFromScriptExpectError(gl, "goodVertexShader", "testFragmentShaderWithExtensionNotAtTop");
+ if (extensionEnabled) {
+ if (testFragmentProgramWithExtensionNotAtTop) {
+ testPassed("Shader with #extension after non-preprocessor code: compiled successfully when extension enabled");
+ } else {
+ testFailed("Shader with #extension after non-preprocessor code: failed to compile when extension enabled");
+ }
+ }
+ }
+}
+
+function runOutputTests() {
+ // This tests does several draws with various values of z.
+ // The output of the fragment shader is:
+ // [dFdx(z), dFdy(z), fwidth(z), 1.0]
+ // The expected math: (note the conversion to uint8)
+ // canvas.width = canvas.height = 50
+ // dFdx = totalChange.x / canvas.width = 0.5 / 50.0 = 0.01
+ // dFdy = totalChange.y / canvas.height = 0.5 / 50.0 = 0.01
+ // fw = abs(dFdx + dFdy) = 0.01 + 0.01 = 0.02
+ // r = floor(dFdx * 40.0 * 255) = 102
+ // g = floor(dFdy * 40.0 * 255) = 102
+ // b = floor(fw * 40.0 * 255) = 204
+
+ var e = 5; // Amount of variance to allow in result pixels - may need to be tweaked higher
+
+ debug("Testing various draws for valid built-in function behavior");
+
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+ gl.hint(ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES, gl.NICEST);
+
+ var positionLoc = 0;
+ var texcoordLoc = 1;
+ var program = wtu.setupProgram(gl, ["outputVertexShader", "outputFragmentShader"], ['vPosition', 'texCoord0'], [0, 1]);
+ var quadParameters = wtu.setupUnitQuad(gl, positionLoc, texcoordLoc);
+
+ function expectResult(target, message) {
+ var locations = [
+ [ 0.1, 0.1 ],
+ [ 0.9, 0.1 ],
+ [ 0.1, 0.9 ],
+ [ 0.9, 0.9 ],
+ [ 0.5, 0.5 ]
+ ];
+ for (var n = 0; n < locations.length; n++) {
+ var loc = locations[n];
+ var px = Math.floor(loc[0] * canvas.width);
+ var py = Math.floor(loc[1] * canvas.height);
+ wtu.checkCanvasRect(gl, px, py, 1, 1, target, message, 4);
+ }
+ };
+
+ function setupBuffers(tl, tr, bl, br) {
+ gl.bindBuffer(gl.ARRAY_BUFFER, quadParameters[0]);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ 1.0, 1.0, tr,
+ -1.0, 1.0, tl,
+ -1.0, -1.0, bl,
+ 1.0, 1.0, tr,
+ -1.0, -1.0, bl,
+ 1.0, -1.0, br]), gl.STATIC_DRAW);
+ gl.vertexAttribPointer(positionLoc, 3, gl.FLOAT, false, 0, 0);
+ };
+
+ // Draw 1: (no variation)
+ setupBuffers(0.0, 0.0, 0.0, 0.0);
+ wtu.clearAndDrawUnitQuad(gl);
+ expectResult([0, 0, 0, 255],
+ "Draw 1 (no variation) should pass");
+
+ // Draw 2: (variation in x)
+ setupBuffers(1.0, 0.0, 1.0, 0.0);
+ wtu.clearAndDrawUnitQuad(gl);
+ expectResult([204, 0, 204, 255],
+ "Draw 2 (variation in x) should pass");
+
+ // Draw 3: (variation in y)
+ setupBuffers(1.0, 1.0, 0.0, 0.0);
+ wtu.clearAndDrawUnitQuad(gl);
+ expectResult([0, 204, 204, 255],
+ "Draw 3 (variation in y) should pass");
+
+ // Draw 4: (variation in x & y)
+ setupBuffers(1.0, 0.5, 0.5, 0.0);
+ wtu.clearAndDrawUnitQuad(gl);
+ expectResult([102, 102, 204, 255],
+ "Draw 4 (variation in x & y) should pass");
+}
+
+function runUniqueObjectTest()
+{
+ debug("Testing that getExtension() returns the same object each time");
+ ext = null;
+ gl.getExtension("OES_standard_derivatives").myProperty = 2;
+ webglHarnessCollectGarbage();
+ shouldBe('gl.getExtension("OES_standard_derivatives").myProperty', '2');
+}
+
+function runDeferredLinkTests() {
+ debug("");
+ debug("Testing deferred shader compilation tests.");
+
+ // Test for compilation failures that are caused by missing extensions
+ // do not succeed if extensions are enabled during linking. This would
+ // only happen for deferred shader compilations.
+
+ // First test if link succeeds with extension enabled.
+ var glEnabled = wtu.create3DContext();
+ var extEnabled = glEnabled.getExtension("OES_standard_derivatives");
+ if (!extEnabled) {
+ testFailed("Deferred link test expects the extension to be supported");
+ }
+
+ var vertexShader = wtu.loadShaderFromScript(glEnabled, "goodVertexShader");
+ var fragmentShader = wtu.loadShaderFromScript(glEnabled, "macroFragmentShader");
+
+ if (!vertexShader || !fragmentShader) {
+ testFailed("Could not create good shaders.");
+ return;
+ }
+
+ var program = wtu.setupProgram(glEnabled, [vertexShader, fragmentShader]);
+
+ if (!program) {
+ testFailed("Compilation with extension enabled failed.");
+ return;
+ }
+
+ // Create new context to test link failure without extension enabled.
+ var glDeferred = wtu.create3DContext();
+
+ var vertexShader = wtu.loadShaderFromScript(glDeferred, "goodVertexShader", glDeferred.VERTEX_SHADER, undefined, undefined, true);
+ var fragmentShader = wtu.loadShaderFromScript(glDeferred, "macroFragmentShader", glDeferred.FRAGMENT_SHADER, undefined, undefined, true);
+
+ if (vertexShader == null || fragmentShader == null) {
+ testFailed("Could not create shaders.");
+ return;
+ }
+
+ // Shader compilations should have failed due to extensions not enabled.
+ glDeferred.getExtension("OES_standard_derivatives");
+ var program = wtu.setupProgram(glDeferred, [vertexShader, fragmentShader]);
+ if (program) {
+ testFailed("Compilation with extension disabled then linking with extension enabled should have failed.");
+ return;
+ }
+
+ testPassed("Compilation with extension disabled then linking with extension enabled.");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html
new file mode 100644
index 0000000000..2c8f194e82
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-linear.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/oes-texture-float-and-half-float-linear.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+description("Test OES_texture_float_linear, if available.");
+
+const wtu = WebGLTestUtils;
+const gl = wtu.create3DContext();
+
+(function() {
+ if (!wtu.isWebGL2(gl)) {
+ if (!gl.getExtension("OES_texture_float")) {
+ testPassed("No OES_texture_float support -- this is legal");
+ return;
+ }
+ }
+ testTexLinear(gl, "OES_texture_float_linear", "RGBA32F", "FLOAT");
+})();
+
+debug("");
+const successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html
new file mode 100644
index 0000000000..b681083899
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-canvas.html
@@ -0,0 +1,34 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ if (!gl.getExtension("OES_texture_float")) {
+ testPassed("No OES_texture_float support -- this is legal");
+ return false;
+ }
+
+ testPassed("Successfully enabled OES_texture_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "FLOAT", testPrologue, "../../resources/")()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html
new file mode 100644
index 0000000000..74ad8d27db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image-data.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ if (!gl.getExtension("OES_texture_float")) {
+ testPassed("No OES_texture_float support -- this is legal");
+ return false;
+ }
+
+ testPassed("Successfully enabled OES_texture_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "FLOAT", testPrologue, "../../resources/")()'>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="2" height="2"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html
new file mode 100644
index 0000000000..cff19e5d51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-image.html
@@ -0,0 +1,34 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ if (!gl.getExtension("OES_texture_float")) {
+ testPassed("No OES_texture_float support -- this is legal");
+ return false;
+ }
+
+ testPassed("Successfully enabled OES_texture_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "FLOAT", testPrologue, "../../resources/")()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html
new file mode 100644
index 0000000000..3ccbd50f15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float-with-video.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ if (!gl.getExtension("OES_texture_float")) {
+ testPassed("No OES_texture_float support -- this is legal");
+ return false;
+ }
+
+ testPassed("Successfully enabled OES_texture_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "FLOAT", testPrologue, "../../resources/")()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<video width="640" height="228" id="vid" controls muted>
+ <source src="../../resources/red-green.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
+ <source src="../../resources/red-green.webmvp8.webm" type='video/webm; codecs="vp8, vorbis"' />
+ <source src="../../resources/red-green.theora.ogv" type='video/ogg; codecs="theora, vorbis"' />
+</video>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html
new file mode 100644
index 0000000000..a757cb22ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-float.html
@@ -0,0 +1,426 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>OES_texture_float/WEBGL_color_buffer_float</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/ext-float-blend.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders for testing floating-point textures -->
+<script id="testFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+uniform vec4 subtractor;
+varying vec2 texCoord;
+void main()
+{
+ vec4 color = texture2D(tex, texCoord);
+ if (abs(color.r - subtractor.r) +
+ abs(color.g - subtractor.g) +
+ abs(color.b - subtractor.b) +
+ abs(color.a - subtractor.a) < 8.0) {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ } else {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+}
+</script>
+<!-- Shaders for testing floating-point render targets -->
+<script id="positionVertexShader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="floatingPointFragmentShader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(10000.0, 10000.0, 10000.0, 10000.0);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies the functionality of the OES_texture_float and WEBGL_color_buffer_float extensions, if available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ var texturedShaders = [
+ wtu.simpleTextureVertexShader,
+ "testFragmentShader"
+ ];
+ var testProgram =
+ wtu.setupProgram(gl,
+ texturedShaders,
+ ['vPosition', 'texCoord0'],
+ [0, 1]);
+ var quadParameters = wtu.setupUnitQuad(gl, 0, 1);
+
+ // First verify that allocation of floating-point textures fails if
+ // the extension has not been enabled yet.
+ runTextureCreationTest(testProgram, false);
+
+ if (!gl.getExtension("OES_texture_float")) {
+ testPassed("No OES_texture_float support -- this is legal");
+ } else {
+ testPassed("Successfully enabled OES_texture_float extension");
+ // If alpha value is missing from a texture it gets filled to 1 when sampling according to GLES2.0 table 3.12
+ runTextureCreationTest(testProgram, true, gl.RGBA, 4, [10000, 10000, 10000, 10000]);
+ runTextureCreationTest(testProgram, true, gl.RGB, 3, [10000, 10000, 10000, 1]);
+ runTextureCreationTest(testProgram, true, gl.LUMINANCE, 1, [10000, 10000, 10000, 1]);
+ runTextureCreationTest(testProgram, true, gl.ALPHA, 1, [0, 0, 0, 10000]);
+ runTextureCreationTest(testProgram, true, gl.LUMINANCE_ALPHA, 2, [10000, 10000, 10000, 10000]);
+
+ (function() {
+ debug("");
+ var renderable = isRenderable(gl);
+ var renderableExtName = "WEBGL_color_buffer_float";
+ var supported = gl.getSupportedExtensions().includes(renderableExtName);
+ if (renderable && !supported) {
+ testFailed("RGBA/FLOAT is color renderable but " + renderableExtName + " not exposed");
+ } else if (supported && !renderable) {
+ testFailed(renderableExtName + " is exposed but RGBA/FLOAT is not color renderable");
+ }
+ if (supported) {
+ runRenderTargetAndReadbackTest(testProgram, gl.RGBA, 4, [10000, 10000, 10000, 10000], 0, true);
+ runRenderTargetAndReadbackTest(testProgram, gl.RGB, 3, [10000, 10000, 10000, 1], 0, false);
+ runRenderTargetAndReadbackTest(testProgram, gl.RGBA, 4, [10000, 10000, 10000, 10000], 1, true);
+ runRenderTargetAndReadbackTest(testProgram, gl.RGBA, 4, [10000, 10000, 10000, 10000], 0.5, true);
+ runFramebufferTest();
+
+ debug("");
+ debug("Test float32 blending without EXT_float_blend.");
+ testExtFloatBlend(gl.RGBA);
+
+ debug("");
+ debug("Testing that float32 blending succeeds with EXT_float_blend.");
+ if (!gl.getExtension("EXT_float_blend")) {
+ testPassed("No EXT_float_blend support -- this is legal");
+ return;
+ }
+ testExtFloatBlend(gl.RGBA);
+ }
+ })();
+
+ runUniqueObjectTest();
+ }
+}
+
+function isRenderable(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.FLOAT, null);
+
+ var fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+
+ var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.deleteFramebuffer(fb);
+ gl.deleteTexture(tex);
+
+ return status == gl.FRAMEBUFFER_COMPLETE;
+}
+
+function allocateTexture()
+{
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ 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);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "texture parameter setup should succeed");
+ return texture;
+}
+
+function checkRenderingResults()
+{
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+function runTextureCreationTest(testProgram, extensionEnabled, opt_format, opt_numChannels, opt_subtractor)
+{
+ var format = opt_format || gl.RGBA;
+ var numberOfChannels = opt_numChannels || 4;
+ var expectFailure = !extensionEnabled;
+ var subtractor = opt_subtractor || [10000, 10000, 10000, 10000];
+
+ debug("");
+ debug("testing format: " + wtu.glEnumToString(gl, format) +
+ " expect:" + (extensionEnabled ? "success" : "failure"));
+
+ var texture = allocateTexture();
+ // Generate data.
+ var width = 2;
+ var height = 2;
+ var data = new Float32Array(width * height * numberOfChannels);
+ for (var ii = 0; ii < data.length; ++ii) {
+ data[ii] = 10000;
+ }
+ gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, gl.FLOAT, data);
+ if (expectFailure) {
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "floating-point texture allocation must be disallowed if OES_texture_float isn't enabled");
+ return;
+ } else {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "floating-point texture allocation should succeed if OES_texture_float is enabled");
+ }
+ // Verify that the texture actually works for sampling and contains the expected data.
+ gl.uniform4fv(gl.getUniformLocation(testProgram, "subtractor"), subtractor);
+ wtu.clearAndDrawUnitQuad(gl);
+ checkRenderingResults();
+
+ // Check that linear fails.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+}
+
+function arrayToString(arr, size) {
+ var mySize;
+ if (!size)
+ mySize = arr.length;
+ else
+ mySize = size;
+ var out = "[";
+ for (var ii = 0; ii < mySize; ++ii) {
+ if (ii > 0) {
+ out += ", ";
+ }
+ out += arr[ii];
+ }
+ return out + "]";
+}
+
+function runRenderTargetAndReadbackTest(testProgram, format, numberOfChannels, subtractor, texSubImageCover, requireRenderable)
+{
+ var formatString = wtu.glEnumToString(gl, format);
+ debug("");
+ debug("testing floating-point " + formatString + " render target" + (texSubImageCover > 0 ? " after calling texSubImage" : ""));
+
+ var texture = allocateTexture();
+ var width = 2;
+ var height = 2;
+ gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, gl.FLOAT, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "floating-point texture allocation should succeed if OES_texture_float is enabled");
+
+ // Try to use this texture as a render target.
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ // It is legal for a WebGL implementation exposing the OES_texture_float extension to
+ // support floating-point textures but not as attachments to framebuffer objects.
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ if (requireRenderable)
+ testFailed("floating-point " + formatString + " render target not supported");
+ else
+ debug("floating-point " + formatString + " render target not supported -- this is legal");
+ return;
+ }
+
+ if (texSubImageCover > 0) {
+ // Ensure that replacing the whole texture or a part of it with texSubImage2D doesn't affect renderability
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ var data = new Float32Array(width * height * numberOfChannels * texSubImageCover);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height * texSubImageCover, format, gl.FLOAT, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "texSubImage2D should succeed if OES_texture_float is enabled");
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ testFailed("render target support changed after calling texSubImage2D");
+ return;
+ }
+ }
+
+ var renderProgram =
+ wtu.setupProgram(gl,
+ ["positionVertexShader", "floatingPointFragmentShader"],
+ ['vPosition'],
+ [0]);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "rendering to floating-point texture should succeed");
+
+ // Now sample from the floating-point texture and verify we got the correct values.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.useProgram(testProgram);
+ gl.uniform1i(gl.getUniformLocation(testProgram, "tex"), 0);
+ gl.uniform4fv(gl.getUniformLocation(testProgram, "subtractor"), subtractor);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "rendering from floating-point texture should succeed");
+ checkRenderingResults();
+
+ // Finally, if the implementation supports floating-point readback, verify it.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ var implFormat = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT);
+ var implType = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "getParameter of IMPLEMENTATION_COLOR_READ_{FORMAT|TYPE} should succeed");
+ if ((implFormat == gl.RGBA || implFormat == gl.RGB) && implType == gl.FLOAT) {
+ debug("Checking readback of floating-point values");
+ var arraySize = (implFormat == gl.RGBA) ? 4 : 3
+ var buf = new Float32Array(arraySize);
+ gl.readPixels(0, 0, 1, 1, implFormat, implType , buf);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "readPixels from floating-point renderbuffer should succeed");
+ var ok = true;
+ var tolerance = 8.0; // TODO: factor this out from both this test and the subtractor shader above.
+ for (var ii = 0; ii < buf.length; ++ii) {
+ if (Math.abs(buf[ii] - subtractor[ii]) > tolerance) {
+ ok = false;
+ break;
+ }
+ }
+ if (ok) {
+ testPassed("readPixels of float-type data from floating-point renderbuffer succeeded");
+ } else {
+ testFailed("readPixels of float-type data from floating-point renderbuffer failed: expected "
+ + arrayToString(subtractor, arraySize) + ", got " + arrayToString(buf));
+ }
+ }
+}
+
+function runUniqueObjectTest()
+{
+ debug("");
+ debug("Testing that getExtension() returns the same object each time");
+ gl.getExtension("OES_texture_float").myProperty = 2;
+ webglHarnessCollectGarbage();
+ shouldBe('gl.getExtension("OES_texture_float").myProperty', '2');
+}
+
+// Make sure we can call readPixels with the passed in arrayBufferConstructor and that the color
+// channels are the ones we expect. If there is a mismatch between the glType and arrayBuffer type,
+// fail the test.
+function verifyReadPixelsColors(red, green, blue, alpha, alphaRGB, glFormat, glType, arrayBufferConstructor) {
+ var typeName = wtu.glEnumToString(gl, glType);
+
+ debug(wtu.glEnumToString(gl, glFormat) + " framebuffer with " + typeName + " readback.");
+
+ var arrayBuffer = new arrayBufferConstructor(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "readPixels should return NO_ERROR when reading " + typeName + " data.");
+
+ assertMsg(arrayBuffer[0] === red, "Red channel should be " + red + " for " + typeName + " readPixels. Received: " + arrayBuffer[0]);
+ assertMsg(arrayBuffer[1] === green, "Green channel should be " + green + " for " + typeName + " readPixels. Received: " + arrayBuffer[1]);
+ assertMsg(arrayBuffer[2] === blue, "Blue channel should be " + blue + " for " + typeName + " readPixels. Received: " + arrayBuffer[2]);
+ if (glFormat === gl.RGBA) {
+ assertMsg(arrayBuffer[3] === alpha, "Alpha channel should be " + alpha + " for " + typeName + " readPixels. Received: " + arrayBuffer[3]);
+ } else if (glFormat === gl.RGB) {
+ assertMsg(arrayBuffer[3] === alphaRGB, "Alpha channel should be " + alphaRGB + " for " + typeName + " readPixels. Received: " + arrayBuffer[3]);
+ }
+
+ // Make sure any arrayBuffer types that are not equal to arrayBufferConstructor fail readPixels.
+ if (arrayBufferConstructor !== Uint8Array) {
+ arrayBuffer = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "readPixels should return INVALID_OPERATION when reading mismatched types. " + Uint8Array.toString());
+ }
+ if (arrayBufferConstructor !== Float32Array) {
+ arrayBuffer = new Float32Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "readPixels should return INVALID_OPERATION when reading mismatched types. " + Float32Array.toString());
+ }
+ if (arrayBufferConstructor !== Uint16Array) {
+ arrayBuffer = new Uint16Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "readPixels should return INVALID_OPERATION when reading mismatched types. " + Uint16Array.toString());
+ }
+}
+
+// Verify that float textures attached to frame buffers function correctly with regard to framebuffer
+// completness, IMPLEMENTATION_COLOR_READ_FORMAT/TYPE and readPixels
+function runFramebufferTest() {
+ debug("");
+ debug("Framebuffer Tests");
+
+ var texture = allocateTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+
+ debug("Ensure non-color-renderable formats [LUMINANCE, LUMINANCE_ALPHA, ALPHA] fail.");
+ var arrayBufferFloatOutput = new Float32Array(4); // 4 color channels
+ [gl.LUMINANCE, gl.LUMINANCE_ALPHA, gl.ALPHA].forEach(function(badFormat) {
+ debug(wtu.glEnumToString(gl, badFormat) + " framebuffer");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, badFormat, 1, 1, 0, badFormat, gl.FLOAT, null);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT");
+
+ shouldBeNull("gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT)");
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "IMPLEMENTATION_COLOR_READ_FORMAT should fail for incomplete framebuffers.");
+
+ shouldBeNull("gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE)");
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "IMPLEMENTATION_COLOR_READ_TYPE should fail for incomplete framebuffers.");
+
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, arrayBufferFloatOutput);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION , "readPixels should fail on incomplete framebuffers.");
+ debug("");
+ });
+
+ debug("Ensure color renderable formats [RGBA, RGB] succeed.");
+ var arrayBufferFloatInput = new Float32Array(4); // 4 color channels
+ arrayBufferFloatInput[0] = 0;
+ arrayBufferFloatInput[1] = .25;
+ arrayBufferFloatInput[2] = .50;
+ arrayBufferFloatInput[3] = .75;
+
+ [gl.RGBA, gl.RGB].forEach(function(goodFormat) {
+ debug("");
+ debug(wtu.glEnumToString(gl, goodFormat) + " framebuffer tests");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, goodFormat, 1, 1, 0, goodFormat, gl.FLOAT, arrayBufferFloatInput);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ testPassed("Format is not renderable. This is allowed.");
+ return;
+ }
+ verifyReadPixelsColors(
+ 0.00, // red
+ 0.25, // green
+ 0.50, // blue
+ 0.75, // alpha
+ 1.0, // alphaRGB
+ goodFormat,
+ gl.FLOAT,
+ Float32Array);
+
+ var implementationColorReadFormat = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT);
+ assertMsg(implementationColorReadFormat === gl.RGBA || implementationColorReadFormat === gl.RGB,
+ "IMPLEMENTATION_COLOR_READ_FORMAT should be color renderable: RGBA or RGB. Received: " + wtu.glEnumToString(gl, implementationColorReadFormat));
+
+ var implementationColorReadType = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE);
+ assertMsg(implementationColorReadType === gl.UNSIGNED_BYTE ||
+ implementationColorReadType === gl.FLOAT ||
+ "IMPLEMENTATION_COLOR_READ_TYPE must be one of UNSIGNED_BYTE or FLOAT " +
+ "Received: " + wtu.glEnumToString(gl, implementationColorReadType));
+ });
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html
new file mode 100644
index 0000000000..459346857e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-linear.html
@@ -0,0 +1,46 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/oes-texture-float-and-half-float-linear.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+description("Test OES_texture_half_float_linear, if available.");
+
+const wtu = WebGLTestUtils;
+const gl = wtu.create3DContext();
+
+(function() {
+ if (wtu.isWebGL2(gl))
+ throw new Error("OES_texture_half_float_linear is core in WebGL 2.");
+
+ const ext = gl.getExtension("OES_texture_half_float");
+ if (!ext) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return;
+ }
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+ testTexLinear(gl, "OES_texture_half_float_linear", undefined, "HALF_FLOAT_OES");
+})();
+
+debug("");
+const successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html
new file mode 100644
index 0000000000..b991c58b19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-canvas.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ var ext = null;
+
+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return false;
+ }
+
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+ testPassed("Successfully enabled OES_texture_half_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "HALF_FLOAT_OES", testPrologue, "../../resources/")()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html
new file mode 100644
index 0000000000..91f3f97b08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image-data.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ var ext = null;
+
+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return false;
+ }
+
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+ testPassed("Successfully enabled OES_texture_half_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "HALF_FLOAT_OES", testPrologue, "../../resources/")()'>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="2" height="2"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html
new file mode 100644
index 0000000000..3f486eac0e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-image.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ var ext = null;
+
+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return false;
+ }
+
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+ testPassed("Successfully enabled OES_texture_half_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "HALF_FLOAT_OES", testPrologue, "../../resources/")()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html
new file mode 100644
index 0000000000..719b332113
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float-with-video.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+<script>
+"use strict";
+function testPrologue(gl) {
+ var ext = null;
+
+ if (!(ext = gl.getExtension("OES_texture_half_float"))) {
+ testPassed("No OES_texture_half_float support -- this is legal");
+ return false;
+ }
+
+ // Required by the test harness.
+ gl.HALF_FLOAT_OES = ext.HALF_FLOAT_OES;
+
+ testPassed("Successfully enabled OES_texture_half_float extension");
+ return true;
+}
+</script>
+</head>
+<body onload='generateTest("RGBA", "RGBA", "HALF_FLOAT_OES", testPrologue, "../../resources/")()'>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<video width="640" height="228" id="vid" controls muted>
+ <source src="../../resources/red-green.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
+ <source src="../../resources/red-green.webmvp8.webm" type='video/webm; codecs="vp8, vorbis"' />
+ <source src="../../resources/red-green.theora.ogv" type='video/ogg; codecs="theora, vorbis"' />
+</video>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html
new file mode 100644
index 0000000000..4d5d81608a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-texture-half-float.html
@@ -0,0 +1,474 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL OES_texture_half_float Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<canvas id="canvas2d" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<script id="testFragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+uniform vec4 subtractor;
+varying vec2 texCoord;
+void main()
+{
+ vec4 color = texture2D(tex, texCoord);
+ if (abs(color.r - subtractor.r) +
+ abs(color.g - subtractor.g) +
+ abs(color.b - subtractor.b) +
+ abs(color.a - subtractor.a) < 8.0) {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ } else {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+}
+</script>
+<!-- Shaders for testing half-floating-point render targets -->
+<script id="floatingPointFragmentShader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(10000.0, 10000.0, 10000.0, 10000.0);
+}
+</script>
+<script>
+"use strict"
+description("This test verifies the functionality of OES_texture_half_float with null/non-null ArrayBufferView");
+
+debug("");
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var colorCanvas = document.getElementById("canvas2d");
+colorCanvas.width = 2;
+colorCanvas.height = 2;
+var ctx = colorCanvas.getContext("2d");
+ctx.fillStyle = "rgb(255,0,0)";
+ctx.fillRect(0, 0, 2, 2);
+var gl = wtu.create3DContext(canvas);
+// This constant must be defined in order to run the texture creation test without the extension enabled.
+var halfFloatOESEnum = 0x8D61;
+var ext = null;
+
+
+if (!gl) {
+ testFailed("WebGL context does not exists");
+} else {
+ testPassed("WebGL context exists");
+
+ // Verify that allocation of texture fails if extension is not enabled
+ runTextureCreationTest(false);
+ ext = gl.getExtension("OES_texture_half_float")
+ if (!ext) {
+ testPassed("No OES_texture_half_float support. This is legal");
+ } else {
+ testPassed("Successfully enabled OES_texture_half_float extension");
+
+ var program = wtu.setupTexturedQuad(gl);
+
+ // Check if creation of texture succeed's with various formats and null ArrayBufferView
+ var formats = [
+ { format: gl.RGBA, expected: [255, 0, 0, 255], },
+ { format: gl.RGB, expected: [255, 0, 0, 255], },
+ { format: gl.LUMINANCE, expected: [255, 255, 255, 255], },
+ { format: gl.ALPHA, expected: [ 0, 0, 0, 255], },
+ { format: gl.LUMINANCE_ALPHA, expected: [255, 255, 255, 255], },
+ ];
+ formats.forEach(function(f) {
+ runTextureCreationTest(true, f.format, null, f.expected);
+ });
+
+ // Texture creation should fail when passed with non-null, non-Uint16 ArrayBufferView
+ formats.forEach(function(f) {
+ var width = 2;
+ var height = 2;
+ var format = f.format;
+
+ // Float32Array
+ var float32Data = new Float32Array(width * height * getNumberOfChannels(format));
+ for (var ii = 0; ii < float32Data.length; ii++) {
+ float32Data[ii] = 1000;
+ }
+ runTextureCreationTest(true, format, float32Data, null);
+
+ // Int16Array
+ var int16Data = new Int16Array(width * height * getNumberOfChannels(format));
+ for (var ii = 0; ii < int16Data.length; ii++) {
+ int16Data[ii] = 1000;
+ }
+ runTextureCreationTest(true, format, int16Data, null);
+ });
+
+ // Test that Uint16 encoded half float values can be used as texture data.
+
+ // First test that values in the 0-1 range can be written and read.
+ var halfFloatOneThird = 0x3555; // Half float 1/3
+ var uint16Formats = [
+ { format: gl.RGBA, expected: [85, 85, 85, 85], },
+ { format: gl.RGB, expected: [85, 85, 85, 255], },
+ { format: gl.LUMINANCE, expected: [85, 85, 85, 255], },
+ { format: gl.ALPHA, expected: [ 0, 0, 0, 85], },
+ { format: gl.LUMINANCE_ALPHA, expected: [85, 85, 85, 85], },
+ ];
+
+ uint16Formats.forEach(function(f) {
+ var width = 2;
+ var height = 2;
+ var format = f.format;
+
+ var uint16Data = new Uint16Array(width * height * getNumberOfChannels(format));
+ for (var ii = 0; ii < uint16Data.length; ii++) {
+ uint16Data[ii] = halfFloatOneThird;
+ }
+ runTextureCreationTest(true, format, uint16Data, f.expected);
+ });
+
+ // Next check that values outside the 0-1 range can be written.
+ var halfFloatTenK = 0x70E2; // Half float 10000
+ var uint16Formats2 = [
+ { format: gl.RGBA, subtractor: [10000, 10000, 10000, 10000], requireRenderable: true},
+ { format: gl.RGB, subtractor: [10000, 10000, 10000, 1], requireRenderable: false},
+ ];
+
+ uint16Formats2.forEach(function(f) {
+ var width = 2;
+ var height = 2;
+ var format = f.format;
+
+ var uint16Data = new Uint16Array(width * height * getNumberOfChannels(format));
+ for (var ii = 0; ii < uint16Data.length; ii++) {
+ uint16Data[ii] = halfFloatTenK;
+ }
+ runRenderTest(format, f.subtractor, uint16Data, f.requireRenderable);
+ });
+
+ (function() {
+ debug("");
+ var renderable = isRenderable(gl, ext);
+ var renderableExtName = "EXT_color_buffer_half_float";
+ var supported = gl.getSupportedExtensions().includes(renderableExtName);
+ if (renderable && !supported) {
+ testFailed("RGBA/HALF_FLOAT_OES is color renderable but " + renderableExtName + " not exposed");
+ } else if (supported && !renderable) {
+ testFailed(renderableExtName + " is exposed but RGBA/HALF_FLOAT_OES is not color renderable");
+ }
+ if (supported) {
+ runRenderTest(gl.RGBA, [10000, 10000, 10000, 10000], null, true);
+ runRenderTest(gl.RGB, [10000, 10000, 10000, 1], null, false);
+ runFramebufferTest();
+ }
+ })();
+
+ // Check of getExtension() returns same object
+ runUniqueObjectTest();
+ }
+}
+
+function isRenderable(gl, ext) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, ext.HALF_FLOAT_OES, null);
+
+ var fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+
+ var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ gl.deleteFramebuffer(fb);
+ gl.deleteTexture(tex);
+
+ return status == gl.FRAMEBUFFER_COMPLETE;
+}
+
+function getNumberOfChannels(format)
+{
+ if (format == gl.RGBA)
+ return 4;
+ else if (format == gl.RGB)
+ return 3;
+ else if (format == gl.LUMINANCE || format == gl.ALPHA)
+ return 1;
+ else if (format == gl.LUMINANCE_ALPHA)
+ return 2;
+}
+
+function allocateTexture()
+{
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ 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);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "texture parameter setup should succeed");
+ return texture;
+}
+
+function runTextureCreationTest(extensionEnabled, opt_format, opt_data, opt_expected)
+{
+ var format = opt_format || gl.RGBA;
+ var data = opt_data || null;
+ var expectSuccess = true;
+
+ if (!extensionEnabled || !opt_expected)
+ expectSuccess = false;
+ debug("Testing texture creation with extension " + (extensionEnabled ? "enabled" : "disabled") +
+ ", format " + wtu.glEnumToString(gl, format) + ", and data " + (data ? "non-null" : "null") +
+ ". Expect " + (expectSuccess ? "Success" : "Failure"));
+
+ var texture = allocateTexture();
+ var width = 2;
+ var height = 2;
+ gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, halfFloatOESEnum, data);
+ if(!extensionEnabled) {
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Half floating point texture must be disallowed if OES_texture_half_float isn't enabled");
+ return;
+ } else if (!opt_expected) {
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Half floating point texture allocation must be disallowed when ArrayBufferView is not-null and not-Uint16");
+ return;
+ } else {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
+
+ if (!data) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, format, format, halfFloatOESEnum, colorCanvas);
+ }
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, opt_expected);
+ // Check that linear fails.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 0, 0, 255], "should be black");
+ }
+
+}
+
+function checkRenderingResults()
+{
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+function runRenderTest(format, subtractor, data, requireRenderable)
+{
+ var formatString = wtu.glEnumToString(gl, format);
+
+ debug("");
+
+ if (!data) {
+ debug("Testing half floating point " + formatString + " render target");
+ } else {
+ debug("Testing half floating point " + formatString + " from a Uint16Array");
+ }
+
+ var texture = allocateTexture();
+ var width = 2;
+ var height = 2;
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, format, ext.HALF_FLOAT_OES, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Half floating point texture allocation should succeed if OES_texture_half_float is enabled");
+
+ if (!data) {
+ // Try to use this texture as render target
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ // It is legal for a WebGL implementation exposing the OES_texture_half_float extension to
+ // support half floating point textures but not as attachments to framebuffer objects.
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ if (requireRenderable) {
+ testFailed(formatString + " render targets not supported.");
+ } else {
+ debug(formatString + " render targets not supported -- this is legal");
+ }
+ return;
+ }
+
+ var renderProgram =
+ wtu.setupProgram(gl,
+ [wtu.simpleVertexShader, "floatingPointFragmentShader"],
+ ['vPosition'],
+ [0]);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Rendering to half floating point texture should succeed");
+ }
+
+ // Now sample from the half floating-point texture and verify we got the correct values.
+ var texturedShaders = [
+ wtu.simpleTextureVertexShader,
+ "testFragmentShader"
+ ];
+ var testProgram =
+ wtu.setupProgram(gl,
+ [wtu.simpleTextureVertexShader, "testFragmentShader"],
+ ['vPosition', 'texCoord0'],
+ [0, 1]);
+ var quadParameters = wtu.setupUnitQuad(gl, 0, 1);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.useProgram(testProgram);
+ gl.uniform4fv(gl.getUniformLocation(testProgram, "subtractor"), subtractor);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "rendering from half floating point texture should succeed");
+ checkRenderingResults();
+}
+
+function runUniqueObjectTest()
+{
+ debug("");
+ debug("Testing that getExtension() returns the same object each time");
+ ext = null;
+ gl.getExtension("OES_texture_half_float").myProperty = 2;
+ webglHarnessCollectGarbage();
+ shouldBe('gl.getExtension("OES_texture_half_float").myProperty', '2');
+}
+
+// Make sure we can call readPixels with the passed in arrayBufferConstructor and that the color
+// channels are the ones we expect. If there is a mismatch between the glType and arrayBuffer type,
+// fail the test.
+function verifyReadPixelsColors(red, green, blue, alpha, alphaRGB, glFormat, glType, arrayBufferConstructor) {
+ var typeName = wtu.glEnumToString(gl, glType);
+
+ debug(wtu.glEnumToString(gl, glFormat) + " framebuffer with " + typeName + " readback.");
+
+ var arrayBuffer = new arrayBufferConstructor(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "readPixels should return NO_ERROR when reading " + typeName + " data.");
+
+ assertMsg(arrayBuffer[0] === red, "Red channel should be " + red + " for " + typeName + " readPixels. Received: " + arrayBuffer[0]);
+ assertMsg(arrayBuffer[1] === green, "Green channel should be " + green + " for " + typeName + " readPixels. Received: " + arrayBuffer[1]);
+ assertMsg(arrayBuffer[2] === blue, "Blue channel should be " + blue + " for " + typeName + " readPixels. Received: " + arrayBuffer[2]);
+ if (glFormat === gl.RGBA) {
+ assertMsg(arrayBuffer[3] === alpha, "Alpha channel should be " + alpha + " for " + typeName + " readPixels. Received: " + arrayBuffer[3]);
+ } else if (glFormat === gl.RGB) {
+ assertMsg(arrayBuffer[3] === alphaRGB, "Alpha channel should be " + alphaRGB + " for " + typeName + " readPixels. Received: " + arrayBuffer[3]);
+ }
+
+ // Make sure any arrayBuffer types that are not equal to arrayBufferConstructor fail readPixels.
+ if (arrayBufferConstructor !== Uint8Array) {
+ arrayBuffer = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "readPixels should return INVALID_OPERATION when reading mismatched types. " + Uint8Array.toString());
+ }
+ if (arrayBufferConstructor !== Float32Array) {
+ arrayBuffer = new Float32Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "readPixels should return INVALID_OPERATION when reading mismatched types. " + Float32Array.toString());
+ }
+ if (arrayBufferConstructor !== Uint16Array) {
+ arrayBuffer = new Uint16Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, glType, arrayBuffer);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "readPixels should return INVALID_OPERATION when reading mismatched types. " + Uint16Array.toString());
+ }
+}
+
+// Verify that half float textures attached to frame buffers function correctly with regard to framebuffer
+// completness, IMPLEMENTATION_COLOR_READ_FORMAT/TYPE and readPixels
+function runFramebufferTest() {
+ debug("");
+ debug("Framebuffer Tests");
+
+ var texture = allocateTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+
+ debug("Ensure non-color-renderable formats [LUMINANCE, LUMINANCE_ALPHA, ALPHA] fail.");
+ var arrayBufferFloatOutput = new Float32Array(4); // 4 color channels
+ [gl.LUMINANCE, gl.LUMINANCE_ALPHA, gl.ALPHA].forEach(function(badFormat) {
+ debug(wtu.glEnumToString(gl, badFormat) + " framebuffer");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, badFormat, 1, 1, 0, badFormat, ext.HALF_FLOAT_OES, null);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT");
+
+ shouldBeNull("gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT)");
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "IMPLEMENTATION_COLOR_READ_FORMAT should fail for incomplete framebuffers.");
+
+ shouldBeNull("gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE)");
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "IMPLEMENTATION_COLOR_READ_TYPE should fail for incomplete framebuffers.");
+
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, arrayBufferFloatOutput);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION , "readPixels should fail on incomplete framebuffers.");
+ debug("");
+ });
+
+ debug("Ensure color renderable formats [RGBA, RGB] succeed.");
+ var arrayBufferHalfFloatInput = new Uint16Array(4); // 4 color channels
+ arrayBufferHalfFloatInput[0] = 0; // 0 in half float
+ arrayBufferHalfFloatInput[1] = 0x3400; // 0.25 in half float
+ arrayBufferHalfFloatInput[2] = 0x3800; // 0.50 in half float
+ arrayBufferHalfFloatInput[3] = 0x3A00; // 0.75 in half float
+
+ [gl.RGBA, gl.RGB].forEach(function(goodFormat) {
+ debug(wtu.glEnumToString(gl, goodFormat) + " framebuffer tests");
+ debug("");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, goodFormat, 1, 1, 0, goodFormat, ext.HALF_FLOAT_OES, arrayBufferHalfFloatInput);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ // Per the OES_color_buffer_half_float, RGBA/FLOAT should always succeed for readPixels
+ verifyReadPixelsColors(
+ 0.00, // red
+ 0.25, // green
+ 0.50, // blue
+ 0.75, // alpha
+ 1.0, // alphaRGB
+ goodFormat,
+ gl.FLOAT,
+ Float32Array);
+
+ var implementationColorReadFormat = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT);
+ assertMsg(implementationColorReadFormat === gl.RGBA || implementationColorReadFormat === gl.RGB,
+ "IMPLEMENTATION_COLOR_READ_FORMAT should be color renderable: RGBA or RGB. Received: " + wtu.glEnumToString(gl, implementationColorReadFormat));
+
+ var implementationColorReadType = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE);
+
+ // There is nothing in the specifications that keeps the
+ // implementation color read format and type from being the
+ // same as the implicitly supported one. For this reason, keep
+ // gl.FLOAT as one of the valid options.
+ assertMsg(implementationColorReadType === gl.UNSIGNED_BYTE ||
+ implementationColorReadType === gl.FLOAT ||
+ implementationColorReadType === ext.HALF_FLOAT_OES ||
+ implementationColorReadType === gl.UNSIGNED_SHORT_4_4_4_4 ||
+ implementationColorReadType === gl.UNSIGNED_SHORT_5_5_5_1 ||
+ implementationColorReadType === gl.UNSIGNED_SHORT_5_6_5,
+ "IMPLEMENTATION_COLOR_READ_TYPE must be one of UNSIGNED_BYTE, UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_5_6_5, FLOAT, or HALF_FLOAT_OES. " +
+ "Received: " + wtu.glEnumToString(gl, implementationColorReadType));
+
+ // Test the RGBA/HALF_FLOAT_OES combination
+ if (implementationColorReadFormat === gl.RGBA && implementationColorReadType === ext.HALF_FLOAT_OES) {
+ verifyReadPixelsColors(
+ 0, // red
+ 0x3400, // green
+ 0x3800, // blue
+ 0x3A00, // alpha
+ 0x3C00, // alphaRGB
+ goodFormat,
+ ext.HALF_FLOAT_OES,
+ Uint16Array);
+ }
+ }
+ debug("");
+ });
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html
new file mode 100644
index 0000000000..d89e9bcc1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object-bufferData.html
@@ -0,0 +1,194 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL OES_vertex_array_object_bufferData Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<!-- comment in the script tag below to test through JS emualation of the extension. -->
+<!--
+<script src="../../../demos/google/resources/OESVertexArrayObject.js"></script>
+-->
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+attribute vec4 a_color;
+varying vec4 v_color;
+void main(void) {
+ gl_Position = a_position;
+ v_color = a_color;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main(void) {
+ gl_FragColor = v_color;
+}
+</script>
+<script>
+"use strict";
+description("This test verifies drawing results when using gl.bufferData with the OES_vertex_array_object extension.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+var vao = null;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Setup emulated OESVertexArrayObject if it has been included.
+ if (window.setupVertexArrayObject) {
+ debug("using emuated OES_vertex_array_object");
+ setupVertexArrayObject(gl);
+ }
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("OES_vertex_array_object");
+ if (!ext) {
+ testPassed("No OES_vertex_array_object support -- this is legal");
+
+ } else {
+ testPassed("Successfully enabled OES_vertex_array_object extension");
+
+ runBufferDataTest();
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ }
+}
+
+/**
+ * The OES_vertex_array_object extension seems to work incorrectly on some handheld devices,
+ * namely the Nexus 5, and Nexus 7 (in 2014/01) when using bufferData before binding the VAO.
+ * The tested OS was Android KitKat 4.4.2, the effects were the same in all tested browsers
+ * (Chrome, Chrome Beta, Firefox, Firefox Beta), so it is likely a driver bug.
+ * These devices have the similar Adreno 320 and Adreno 330 GPUs respectively.
+ *
+ * The issuse resulted from this sequence of actions in a requestAnimationFrame loop:
+ * 1. upload some vertex buffers with gl.bufferData (eg. colors)
+ * 2. bind the VAO
+ * 3. clear the canvas
+ * 4. draw (some triangles) to the canvas
+ * 5. unbind the VAO
+ *
+ * This caused the drawn triangles to be drawn with black (0) for most of the frames, with some
+ * rare frames presenting the correct render results. Interestingly on both devices exactly every
+ * 64th frame passed (starting with the very first one), the others failed.
+ * (Because of this, we test multiple frames.)
+ * When positions were uploaded, seemingly nothing was drawn, that's likely because the
+ * position buffer was also all 0s.
+ *
+ * The issue did not occur:
+ * - if step 1. and 2. were swapped
+ * - or if step5 was ommited (probably because that makes step 2 a no-op since the VAO is bound)
+ */
+function runBufferDataTest() {
+ debug("Testing draws with bufferData");
+
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+
+ var testColor = [0, 255, 0, 255];
+ var clearColor = [255, 0, 0, 255];
+
+ // Where the issue occures, this is the sequence of success/failure every time:
+ // result: success fail fail fail fail ... success fail fail ...
+ // currentTestCount: 0 1 2 3 4 ... 64 65 66 ...
+ // So with just 1 test it passes, but 2 tests are enough. Here we use 3.
+ var numberOfTests = 3;
+ var currentTestCount = 0;
+
+ var positionLoc = 0;
+ var colorLoc = 1;
+ var gridRes = 1;
+
+ var program = wtu.setupSimpleVertexColorProgram(gl, positionLoc, colorLoc);
+
+ var vao0 = ext.createVertexArrayOES();
+ ext.bindVertexArrayOES(vao0);
+
+ var buffers = wtu.setupIndexedQuadWithOptions(gl,
+ { gridRes: gridRes,
+ positionLocation: positionLoc
+ });
+
+ var colorTypedArray = createColorTypedArray();
+
+ var colorBuffer = gl.createBuffer(gl.ARRAY_BUFFER);
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.enableVertexAttribArray(colorLoc);
+ gl.vertexAttribPointer(colorLoc, 4, gl.FLOAT, false, 0, 0);
+
+ ext.bindVertexArrayOES(null);
+
+ testDrawing();
+
+ function testDrawing() {
+ // this order works fine:
+ // ext.bindVertexArrayOES(vao0);
+ // uploadColor();
+
+ // this order doesn't:
+ uploadColor();
+ ext.bindVertexArrayOES(vao0);
+
+ wtu.clearAndDrawIndexedQuad(gl, 1, clearColor);
+
+ ext.bindVertexArrayOES(null);
+
+ //debug("<span>"+currentTestCount+"</span");
+ wtu.checkCanvas(gl, testColor, "should be green")
+
+ if (++currentTestCount < numberOfTests) {
+ testDrawing();
+ // wtu.requestAnimFrame(testDrawing);
+ } else {
+ // clean up
+ ext.deleteVertexArrayOES(vao0);
+ }
+ }
+
+ function uploadColor() {
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, colorTypedArray, gl.STREAM_DRAW);
+ }
+
+ function createColorTypedArray() {
+ var colors = [];
+ var pOffset = 0;
+ for (var yy = 0; yy <= gridRes; ++yy) {
+ for (var xx = 0; xx <= gridRes; ++xx) {
+ colors[pOffset + 0] = testColor[0];
+ colors[pOffset + 1] = testColor[1];
+ colors[pOffset + 2] = testColor[2];
+ colors[pOffset + 3] = testColor[3];
+ pOffset += 4;
+ }
+ }
+ return new Float32Array(colors);
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html
new file mode 100644
index 0000000000..4d544aeade
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/oes-vertex-array-object.html
@@ -0,0 +1,780 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL OES_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>
+<!-- comment in the script tag below to test through JS emulation of the extension. -->
+<!--
+<script src="../../../demos/google/resources/OESVertexArrayObject.js"></script>
+-->
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 50px; height: 50px;"> </canvas>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+attribute vec4 a_color;
+varying vec4 v_color;
+void main(void) {
+ gl_Position = a_position;
+ v_color = a_color;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main(void) {
+ gl_FragColor = v_color;
+}
+</script>
+<script>
+"use strict";
+description("This test verifies the functionality of the OES_vertex_array_object extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+var vao = null;
+
+var contextA;
+var contextB;
+var extA;
+var extB;
+var vertexArrayA;
+var vertexArrayB;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Setup emulated OESVertexArrayObject if it has been included.
+ if (window.setupVertexArrayObject) {
+ debug("using emulated OES_vertex_array_object");
+ setupVertexArrayObject(gl);
+ }
+
+ // Run tests with extension disabled
+ runBindingTestDisabled();
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("OES_vertex_array_object");
+ if (!ext) {
+ testPassed("No OES_vertex_array_object support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled OES_vertex_array_object extension");
+
+ runSupportedTest(true);
+ runBindingTestEnabled();
+ runObjectTest();
+ runAttributeTests();
+ runAttributeValueTests();
+ runDrawTests();
+ runUnboundDeleteTests();
+ runBoundDeleteTests();
+ runArrayBufferBindTests();
+ runInvalidContextTests();
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("OES_vertex_array_object") >= 0) {
+ if (extensionEnabled) {
+ testPassed("OES_vertex_array_object listed as supported and getExtension succeeded");
+ } else {
+ testFailed("OES_vertex_array_object listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("OES_vertex_array_object not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("OES_vertex_array_object not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runBindingTestDisabled() {
+ debug("");
+ debug("Testing binding enum with extension disabled");
+
+ // Use the constant directly as we don't have the extension
+ var VERTEX_ARRAY_BINDING_OES = 0x85B5;
+
+ gl.getParameter(VERTEX_ARRAY_BINDING_OES);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "VERTEX_ARRAY_BINDING_OES should not be queryable if extension is disabled");
+}
+
+function runBindingTestEnabled() {
+ debug("");
+ debug("Testing binding enum with extension enabled");
+
+ shouldBe("ext.VERTEX_ARRAY_BINDING_OES", "0x85B5");
+
+ gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "VERTEX_ARRAY_BINDING_OES query should succeed if extension is enabled");
+
+ // Default value is null
+ if (gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) === null) {
+ testPassed("Default value of VERTEX_ARRAY_BINDING_OES is null");
+ } else {
+ testFailed("Default value of VERTEX_ARRAY_BINDING_OES is not null");
+ }
+
+ debug("");
+ debug("Testing binding a VAO");
+ var vao0 = ext.createVertexArrayOES();
+ var vao1 = ext.createVertexArrayOES();
+ shouldBeNull("gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES)");
+ ext.bindVertexArrayOES(vao0);
+ if (gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) == vao0) {
+ testPassed("gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is expected VAO");
+ } else {
+ testFailed("gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is not expected VAO")
+ }
+ ext.bindVertexArrayOES(vao1);
+ if (gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) == vao1) {
+ testPassed("gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is expected VAO");
+ } else {
+ testFailed("gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES) is not expected VAO")
+ }
+ ext.deleteVertexArrayOES(vao1);
+ shouldBeNull("gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES)");
+ ext.bindVertexArrayOES(vao1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "binding a deleted vertex array object");
+ ext.bindVertexArrayOES(null);
+ shouldBeNull("gl.getParameter(ext.VERTEX_ARRAY_BINDING_OES)");
+ ext.deleteVertexArrayOES(vao1);
+}
+
+function runObjectTest() {
+ debug("");
+ debug("Testing object creation");
+
+ vao = ext.createVertexArrayOES();
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "createVertexArrayOES should not set an error");
+ shouldBeNonNull("vao");
+
+ // Expect false if never bound
+ shouldBeFalse("ext.isVertexArrayOES(vao)");
+ ext.bindVertexArrayOES(vao);
+ shouldBeTrue("ext.isVertexArrayOES(vao)");
+ ext.bindVertexArrayOES(null);
+ shouldBeTrue("ext.isVertexArrayOES(vao)");
+
+ shouldBeFalse("ext.isVertexArrayOES(null)");
+
+ ext.deleteVertexArrayOES(vao);
+ vao = null;
+}
+
+function runAttributeTests() {
+ debug("");
+ debug("Testing attributes work across bindings");
+
+ var states = [];
+
+ var attrCount = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);
+ for (var n = 0; n < attrCount; n++) {
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+
+ var state = {};
+ states.push(state);
+
+ var vao = state.vao = ext.createVertexArrayOES();
+ ext.bindVertexArrayOES(vao);
+
+ var enableArray = (n % 2 == 0);
+ if (enableArray) {
+ gl.enableVertexAttribArray(n);
+ } else {
+ gl.disableVertexAttribArray(n);
+ }
+
+ if (enableArray) {
+ var buffer = state.buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(gl.ARRAY_BUFFER, 1024, gl.STATIC_DRAW);
+
+ gl.vertexAttribPointer(n, 1 + n % 4, gl.FLOAT, true, n * 4, n * 4);
+ }
+
+ if (enableArray) {
+ var elbuffer = state.elbuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elbuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, 1024, gl.STATIC_DRAW);
+ }
+
+ ext.bindVertexArrayOES(null);
+ }
+
+ var anyMismatch = false;
+ for (var n = 0; n < attrCount; n++) {
+ var state = states[n];
+
+ ext.bindVertexArrayOES(state.vao);
+
+ var shouldBeEnabled = (n % 2 == 0);
+ var isEnabled = gl.getVertexAttrib(n, gl.VERTEX_ATTRIB_ARRAY_ENABLED);
+ if (shouldBeEnabled != isEnabled) {
+ testFailed("VERTEX_ATTRIB_ARRAY_ENABLED not preserved");
+ anyMismatch = true;
+ }
+
+ var buffer = gl.getVertexAttrib(n, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);
+ if (shouldBeEnabled) {
+ if (buffer == state.buffer) {
+ // Matched
+ if ((gl.getVertexAttrib(n, gl.VERTEX_ATTRIB_ARRAY_SIZE) == 1 + n % 4) &&
+ (gl.getVertexAttrib(n, gl.VERTEX_ATTRIB_ARRAY_TYPE) == gl.FLOAT) &&
+ (gl.getVertexAttrib(n, gl.VERTEX_ATTRIB_ARRAY_NORMALIZED) == true) &&
+ (gl.getVertexAttrib(n, gl.VERTEX_ATTRIB_ARRAY_STRIDE) == n * 4) &&
+ (gl.getVertexAttribOffset(n, gl.VERTEX_ATTRIB_ARRAY_POINTER) == n * 4)) {
+ // Matched
+ } else {
+ testFailed("VERTEX_ATTRIB_ARRAY_* not preserved");
+ anyMismatch = true;
+ }
+ } else {
+ testFailed("VERTEX_ATTRIB_ARRAY_BUFFER_BINDING not preserved");
+ anyMismatch = true;
+ }
+ } else {
+ // GL_CURRENT_VERTEX_ATTRIB is not preserved
+ if (buffer) {
+ testFailed("VERTEX_ATTRIB_ARRAY_BUFFER_BINDING not preserved");
+ anyMismatch = true;
+ }
+ }
+
+ var elbuffer = gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING);
+ if (shouldBeEnabled) {
+ if (elbuffer == state.elbuffer) {
+ // Matched
+ } else {
+ testFailed("ELEMENT_ARRAY_BUFFER_BINDING not preserved");
+ anyMismatch = true;
+ }
+ } else {
+ if (elbuffer == null) {
+ // Matched
+ } else {
+ testFailed("ELEMENT_ARRAY_BUFFER_BINDING not preserved");
+ anyMismatch = true;
+ }
+ }
+ }
+ ext.bindVertexArrayOES(null);
+ if (!anyMismatch) {
+ testPassed("All attributes preserved across bindings");
+ }
+
+ for (var n = 0; n < attrCount; n++) {
+ var state = states[n];
+ ext.deleteVertexArrayOES(state.vao);
+ }
+}
+
+function runAttributeValueTests() {
+ debug("");
+ debug("Testing that attribute values are not attached to bindings");
+
+ var v;
+ var vao0 = ext.createVertexArrayOES();
+ var anyFailed = false;
+
+ ext.bindVertexArrayOES(null);
+ gl.vertexAttrib4f(0, 0, 1, 2, 3);
+
+ v = gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB);
+ if (!(v[0] == 0 && v[1] == 1 && v[2] == 2 && v[3] == 3)) {
+ testFailed("Vertex attrib value not round-tripped?");
+ anyFailed = true;
+ }
+
+ ext.bindVertexArrayOES(vao0);
+
+ v = gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB);
+ if (!(v[0] == 0 && v[1] == 1 && v[2] == 2 && v[3] == 3)) {
+ testFailed("Vertex attrib value reset across bindings");
+ anyFailed = true;
+ }
+
+ gl.vertexAttrib4f(0, 4, 5, 6, 7);
+ ext.bindVertexArrayOES(null);
+
+ v = gl.getVertexAttrib(0, gl.CURRENT_VERTEX_ATTRIB);
+ if (!(v[0] == 4 && v[1] == 5 && v[2] == 6 && v[3] == 7)) {
+ testFailed("Vertex attrib value bound to buffer");
+ anyFailed = true;
+ }
+
+ if (!anyFailed) {
+ testPassed("Vertex attribute values are not attached to bindings")
+ }
+
+ ext.bindVertexArrayOES(null);
+ ext.deleteVertexArrayOES(vao0);
+}
+
+function runDrawTests() {
+ debug("");
+ debug("Testing draws with various VAO bindings");
+
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+
+ var vao0 = ext.createVertexArrayOES();
+ var vao1 = ext.createVertexArrayOES();
+ var vao2 = ext.createVertexArrayOES();
+
+ var positionLocation = 0;
+ var colorLocation = 1;
+
+ var program = wtu.setupSimpleVertexColorProgram(gl, positionLocation, colorLocation);
+
+ function setupQuad(s, colorsInArray) {
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ 1.0 * s, 1.0 * s, 0.0,
+ -1.0 * s, 1.0 * s, 0.0,
+ -1.0 * s, -1.0 * s, 0.0,
+ 1.0 * s, 1.0 * s, 0.0,
+ -1.0 * s, -1.0 * s, 0.0,
+ 1.0 * s, -1.0 * s, 0.0]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(positionLocation);
+ gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
+
+ // Test switching between VAOs that have different number of enabled arrays
+ if (colorsInArray) {
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ 0.0, 0.0, 0.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,
+ 0.0, 0.0, 0.0, 1.0,
+ 0.0, 0.0, 0.0, 1.0]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(colorLocation);
+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
+ } else {
+ gl.disableVertexAttribArray(colorLocation);
+ }
+ };
+
+ function verifyDiagonalPixels(s, expectedInside, drawDescription) {
+ // Tests pixels along a diagonal running from the center of the canvas to the (0, 0) corner.
+ // Values on the points list indicate relative position along this diagonal.
+ var points = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0];
+ for (var n = 0; n < points.length; n++) {
+ var expected = points[n] <= s ? expectedInside : 255;
+ var x = Math.round((1 - points[n]) * canvas.width / 2);
+ var y = Math.round((1 - points[n]) * canvas.height / 2);
+ wtu.checkCanvasRect(gl, x, y, 1, 1, [expected, expected, expected, 255],
+ "Drawing " + drawDescription + " should pass", 2);
+ }
+ };
+ function verifyDraw(drawDescription, s, colorsInArray) {
+ wtu.clearAndDrawUnitQuad(gl);
+ var expectedInside = colorsInArray ? 0 : 128;
+ verifyDiagonalPixels(s, expectedInside, drawDescription);
+ };
+
+ // Setup all bindings
+ setupQuad(1, true);
+ ext.bindVertexArrayOES(vao0);
+ setupQuad(0.5, true);
+ ext.bindVertexArrayOES(vao1);
+ setupQuad(0.25, true);
+ ext.bindVertexArrayOES(vao2);
+ setupQuad(0.75, false);
+
+ gl.vertexAttrib4f(colorLocation, 0.5, 0.5, 0.5, 1);
+
+ // Verify drawing
+ ext.bindVertexArrayOES(null);
+ verifyDraw("with the default VAO", 1, true);
+ ext.bindVertexArrayOES(vao0);
+ verifyDraw("with VAO #0", 0.5, true);
+ ext.bindVertexArrayOES(vao1);
+ verifyDraw("with VAO #1", 0.25, true);
+ ext.bindVertexArrayOES(vao2);
+ verifyDraw("with VAO that has the color array disabled", 0.75, false);
+
+ // Verify bound VAO after delete
+ ext.bindVertexArrayOES(vao1);
+ ext.deleteVertexArrayOES(vao0);
+ verifyDraw("after deleting another VAO", 0.25, true);
+ ext.deleteVertexArrayOES(vao1);
+ verifyDraw("after deleting the VAO that was bound", 1, true);
+
+ // Disable global vertex attrib array
+ gl.disableVertexAttribArray(positionLocation);
+ gl.disableVertexAttribArray(colorLocation);
+
+ // Check that constant values are treated correctly as not being part of VAO state.
+ var positionLoc = 0;
+ var colorLoc = 1;
+ var gridRes = 1;
+ wtu.setupIndexedQuad(gl, gridRes, positionLoc);
+ // Set the vertex color to red.
+ gl.vertexAttrib4f(colorLoc, 1, 0, 0, 1);
+
+ var vao0 = ext.createVertexArrayOES();
+ ext.bindVertexArrayOES(vao0);
+ var program = wtu.setupSimpleVertexColorProgram(gl, positionLoc, colorLoc);
+ wtu.setupIndexedQuad(gl, gridRes, positionLoc);
+ // Set the vertex color to green.
+ gl.vertexAttrib4f(colorLoc, 0, 1, 0, 1);
+ wtu.clearAndDrawIndexedQuad(gl, gridRes);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ ext.deleteVertexArrayOES(vao0);
+ wtu.clearAndDrawIndexedQuad(gl, gridRes);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+function runUnboundDeleteTests() {
+ debug("");
+ debug("Testing using buffers that are deleted when attached to unbound VAOs");
+
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a_position", "a_color"]);
+ gl.useProgram(program);
+
+ var positionBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([
+ 1.0, 1.0,
+ -1.0, 1.0,
+ -1.0, -1.0,
+ 1.0, -1.0]),
+ gl.STATIC_DRAW);
+
+ var colors = [
+ [255, 0, 0, 255],
+ [ 0, 255, 0, 255],
+ [ 0, 0, 255, 255],
+ [ 0, 255, 255, 255]
+ ];
+ var colorBuffers = [];
+ var elementBuffers = [];
+ var vaos = [];
+ for (var ii = 0; ii < colors.length; ++ii) {
+ var vao = ext.createVertexArrayOES();
+ vaos.push(vao);
+ ext.bindVertexArrayOES(vao);
+ // Set the position buffer
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+ var elementBuffer = gl.createBuffer();
+ elementBuffers.push(elementBuffer);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
+ gl.bufferData(
+ gl.ELEMENT_ARRAY_BUFFER,
+ new Uint8Array([0, 1, 2, 0, 2, 3]),
+ gl.STATIC_DRAW);
+
+ // Setup the color attrib
+ var color = colors[ii];
+ if (ii < 3) {
+ var colorBuffer = gl.createBuffer();
+ colorBuffers.push(colorBuffer);
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array(
+ [ color[0], color[1], color[2], color[3],
+ color[0], color[1], color[2], color[3],
+ color[0], color[1], color[2], color[3],
+ color[0], color[1], color[2], color[3]
+ ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, 0);
+ } else {
+ gl.vertexAttrib4f(1, color[0] / 255, color[1] / 255, color[2] / 255, color[3] / 255);
+ }
+ }
+
+ // delete the color buffers AND the position buffer.
+ ext.bindVertexArrayOES(null);
+ for (var ii = 0; ii < colorBuffers.length; ++ii) {
+ gl.deleteBuffer(colorBuffers[ii]);
+ gl.deleteBuffer(elementBuffers[ii]);
+ ext.bindVertexArrayOES(vaos[ii]);
+ var boundBuffer = gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);
+ // The buffers should still be valid at this point, since it was attached to the VAO
+ if(boundBuffer != colorBuffers[ii]) {
+ testFailed("buffer removed even though it is still attached to a VAO");
+ }
+ }
+
+ ext.bindVertexArrayOES(null);
+ gl.deleteBuffer(positionBuffer);
+
+ // Render with the deleted buffers. As they are referenced by VAOs they
+ // must still be around.
+ for (var ii = 0; ii < colors.length; ++ii) {
+ var color = colors[ii];
+ ext.bindVertexArrayOES(vaos[ii]);
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ wtu.checkCanvas(gl, color, "should be " + color);
+ }
+
+ // Clean up.
+ for (var ii = 0; ii < colorBuffers.length; ++ii) {
+ ext.deleteVertexArrayOES(vaos[ii]);
+ }
+
+ for (var ii = 0; ii < colorBuffers.length; ++ii) {
+ // The buffers should no longer be valid now that the VAOs are deleted
+ if(gl.isBuffer(colorBuffers[ii])) {
+ testFailed("buffer not properly cleaned up after VAO deletion");
+ }
+ }
+}
+
+function runBoundDeleteTests() {
+ debug("Testing using buffers that are deleted when attached to bound VAOs");
+
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a_position", "a_color"]);
+ gl.useProgram(program);
+
+ var positionBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([
+ 1.0, 1.0,
+ -1.0, 1.0,
+ -1.0, -1.0,
+ 1.0, -1.0]),
+ gl.STATIC_DRAW);
+
+ // Setup the color attrib
+ var colorBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array(
+ [ 255, 0, 0, 255,
+ 0, 255, 0, 255,
+ 0, 0, 255, 255,
+ 0, 255, 255, 255
+ ]), gl.STATIC_DRAW);
+
+ var vaos = [];
+ var elementBuffers = [];
+ for (var ii = 0; ii < 4; ++ii) {
+ var vao = ext.createVertexArrayOES();
+ vaos.push(vao);
+ ext.bindVertexArrayOES(vao);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+ var elementBuffer = gl.createBuffer();
+ elementBuffers.push(elementBuffer);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
+ gl.bufferData(
+ gl.ELEMENT_ARRAY_BUFFER,
+ new Uint8Array([0, 1, 2, 0, 2, 3]),
+ gl.STATIC_DRAW);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, 0);
+ }
+
+ // delete the color buffers AND the position buffer, that are bound to the current VAO
+ for (var ii = 0; ii < vaos.length; ++ii) {
+ ext.bindVertexArrayOES(vaos[ii]);
+
+ gl.deleteBuffer(colorBuffer);
+ gl.deleteBuffer(positionBuffer);
+
+ // After the first iteration, deleteBuffer will be a no-op, and will not unbind its matching
+ // bind points on the now-bound VAO like it did on the first iteration.
+ var expectRetained = (ii != 0);
+ var shouldBeStr = (expectRetained ? "retained" : "cleared");
+
+ var boundPositionBuffer = gl.getVertexAttrib(0, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);
+ if (expectRetained != (boundPositionBuffer == positionBuffer)) {
+ testFailed("Position attrib stored buffer should be " + shouldBeStr + ".");
+ }
+
+ var boundColorBuffer = gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);
+ if (expectRetained != (boundColorBuffer == colorBuffer)) {
+ testFailed("Color attrib stored buffer should be " + shouldBeStr + ".");
+ }
+
+ // If retained, everything should still work. If cleared, drawing should now fail.
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ var expectedError = (expectRetained ? gl.NO_ERROR : gl.INVALID_OPERATION);
+ wtu.glErrorShouldBe(gl, expectedError,
+ "Draw call should " + (expectRetained ? "not " : "") + "fail.");
+
+ if (gl.isBuffer(positionBuffer)) {
+ testFailed("References from unbound VAOs don't keep Position buffer alive.");
+ }
+ if (gl.isBuffer(colorBuffer)) {
+ testFailed("References from unbound VAOs don't keep Color buffer alive");
+ }
+ }
+}
+
+function runArrayBufferBindTests() {
+ debug("");
+ debug("Testing that buffer bindings on VAOs don't affect default VAO ARRAY_BUFFER binding.");
+
+ ext.bindVertexArrayOES(null);
+
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a_color", "a_position"]);
+ gl.useProgram(program);
+
+ // create shared element buffer
+ var elementBuffer = gl.createBuffer();
+ // bind to default
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
+ gl.bufferData(
+ gl.ELEMENT_ARRAY_BUFFER,
+ new Uint8Array([0, 1, 2, 0, 2, 3]),
+ gl.STATIC_DRAW);
+
+ // first create the buffers for no VAO draw.
+ var nonVAOColorBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, nonVAOColorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array(
+ [ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ ]), gl.STATIC_DRAW);
+
+ // shared position buffer.
+ var positionBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([
+ 1.0, 1.0,
+ -1.0, 1.0,
+ -1.0, -1.0,
+ 1.0, -1.0]),
+ gl.STATIC_DRAW);
+
+ // attach position buffer to default
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+
+ // now create VAO
+ var vao = ext.createVertexArrayOES();
+ ext.bindVertexArrayOES(vao);
+
+ // attach the position buffer VAO
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+
+ var vaoColorBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vaoColorBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array(
+ [ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 4, gl.UNSIGNED_BYTE, true, 0, 0);
+
+ // now set the buffer back to the nonVAOColorBuffer
+ gl.bindBuffer(gl.ARRAY_BUFFER, nonVAOColorBuffer);
+
+ // bind to VAO
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, elementBuffer);
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+
+ // unbind VAO
+ ext.bindVertexArrayOES(null);
+
+ // At this point the nonVAOColorBuffer should be still be bound.
+ // If the WebGL impl is emulating VAOs it must make sure
+ // it correctly restores this binding.
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 4, gl.UNSIGNED_BYTE, true, 0, 0);
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+function runInvalidContextTests() {
+ contextA = wtu.create3DContext(undefined, undefined, 1);
+ contextB = wtu.create3DContext(undefined, undefined, 1);
+ extA = contextA.getExtension("OES_vertex_array_object");
+ extB = contextB.getExtension("OES_vertex_array_object");
+ vertexArrayA = extA.createVertexArrayOES();
+ vertexArrayB = extB.createVertexArrayOES();
+
+ wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "extA.bindVertexArrayOES(vertexArrayA)");
+ wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "extA.bindVertexArrayOES(null)");
+ wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "extB.bindVertexArrayOES(vertexArrayB)");
+ wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "extB.bindVertexArrayOES(null)");
+
+ debug("")
+ debug("State queries validate context");
+ shouldBeFalse("extA.isVertexArrayOES(vertexArrayB)");
+ wtu.glErrorShouldBe(contextA, gl.NO_ERROR, "there should be no errors from invalid request");
+ shouldBeFalse("extB.isVertexArrayOES(vertexArrayA)");
+ wtu.glErrorShouldBe(contextB, gl.NO_ERROR, "there should be no errors from invalid request");
+ shouldBeTrue("extA.isVertexArrayOES(vertexArrayA)");
+ wtu.glErrorShouldBe(contextA, gl.NO_ERROR, "there should be no errors from valid request");
+ shouldBeTrue("extB.isVertexArrayOES(vertexArrayB)");
+ wtu.glErrorShouldBe(contextB, gl.NO_ERROR, "there should be no errors from valid request");
+
+ debug("")
+ debug("Deleting an object from another context generates an error");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "extA.deleteVertexArrayOES(vertexArrayB)");
+ wtu.shouldGenerateGLError(contextB, contextB.INVALID_OPERATION, "extB.deleteVertexArrayOES(vertexArrayA)");
+
+ debug("")
+ debug("Invalid delete operations do not delete");
+ shouldBeTrue("extA.isVertexArrayOES(vertexArrayA)");
+ shouldBeTrue("extB.isVertexArrayOES(vertexArrayB)");
+
+ debug("")
+ debug("Cannot bind VAOs from other contexts");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "extA.bindVertexArrayOES(vertexArrayB)");
+ wtu.shouldGenerateGLError(contextB, contextB.INVALID_OPERATION, "extB.bindVertexArrayOES(vertexArrayA)");
+
+ debug("")
+ debug("Context checks happen even for deleted objects");
+ wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "extA.deleteVertexArrayOES(vertexArrayA)");
+ wtu.shouldGenerateGLError(contextB, contextB.NO_ERROR, "extB.deleteVertexArrayOES(vertexArrayB)");
+ wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "extA.deleteVertexArrayOES(vertexArrayB)");
+ wtu.shouldGenerateGLError(contextB, contextB.INVALID_OPERATION, "extB.deleteVertexArrayOES(vertexArrayA)");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/s3tc-and-rgtc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/s3tc-and-rgtc.html
new file mode 100644
index 0000000000..3b725ffe22
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/s3tc-and-rgtc.html
@@ -0,0 +1,1066 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compressed-texture-utils.js"></script>
+<title>WebGL WEBGL_compressed_texture_s3tc and EXT_texture_compression_rgtc Conformance Tests</title>
+<style>
+img {
+ border: 1px solid black;
+ margin-right: 1em;
+}
+
+.testimages br {
+ clear: both;
+}
+
+.testimages > div {
+ float: left;
+ margin: 1em;
+}
+</style>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_compressed_texture_s3tc extension, if it is available. It also tests the related formats from the EXT_texture_compression_rgtc extension.");
+
+debug("");
+
+// Acceptable interpolation error depends on endpoints:
+// 1.0 / 255.0 + 0.03 * max(abs(endpoint0 - endpoint1), abs(endpoint0_p - endpoint1_p))
+// For simplicity, assume the worst case (e0 is 0.0, e1 is 1.0). After conversion to unorm8, it is 9.
+const DEFAULT_COLOR_ERROR = 9;
+
+/*
+BC1 (DXT1) block
+e0 = [ 0, 255, 0]
+e1 = [255, 0, 0]
+e0 < e1, so it uses 3-color mode
+
+local palette
+ 0: [ 0, 255, 0, 255]
+ 1: [255, 0, 0, 255]
+ 2: [128, 128, 0, 255]
+ 3: [ 0, 0, 0, 255] // for BC1 RGB
+ 3: [ 0, 0, 0, 0] // for BC1 RGBA
+selectors
+ 3 2 1 0
+ 2 2 1 0
+ 1 1 1 0
+ 0 0 0 0
+
+Extending this block with opaque alpha and uploading as BC2 or BC3
+will generate wrong colors because BC2 and BC3 do not have 3-color mode.
+*/
+var img_4x4_rgba_dxt1 = new Uint8Array([
+ 0xE0, 0x07, 0x00, 0xF8, 0x1B, 0x1A, 0x15, 0x00
+]);
+
+/*
+BC2 (DXT3) block
+
+Quantized alpha values
+ 0 1 2 3
+ 4 5 6 7
+ 8 9 A B
+ C D E F
+
+RGB block
+e0 = [255, 0, 0]
+e1 = [ 0, 255, 0]
+BC2 has only 4-color mode
+
+local palette
+ 0: [255, 0, 0]
+ 1: [ 0, 255, 0]
+ 2: [170, 85, 0]
+ 3: [ 85, 170, 0]
+selectors
+ 0 1 2 3
+ 1 1 2 3
+ 2 2 2 3
+ 3 3 3 3
+*/
+var img_4x4_rgba_dxt3 = new Uint8Array([
+ 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE,
+ 0x00, 0xF8, 0xE0, 0x07, 0xE4, 0xE5, 0xEA, 0xFF
+]);
+
+/*
+BC3 (DXT5) block
+
+Alpha block (aka DXT5A)
+e0 = 255
+e1 = 0
+e0 > e1, so using 6 intermediate points
+local palette
+ 255, 0, 219, 182, 146, 109, 73, 36
+selectors
+ 0 1 2 3
+ 1 2 3 4
+ 2 3 4 5
+ 3 4 5 6
+
+RGB block
+e0 = [255, 0, 0]
+e1 = [ 0, 255, 0]
+BC3 has only 4-color mode
+
+local palette
+ 0: [255, 0, 0]
+ 1: [ 0, 255, 0]
+ 2: [170, 85, 0]
+ 3: [ 85, 170, 0]
+selectors
+ 3 2 1 0
+ 3 2 1 1
+ 3 2 2 2
+ 3 3 3 3
+*/
+var img_4x4_rgba_dxt5 = new Uint8Array([
+ 0xFF, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x00, 0xF8, 0xE0, 0x07, 0x1B, 0x5B, 0xAB, 0xFF
+]);
+
+// BC4 - just the alpha block from BC3 above, interpreted as the red channel.
+// See http://www.reedbeta.com/blog/understanding-bcn-texture-compression-formats/#bc4
+// for format details.
+var img_4x4_r_bc4 = new Uint8Array([
+ 0xFF, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+]);
+
+// BC5 - Two BC3 alpha blocks, interpreted as the red and green channels.
+var img_4x4_rg_bc5 = new Uint8Array([
+ 0xFF, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x00, 0xFF, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+]);
+
+// Signed BC4 - change endpoints to use full -1 to 1 range.
+var img_4x4_signed_r_bc4 = new Uint8Array([
+ 0x7F, 0x80, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+]);
+
+// Signed BC5 - Two BC3 alpha blocks, interpreted as the red and green channels.
+var img_4x4_signed_rg_bc5 = new Uint8Array([
+ 0x7F, 0x80, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x80, 0x7F, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+]);
+
+
+/*
+8x8 block endpoints use half-intensity values (appear darker than 4x4)
+*/
+var img_8x8_rgba_dxt1 = new Uint8Array([
+ 0xe0,0x03,0x00,0x78,0x13,0x10,0x15,0x00,
+ 0x0f,0x00,0xe0,0x7b,0x11,0x10,0x15,0x00,
+ 0xe0,0x03,0x0f,0x78,0x44,0x45,0x40,0x55,
+ 0x0f,0x00,0xef,0x03,0x44,0x45,0x40,0x55
+]);
+var img_8x8_rgba_dxt3 = new Uint8Array([
+ 0xf6,0xff,0xf6,0xff,0xff,0xff,0xff,0xff,0x00,0x78,0xe0,0x03,0x44,0x45,0x40,0x55,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7b,0x0f,0x00,0x44,0x45,0x40,0x55,
+ 0xff,0xff,0xff,0xff,0xf6,0xff,0xf6,0xff,0x0f,0x78,0xe0,0x03,0x11,0x10,0x15,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x03,0x0f,0x00,0x11,0x10,0x15,0x00
+]);
+var img_8x8_rgba_dxt5 = new Uint8Array([
+ 0xff,0x69,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x78,0xe0,0x03,0x44,0x45,0x40,0x55,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x7b,0x0f,0x00,0x44,0x45,0x40,0x55,
+ 0xff,0x69,0x00,0x00,0x00,0x01,0x10,0x00,0x0f,0x78,0xe0,0x03,0x11,0x10,0x15,0x00,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x03,0xef,0x00,0x11,0x10,0x15,0x00
+]);
+var img_8x8_r_bc4 = new Uint8Array([
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+]);
+var img_8x8_rg_bc5 = new Uint8Array([
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6, 0x00, 0x7F, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6, 0x00, 0x7F, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6, 0x00, 0x7F, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x7F, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6, 0x00, 0x7F, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+]);
+
+var wtu = WebGLTestUtils;
+var ctu = CompressedTextureUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+var program = wtu.setupTexturedQuad(gl);
+var ext = null;
+var ext_rgtc = {};
+var vao = null;
+var validFormats = {
+ COMPRESSED_RGB_S3TC_DXT1_EXT : 0x83F0,
+ COMPRESSED_RGBA_S3TC_DXT1_EXT : 0x83F1,
+ COMPRESSED_RGBA_S3TC_DXT3_EXT : 0x83F2,
+ COMPRESSED_RGBA_S3TC_DXT5_EXT : 0x83F3,
+};
+var name;
+var supportedFormats;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ ctu.testCompressedFormatsUnavailableWhenExtensionDisabled(gl, validFormats, expectedByteLength, 4);
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "WEBGL_compressed_texture_s3tc");
+ if (!ext) {
+ testPassed("No WEBGL_compressed_texture_s3tc support -- this is legal");
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_s3tc", false);
+ } else {
+ testPassed("Successfully enabled WEBGL_compressed_texture_s3tc extension");
+
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_s3tc", true);
+ runTestExtension();
+ }
+ ext_rgtc = wtu.getExtensionWithKnownPrefixes(gl, "EXT_texture_compression_rgtc");
+ if (ext_rgtc) {
+ ext = ext || {};
+ // Make ctu.formatToString work for rgtc enums.
+ for (const name in ext_rgtc)
+ ext[name] = ext_rgtc[name];
+ runTestRGTC();
+ }
+}
+
+function expectedByteLength(width, height, format) {
+ if (format == validFormats.COMPRESSED_RGBA_S3TC_DXT3_EXT || format == validFormats.COMPRESSED_RGBA_S3TC_DXT5_EXT) {
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;
+ }
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;
+}
+
+function getBlockDimensions(format) {
+ return {width: 4, height: 4};
+}
+
+function runTestExtension() {
+ debug("");
+ debug("Testing WEBGL_compressed_texture_s3tc");
+
+ // Test that enum values are listed correctly in supported formats and in the extension object.
+ ctu.testCompressedFormatsListed(gl, validFormats);
+ ctu.testCorrectEnumValuesInExt(ext, validFormats);
+ // Test that texture upload buffer size is validated correctly.
+ ctu.testFormatRestrictionsOnBufferSize(gl, validFormats, expectedByteLength, getBlockDimensions);
+
+ // Test each format
+ testDXT1_RGB();
+ testDXT1_RGBA();
+ testDXT3_RGBA();
+ testDXT5_RGBA();
+
+ // Test compressed PBOs with a single format
+ if (contextVersion >= 2) {
+ testDXT5_RGBA_PBO();
+ }
+
+ // Test TexImage validation on level dimensions combinations.
+ debug("");
+ debug("When level equals 0, width and height must be a multiple of 4.");
+ debug("When level is larger than 0, this constraint doesn't apply.");
+ ctu.testTexImageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { level: 0, width: 4, height: 3, expectation: gl.INVALID_OPERATION, message: "0: 4x3" },
+ { level: 0, width: 3, height: 4, expectation: gl.INVALID_OPERATION, message: "0: 3x4" },
+ { level: 0, width: 2, height: 2, expectation: gl.INVALID_OPERATION, message: "0: 2x2" },
+ { level: 0, width: 4, height: 4, expectation: gl.NO_ERROR, message: "0: 4x4" },
+ { level: 1, width: 2, height: 2, expectation: gl.NO_ERROR, message: "1: 2x2" },
+ { level: 2, width: 1, height: 1, expectation: gl.NO_ERROR, message: "2: 1x1" },
+ ]);
+
+ ctu.testTexSubImageDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions, 16, 16,
+ [
+ { xoffset: 0, yoffset: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "height is not a multiple of 4" },
+ { xoffset: 0, yoffset: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "width is not a multiple of 4" },
+ { xoffset: 1, yoffset: 0, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "xoffset is not a multiple of 4" },
+ { xoffset: 0, yoffset: 1, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "yoffset is not a multiple of 4" },
+ { xoffset: 12, yoffset: 12, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ ]);
+
+ if (contextVersion >= 2) {
+ debug("");
+ debug("Testing NPOT textures");
+ ctu.testTexImageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { level: 0, width: 0, height: 0, expectation: gl.NO_ERROR, message: "0: 0x0 is valid" },
+ { level: 0, width: 1, height: 1, expectation: gl.INVALID_OPERATION, message: "0: 1x1 is invalid" },
+ { level: 0, width: 2, height: 2, expectation: gl.INVALID_OPERATION, message: "0: 2x2 is invalid" },
+ { level: 0, width: 3, height: 3, expectation: gl.INVALID_OPERATION, message: "0: 3x3 is invalid" },
+ { level: 0, width: 10, height: 10, expectation: gl.INVALID_OPERATION, message: "0: 10x10 is invalid" },
+ { level: 0, width: 11, height: 11, expectation: gl.INVALID_OPERATION, message: "0: 11x11 is invalid" },
+ { level: 0, width: 11, height: 12, expectation: gl.INVALID_OPERATION, message: "0: 11x12 is invalid" },
+ { level: 0, width: 12, height: 11, expectation: gl.INVALID_OPERATION, message: "0: 12x11 is invalid" },
+ { level: 0, width: 12, height: 12, expectation: gl.NO_ERROR, message: "0: 12x12 is valid" },
+ { level: 1, width: 0, height: 0, expectation: gl.NO_ERROR, message: "1: 0x0, is valid" },
+ { level: 1, width: 3, height: 3, expectation: gl.INVALID_OPERATION, message: "1: 3x3, is invalid" },
+ { level: 1, width: 5, height: 5, expectation: gl.INVALID_OPERATION, message: "1: 5x5, is invalid" },
+ { level: 1, width: 5, height: 6, expectation: gl.INVALID_OPERATION, message: "1: 5x6, is invalid" },
+ { level: 1, width: 6, height: 5, expectation: gl.INVALID_OPERATION, message: "1: 6x5, is invalid" },
+ { level: 1, width: 6, height: 6, expectation: gl.NO_ERROR, message: "1: 6x6, is valid" },
+ { level: 2, width: 0, height: 0, expectation: gl.NO_ERROR, message: "2: 0x0, is valid" },
+ { level: 2, width: 3, height: 3, expectation: gl.NO_ERROR, message: "2: 3x3, is valid" },
+ { level: 3, width: 1, height: 3, expectation: gl.NO_ERROR, message: "3: 1x3, is valid" },
+ { level: 3, width: 1, height: 1, expectation: gl.NO_ERROR, message: "3: 1x1, is valid" },
+ ]);
+
+ debug("");
+ debug("Testing partial updates");
+ ctu.testTexSubImageDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions, 12, 12,
+ [
+ { xoffset: 0, yoffset: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "height is not a multiple of 4" },
+ { xoffset: 0, yoffset: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "width is not a multiple of 4" },
+ { xoffset: 1, yoffset: 0, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "xoffset is not a multiple of 4" },
+ { xoffset: 0, yoffset: 1, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "yoffset is not a multiple of 4" },
+ { xoffset: 8, yoffset: 8, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ ]);
+
+ debug("");
+ debug("Testing immutable NPOT textures");
+ ctu.testTexStorageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { width: 12, height: 12, expectation: gl.NO_ERROR, message: "0: 12x12 is valid" },
+ { width: 6, height: 6, expectation: gl.NO_ERROR, message: "1: 6x6, is valid" },
+ { width: 3, height: 3, expectation: gl.NO_ERROR, message: "2: 3x3, is valid" },
+ { width: 1, height: 1, expectation: gl.NO_ERROR, message: "3: 1x1, is valid" },
+ ]);
+ }
+}
+
+function runTestRGTC() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 1,
+ data: img_4x4_r_bc4,
+ format: ext_rgtc.COMPRESSED_RED_RGTC1_EXT,
+ hasAlpha: false,
+ },
+ { width: 4,
+ height: 4,
+ channels: 1,
+ data: img_4x4_signed_r_bc4,
+ format: ext_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,
+ hasAlpha: false,
+ },
+ { width: 4,
+ height: 4,
+ channels: 2,
+ data: img_4x4_rg_bc5,
+ format: ext_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,
+ hasAlpha: false,
+ },
+ { width: 4,
+ height: 4,
+ channels: 2,
+ data: img_4x4_signed_rg_bc5,
+ format: ext_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,
+ hasAlpha: false,
+ error: 18, // Signed, so twice the normal error.
+ // Experimentally needed by e.g. RTX 3070.
+ },
+ { width: 8,
+ height: 8,
+ channels: 2,
+ data: img_8x8_r_bc4,
+ format: ext_rgtc.COMPRESSED_RED_RGTC1_EXT,
+ hasAlpha: false,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_r_bc4,
+ },
+ { width: 8,
+ height: 8,
+ channels: 2,
+ data: img_8x8_rg_bc5,
+ format: ext_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,
+ hasAlpha: false,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_rg_bc5,
+ },
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXT1_RGB() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 3,
+ data: img_4x4_rgba_dxt1,
+ format: ext.COMPRESSED_RGB_S3TC_DXT1_EXT,
+ hasAlpha: false,
+ },
+ { width: 8,
+ height: 8,
+ channels: 3,
+ data: img_8x8_rgba_dxt1,
+ format: ext.COMPRESSED_RGB_S3TC_DXT1_EXT,
+ hasAlpha: false,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_rgba_dxt1
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXT1_RGBA() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: img_4x4_rgba_dxt1,
+ format: ext.COMPRESSED_RGBA_S3TC_DXT1_EXT,
+ // This is a special case -- the texture is still opaque
+ // though it's RGBA.
+ hasAlpha: false,
+ },
+ { width: 8,
+ height: 8,
+ channels: 4,
+ data: img_8x8_rgba_dxt1,
+ format: ext.COMPRESSED_RGBA_S3TC_DXT1_EXT,
+ // This is a special case -- the texture is still opaque
+ // though it's RGBA.
+ hasAlpha: false,
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXT3_RGBA() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: img_4x4_rgba_dxt3,
+ format: ext.COMPRESSED_RGBA_S3TC_DXT3_EXT,
+ hasAlpha: true,
+ },
+ { width: 8,
+ height: 8,
+ channels: 4,
+ data: img_8x8_rgba_dxt3,
+ format: ext.COMPRESSED_RGBA_S3TC_DXT3_EXT,
+ hasAlpha: true,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_rgba_dxt3
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXT5_RGBA() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: img_4x4_rgba_dxt5,
+ format: ext.COMPRESSED_RGBA_S3TC_DXT5_EXT,
+ hasAlpha: true,
+ },
+ { width: 8,
+ height: 8,
+ channels: 4,
+ data: img_8x8_rgba_dxt5,
+ format: ext.COMPRESSED_RGBA_S3TC_DXT5_EXT,
+ hasAlpha: true,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_rgba_dxt5
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXTTextures(tests) {
+ debug("<hr/>");
+ for (var ii = 0; ii < tests.length; ++ii) {
+ testDXTTexture(tests[ii], false);
+ if (contextVersion >= 2) {
+ debug("<br/>");
+ testDXTTexture(tests[ii], true);
+ }
+ }
+}
+
+function uncompressDXTBlock(
+ destBuffer, destX, destY, destWidth, src, srcOffset, format) {
+ // Decoding routines follow D3D11 functional spec wrt
+ // endpoints unquantization and interpolation.
+ // Some hardware may produce slightly different values - it's normal.
+
+ function make565(src, offset) {
+ return src[offset + 0] + (src[offset + 1] << 8);
+ }
+ function make8888From565(c) {
+ // These values exactly match hw decoder when selectors are 0 or 1.
+ function replicateBits(v, w) {
+ return (v << (8 - w)) | (v >> (w + w - 8));
+ }
+ return [
+ replicateBits((c >> 11) & 0x1F, 5),
+ replicateBits((c >> 5) & 0x3F, 6),
+ replicateBits((c >> 0) & 0x1F, 5),
+ 255
+ ];
+ }
+ function mix(mult, c0, c1, div) {
+ var r = [];
+ for (var ii = 0; ii < c0.length; ++ii) {
+ // For green channel (6 bits), this interpolation exactly matches hw decoders
+
+ // For red and blue channels (5 bits), this interpolation exactly
+ // matches only some hw decoders and stays within acceptable range for others.
+ r[ii] = Math.floor((c0[ii] * mult + c1[ii]) / div + 0.5);
+ }
+ return r;
+ }
+ var isBC45 = ext_rgtc &&
+ (format == ext_rgtc.COMPRESSED_RED_RGTC1_EXT ||
+ format == ext_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT ||
+ format == ext_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT ||
+ format == ext_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT);
+ let colorOffset = srcOffset;
+ if (!isBC45) {
+ var isDXT1 = format == ext.COMPRESSED_RGB_S3TC_DXT1_EXT ||
+ format == ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ if (!isDXT1) {
+ colorOffset += 8;
+ }
+ var color0 = make565(src, colorOffset + 0);
+ var color1 = make565(src, colorOffset + 2);
+ var c0gtc1 = color0 > color1 || !isDXT1;
+ var rgba0 = make8888From565(color0);
+ var rgba1 = make8888From565(color1);
+ var colors = [
+ rgba0,
+ rgba1,
+ c0gtc1 ? mix(2, rgba0, rgba1, 3) : mix(1, rgba0, rgba1, 2),
+ c0gtc1 ? mix(2, rgba1, rgba0, 3) : [0, 0, 0, 255]
+ ];
+ }
+ const isSigned = ext_rgtc && (format == ext_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT || format == ext_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT);
+ const signedSrc = new Int8Array(src);
+
+ // yea I know there is a lot of math in this inner loop.
+ // so sue me.
+ for (var yy = 0; yy < 4; ++yy) {
+ var pixels = src[colorOffset + 4 + yy];
+ for (var xx = 0; xx < 4; ++xx) {
+ var dstOff = ((destY + yy) * destWidth + destX + xx) * 4;
+ if (!isBC45) {
+ var code = (pixels >> (xx * 2)) & 0x3;
+ var srcColor = colors[code];
+ }
+ var alpha;
+ var rgChannel2 = 0;
+ let decodeAlpha = (offset) => {
+ let alpha;
+ var alpha0 = (isSigned ? signedSrc : src)[offset + 0];
+ var alpha1 = (isSigned ? signedSrc : src)[offset + 1];
+ var alphaOff = (yy >> 1) * 3 + 2;
+ var alphaBits =
+ src[offset + alphaOff + 0] +
+ src[offset + alphaOff + 1] * 256 +
+ src[offset + alphaOff + 2] * 65536;
+ var alphaShift = (yy % 2) * 12 + xx * 3;
+ var alphaCode = (alphaBits >> alphaShift) & 0x7;
+ if (alpha0 > alpha1) {
+ switch (alphaCode) {
+ case 0:
+ alpha = alpha0;
+ break;
+ case 1:
+ alpha = alpha1;
+ break;
+ default:
+ alpha = Math.floor(((8 - alphaCode) * alpha0 + (alphaCode - 1) * alpha1) / 7.0 + 0.5);
+ break;
+ }
+ } else {
+ switch (alphaCode) {
+ case 0:
+ alpha = alpha0;
+ break;
+ case 1:
+ alpha = alpha1;
+ break;
+ case 6:
+ alpha = 0;
+ break;
+ case 7:
+ alpha = 255;
+ break;
+ default:
+ alpha = Math.floor(((6 - alphaCode) * alpha0 + (alphaCode - 1) * alpha1) / 5.0 + 0.5);
+ break;
+ }
+ }
+ return alpha;
+ }
+
+ switch (format) {
+ case ext.COMPRESSED_RGB_S3TC_DXT1_EXT:
+ alpha = 255;
+ break;
+ case ext.COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ alpha = (code == 3 && !c0gtc1) ? 0 : 255;
+ break;
+ case ext.COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ {
+ var alpha0 = src[srcOffset + yy * 2 + (xx >> 1)];
+ var alpha1 = (alpha0 >> ((xx % 2) * 4)) & 0xF;
+ alpha = alpha1 | (alpha1 << 4);
+ }
+ break;
+ case ext_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT:
+ case ext_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:
+ rgChannel2 = decodeAlpha(srcOffset + 8);
+ // FALLTHROUGH
+ case ext.COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ case ext_rgtc.COMPRESSED_RED_RGTC1_EXT:
+ case ext_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT:
+ alpha = decodeAlpha(srcOffset);
+ break;
+ default:
+ throw "bad format";
+ }
+ if (isBC45) {
+ destBuffer[dstOff + 0] = alpha;
+ destBuffer[dstOff + 1] = rgChannel2;
+ destBuffer[dstOff + 2] = 0;
+ destBuffer[dstOff + 3] = 255;
+ if (isSigned) {
+ destBuffer[dstOff + 0] = Math.max(0, alpha) * 2;
+ destBuffer[dstOff + 1] = Math.max(0, rgChannel2) * 2;
+ }
+ } else {
+ destBuffer[dstOff + 0] = srcColor[0];
+ destBuffer[dstOff + 1] = srcColor[1];
+ destBuffer[dstOff + 2] = srcColor[2];
+ destBuffer[dstOff + 3] = alpha;
+ }
+ }
+ }
+}
+
+function getBlockSize(format) {
+ var isDXT1 = format == ext.COMPRESSED_RGB_S3TC_DXT1_EXT ||
+ format == ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ var isBC4 = ext_rgtc && (format == ext_rgtc.COMPRESSED_RED_RGTC1_EXT || format == ext_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT);
+ return isDXT1 || isBC4 ? 8 : 16;
+}
+
+function uncompressDXT(width, height, data, format) {
+ if (width % 4 || height % 4) throw "bad width or height";
+
+ var dest = new Uint8Array(width * height * 4);
+ var blocksAcross = width / 4;
+ var blocksDown = height / 4;
+ var blockSize = getBlockSize(format);
+ for (var yy = 0; yy < blocksDown; ++yy) {
+ for (var xx = 0; xx < blocksAcross; ++xx) {
+ uncompressDXTBlock(
+ dest, xx * 4, yy * 4, width, data,
+ (yy * blocksAcross + xx) * blockSize, format);
+ }
+ }
+ return dest;
+}
+
+function uncompressDXTIntoSubRegion(width, height, subX0, subY0, subWidth, subHeight, data, format)
+{
+ if (width % 4 || height % 4 || subX0 % 4 || subY0 % 4 || subWidth % 4 || subHeight % 4)
+ throw "bad dimension";
+
+ var dest = new Uint8Array(width * height * 4);
+ // Zero-filled DXT1 or BC4/5 texture represents [0, 0, 0, 255]
+ if (format == ext.COMPRESSED_RGB_S3TC_DXT1_EXT || format == ext.COMPRESSED_RGBA_S3TC_DXT1_EXT ||
+ format == ext.COMPRESSED_RED_RGTC1_EXT || format == ext.COMPRESSED_SIGNED_RED_RGTC1_EXT ||
+ format == ext.COMPRESSED_RED_GREEN_RGTC2_EXT || format == ext.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT) {
+ for (var i = 3; i < dest.length; i += 4) dest[i] = 255;
+ }
+ var blocksAcross = subWidth / 4;
+ var blocksDown = subHeight / 4;
+ var blockSize = getBlockSize(format);
+ for (var yy = 0; yy < blocksDown; ++yy) {
+ for (var xx = 0; xx < blocksAcross; ++xx) {
+ uncompressDXTBlock(
+ dest, subX0 + xx * 4, subY0 + yy * 4, width, data,
+ (yy * blocksAcross + xx) * blockSize, format);
+ }
+ }
+ return dest;
+}
+
+function copyRect(data, srcX, srcY, dstX, dstY, width, height, stride) {
+ var bytesPerLine = width * 4;
+ var srcOffset = srcX * 4 + srcY * stride;
+ var dstOffset = dstX * 4 + dstY * stride;
+ for (; height > 0; --height) {
+ for (var ii = 0; ii < bytesPerLine; ++ii) {
+ data[dstOffset + ii] = data[srcOffset + ii];
+ }
+ srcOffset += stride;
+ dstOffset += stride;
+ }
+}
+
+function testDXTTexture(test, useTexStorage) {
+ test.error = test.error || DEFAULT_COLOR_ERROR;
+
+ var data = new Uint8Array(test.data);
+ var width = test.width;
+ var height = test.height;
+ var format = test.format;
+
+ var uncompressedData = uncompressDXT(width, height, data, format);
+
+ canvas.width = width;
+ canvas.height = height;
+ gl.viewport(0, 0, width, height);
+ debug("testing " + ctu.formatToString(ext, format) + " " + width + "x" + height +
+ (useTexStorage ? " via texStorage2D" : " via compressedTexImage2D"));
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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);
+ if (useTexStorage) {
+ if (test.subData) {
+ var uncompressedDataSub = uncompressDXTIntoSubRegion(
+ width, height, test.subX0, test.subY0, test.subWidth, test.subHeight, test.subData, format);
+ var tex1 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex1);
+ 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);
+
+ gl.texStorage2D(gl.TEXTURE_2D, 1, format, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed texture via texStorage2D");
+ gl.compressedTexSubImage2D(
+ gl.TEXTURE_2D, 0, test.subX0, test.subY0, test.subWidth, test.subHeight, format, test.subData);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture data via compressedTexSubImage2D");
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad 1");
+ compareRect(width, height, test.channels, uncompressedDataSub, "NEAREST", test.error);
+
+ // Clean up and recover
+ gl.deleteTexture(tex1);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ }
+
+ gl.texStorage2D(gl.TEXTURE_2D, 1, format, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed texture via texStorage2D");
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ var clearColor = (test.hasAlpha ? [0, 0, 0, 0] : [0, 0, 0, 255]);
+ wtu.checkCanvas(gl, clearColor, "texture should be initialized to black");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture data via compressedTexSubImage2D");
+ } else {
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture");
+ }
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "trying to generate mipmaps from compressed texture");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after clearing generateMipmap error");
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad 1");
+ compareRect(width, height, test.channels, uncompressedData, "NEAREST", test.error);
+ // Test again with linear filtering.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad 2");
+ compareRect(width, height, test.channels, uncompressedData, "LINEAR", test.error);
+
+ if (!useTexStorage) {
+ // It's not allowed to redefine textures defined via texStorage2D.
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 1, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "non 0 border");
+
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width + 4, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height + 4, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 4, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 4, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 1, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 2, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 1, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 2, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+
+ if (width == 4) {
+ // The width/height of the implied base level must be a multiple of the block size.
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, 1, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions for level > 0");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, 2, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "valid dimensions for level > 0");
+ }
+ if (height == 4) {
+ // The width/height of the implied base level must be a multiple of the block size.
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, width, 1, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions for level > 0");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, width, 2, 0, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "valid dimensions for level > 0");
+ }
+ }
+
+ // pick a wrong format that uses the same amount of data.
+ var wrongFormat;
+ switch (format) {
+ case ext.COMPRESSED_RGB_S3TC_DXT1_EXT:
+ wrongFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ break;
+ case ext.COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ wrongFormat = ext.COMPRESSED_RGB_S3TC_DXT1_EXT;
+ break;
+ case ext.COMPRESSED_RGBA_S3TC_DXT3_EXT:
+ wrongFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+ break;
+ case ext.COMPRESSED_RGBA_S3TC_DXT5_EXT:
+ wrongFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+ break;
+ case ext_rgtc.COMPRESSED_RED_RGTC1_EXT:
+ case ext_rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT:
+ wrongFormat = ext_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT;
+ break;
+ case ext_rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT:
+ case ext_rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:
+ wrongFormat = ext_rgtc.COMPRESSED_RED_RGTC1_EXT;
+ break;
+ }
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, wrongFormat, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "format does not match");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 4, 0, width, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "dimension out of range");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 4, width, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "dimension out of range");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width + 4, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height + 4, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width - 4, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height - 4, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width - 1, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width - 2, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height - 1, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height - 2, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+
+ var subData = new Uint8Array(data.buffer, 0, getBlockSize(format));
+
+ if (width == 8 && height == 8) {
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 1, 0, 4, 4, format, subData);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid offset");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 1, 4, 4, format, subData);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid offset");
+ }
+
+ var stride = width * 4;
+ for (var yoff = 0; yoff < height; yoff += 4) {
+ for (var xoff = 0; xoff < width; xoff += 4) {
+ copyRect(uncompressedData, 0, 0, xoff, yoff, 4, 4, stride);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, xoff, yoff, 4, 4, format, subData);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture");
+ // First test NEAREST filtering.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ wtu.clearAndDrawUnitQuad(gl);
+ compareRect(width, height, test.channels, uncompressedData, "NEAREST", test.error);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ // Next test LINEAR filtering.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ compareRect(width, height, test.channels, uncompressedData, "LINEAR", test.error);
+ }
+ }
+}
+
+function testDXT5_RGBA_PBO() {
+ debug("");
+ debug("testing PBO uploads");
+ var width = 8;
+ var height = 8;
+ var channels = 4;
+ var data = img_8x8_rgba_dxt5;
+ var format = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;
+ var uncompressedData = uncompressDXT(width, height, data, format);
+
+ var tex = gl.createTexture();
+
+ // First, PBO size = image size
+ var pbo1 = gl.createBuffer();
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo1);
+ gl.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a PBO");
+
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texStorage2D(gl.TEXTURE_2D, 1, format, width, height);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data.length, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a texture from a PBO");
+
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ compareRect(width, height, channels, uncompressedData, "NEAREST", DEFAULT_COLOR_ERROR);
+
+ // Clear the texture before the next test
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, new Uint8Array(data.length));
+
+ // Second, image is just a subrange of the PBO
+ var pbo2 = gl.createBuffer();
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo2);
+ gl.bufferData(gl.PIXEL_UNPACK_BUFFER, data.length*3, gl.STATIC_DRAW);
+ gl.bufferSubData(gl.PIXEL_UNPACK_BUFFER, data.length, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a PBO subrange");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data.length, data.length);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a texture from a PBO subrange");
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ compareRect(width, height, channels, uncompressedData, "NEAREST", DEFAULT_COLOR_ERROR);
+}
+
+function compareRect(width, height, channels, expectedData, filteringMode, colorError) {
+ var actual = new Uint8Array(width * height * 4);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, actual);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "reading back pixels");
+
+ var div = document.createElement("div");
+ div.className = "testimages";
+ ctu.insertCaptionedImg(div, "expected", ctu.makeScaledImage(width, height, width, expectedData, true));
+ ctu.insertCaptionedImg(div, "actual", ctu.makeScaledImage(width, height, width, actual, true));
+ div.appendChild(document.createElement('br'));
+ document.getElementById("console").appendChild(div);
+
+ var failed = false;
+ for (var yy = 0; yy < height; ++yy) {
+ for (var xx = 0; xx < width; ++xx) {
+ var offset = (yy * width + xx) * 4;
+ var expected = expectedData.slice(offset, offset + 4);
+ const was = actual.slice(offset, offset + 4);
+
+ // Compare RGB values
+ for (var jj = 0; jj < 3; ++jj) {
+ if (Math.abs(was[jj] - expected[jj]) > colorError) {
+ failed = true;
+ testFailed(`RGB at (${xx}, ${yy}) expected: ${expected}` +
+ ` +/- ${colorError}, was ${was}`);
+ break;
+ }
+ }
+
+ if (channels == 3) {
+ // BC1 RGB is allowed to be mapped to BC1 RGBA.
+ // In such a case, 3-color mode black value can be transparent:
+ // [0, 0, 0, 0] instead of [0, 0, 0, 255].
+
+ if (actual[offset + 3] != expected[3]) {
+ // Got non-opaque value for opaque format
+
+ // Check RGB values. Notice, that the condition here
+ // is more permissive than needed since we don't have
+ // compressed data at this point.
+ if (was[0] == 0 &&
+ was[1] == 0 &&
+ was[2] == 0 &&
+ was[3] == 0) {
+ debug("<b>DXT1 RGB is mapped to DXT1 RGBA</b>");
+ } else {
+ failed = true;
+ testFailed('Alpha at (' + xx + ', ' + yy +
+ ') expected: ' + expected[3] + ' was ' + was);
+ }
+ }
+ } else {
+ // Compare Alpha values
+ // Acceptable interpolation error depends on endpoints:
+ // 1.0 / 65535.0 + 0.03 * max(abs(endpoint0 - endpoint1), abs(endpoint0_p - endpoint1_p))
+ // For simplicity, assume the worst case (e0 is 0.0, e1 is 1.0). After conversion to unorm8, it is 8.
+ if (Math.abs(was[3] - expected[3]) > 8) {
+ failed = true;
+ testFailed('Alpha at (' + xx + ', ' + yy +
+ ') expected: ' + expected + ' +/- 8 was ' + was);
+ }
+ }
+ }
+ }
+ if (!failed) {
+ testPassed("texture rendered correctly with " + filteringMode + " filtering");
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-astc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-astc.html
new file mode 100644
index 0000000000..d737c3f2a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-astc.html
@@ -0,0 +1,2524 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compressed-texture-utils.js"></script>
+<title>WebGL WEBGL_compressed_texture_astc Conformance Tests</title>
+<style>
+img {
+ border: 1px solid black;
+ margin-right: 1em;
+}
+
+.testimages br {
+ clear: both;
+}
+
+.testimages > div {
+ float: left;
+ margin: 1em;
+}
+</style>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_compressed_texture_astc extension, if it is available.");
+
+debug("");
+
+// Compressed textures generated with ARM's ASTC encoder
+// https://github.com/ARM-software/astc-encoder
+
+// The data below is printed directly from the astc file,
+// and the header has been left for clarity reasons.
+
+// LDR encoded with the following command line:
+// 'astcenc -c source.png result.astc {blockSize} -medium'
+
+// The image used for LDR compression can be found
+// at sdk/tests/resources/red-green-hard.png
+
+var astc_4x4_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x4, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0x0,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x42, 0x2, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+]);
+var astc_5x4_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x92, 0x48, 0x22, 0x9,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x0, 0x0, 0x20, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x0, 0x40, 0x0, 0x80,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xc1, 0x2, 0x1, 0x2, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
+]);
+var astc_5x5_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xf3, 0x0, 0x81, 0xff, 0x7, 0x0, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xf3, 0x0, 0x7f, 0x0, 0xf8, 0x1, 0xe0, 0xff, 0xf1, 0xff, 0xf8, 0x7f, 0x0, 0x0, 0x0, 0x0,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff,
+]);
+var astc_6x5_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x49, 0x29, 0x29, 0x25, 0xa5, 0xa4, 0x94, 0x94, 0x12,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x0, 0x28, 0x0, 0x24, 0x0, 0xa4, 0x94, 0x94, 0x92,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x0, 0x48, 0x1, 0x28, 0x1, 0xa4, 0x0, 0x94, 0x0, 0x92,
+]);
+var astc_6x6_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xc3, 0x30, 0xfc,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xe3, 0xf8, 0xff, 0xff,
+]);
+var astc_8x5_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xf, 0xff, 0xf, 0xff, 0xf, 0xff, 0xff, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x66, 0x0, 0x3f, 0x0, 0x1f, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0, 0x3, 0x0,
+]);
+var astc_8x6_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0xf8, 0x7f, 0x56, 0x3f, 0x72, 0x7f, 0x7f,
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x3f, 0x72, 0x78, 0x7f, 0x70, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x50, 0x7f, 0x72, 0xfe, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
+]);
+var astc_8x8_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc,
+ 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f,
+]);
+var astc_10x5_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x65, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x65, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x0, 0xfc, 0xf0, 0xc3, 0xff, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x65, 0x1, 0xff, 0x1, 0x0, 0xfe, 0x1, 0x0, 0x0, 0xc0, 0x7, 0x1f, 0x7c, 0xf0, 0xc1, 0x7,
+]);
+var astc_10x6_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xa4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xa4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xf0, 0xc3, 0xf, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xa4, 0x1, 0x1, 0xfe, 0xff, 0x1, 0x0, 0x0, 0x0, 0x3e, 0xf8, 0xe0, 0xff, 0xff, 0xff, 0xff,
+]);
+var astc_10x8_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x65, 0x9, 0x69, 0x35, 0x0, 0x8, 0x10, 0x2, 0x0, 0x0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x6, 0x11, 0x69, 0x2d, 0x80, 0x40, 0x2, 0x80, 0x4, 0x0, 0x8, 0x0, 0xff, 0xf, 0xf0, 0xff,
+ 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+]);
+var astc_10x10_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xa4, 0xc9, 0xc, 0x3, 0x22, 0x0, 0x8, 0x40, 0x8, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x45, 0x89, 0x7, 0x35, 0x0, 0x40, 0x10, 0x0, 0x20, 0x0, 0x0, 0x1f, 0x7c, 0xf0, 0xc1, 0xff,
+]);
+var astc_12x10_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x64, 0x8, 0x11, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xe5, 0x10, 0x4a, 0x4d, 0x46, 0x7f, 0x0, 0xc0, 0xf, 0x40, 0xf8, 0x1, 0x39, 0xf1, 0x7, 0x0,
+]);
+var astc_12x12_argb_ldr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xc, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x64, 0xa8, 0x21, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x84, 0xd8, 0xe9, 0x2e, 0x0, 0x0, 0x1, 0x0, 0x80, 0xc0, 0x80, 0x28, 0x2a, 0xab, 0x2a, 0xff,
+]);
+
+// HDR encoded with the following command line:
+// 'astcenc -c source.hdr result.astc {blockSize} -medium'
+
+// The image used for HDR compression can be found
+// at sdk/tests/resources/red-green-hard.hdr
+
+var astc_4x4_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x4, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x42, 0x2, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x42, 0x2, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x42, 0x2, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x42, 0x2, 0x83, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0,
+ 0x42, 0x2, 0x83, 0x0, 0x0, 0x41, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0x0, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x42, 0x2, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+]);
+var astc_5x4_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x4, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x92, 0x48, 0x22, 0x9,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x0, 0x0, 0x20, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x80, 0x48, 0x22, 0x89, 0x24, 0x0, 0x40, 0x0, 0x80,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xc1, 0x2, 0x1, 0x42, 0x21, 0x0, 0x0, 0x0, 0x0, 0x0, 0x89, 0x24, 0x92, 0x48, 0x22, 0x89,
+]);
+var astc_5x5_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x5, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xf3, 0x0, 0x81, 0xff, 0x7, 0x0, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xf3, 0x0, 0x81, 0xff, 0x7, 0x0, 0x0, 0x0, 0xe, 0x0, 0x7, 0x80, 0xff, 0xff, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff,
+]);
+var astc_6x5_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x49, 0x29, 0x29, 0x25, 0xa5, 0xa4, 0x94, 0x94, 0x12,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x48, 0x0, 0x28, 0x0, 0x24, 0x0, 0xa4, 0x94, 0x94, 0x92,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x63, 0x1, 0x81, 0x10, 0x0, 0x0, 0x0, 0x48, 0x1, 0x28, 0x1, 0xa4, 0x0, 0x94, 0x0, 0x92,
+]);
+var astc_6x6_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x6, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xc3, 0x30, 0xfc,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xe3, 0xf8, 0xff, 0xff,
+]);
+var astc_8x5_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xf0, 0xff, 0xf0, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xff, 0xf, 0xff, 0xf, 0xff, 0xf, 0xff, 0xff, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x66, 0x0, 0xc1, 0xff, 0x0, 0x0, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0xff,
+]);
+var astc_8x6_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0xf8, 0x7f, 0x56, 0x3f, 0x72, 0x7f, 0x7f,
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x70, 0x7f, 0x7f, 0x7f, 0x3f, 0x72, 0x78, 0x7f, 0x70, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x54, 0x1, 0x81, 0x20, 0x0, 0x0, 0x50, 0x7f, 0x72, 0xfe, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
+]);
+var astc_8x8_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0x8, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x44, 0x5, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0x44, 0x5, 0x81, 0x3, 0x82, 0x0, 0x0, 0x0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x44, 0x5, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfc,
+ 0x44, 0x5, 0x1, 0x82, 0x82, 0x0, 0x0, 0x0, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f,
+]);
+var astc_10x5_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x5, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x65, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x65, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0xfc, 0xf0, 0xc3, 0xff, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x65, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x0, 0xf8, 0xe0, 0x83, 0xf, 0x3e, 0xf8,
+]);
+var astc_10x6_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x6, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xa4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xa4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xf0, 0xc3, 0xf, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xa4, 0x1, 0x1, 0xfc, 0xfd, 0x1, 0x0, 0x0, 0x0, 0x3e, 0xf8, 0xe0, 0xff, 0xff, 0xff, 0xff,
+]);
+var astc_10x8_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0x8, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x65, 0x9, 0x69, 0x35, 0x0, 0x8, 0x10, 0x2, 0x0, 0x0, 0xfc, 0xe0, 0x3, 0x0, 0x0, 0x0,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x15, 0x11, 0x69, 0x25, 0x0, 0x84, 0x0, 0x10, 0x0, 0x2, 0x40, 0x88, 0x3f, 0x0, 0x3f, 0x0,
+ 0x44, 0x5, 0x1, 0x2, 0x2, 0x0, 0x0, 0x0, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+]);
+var astc_10x10_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xa, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0xa4, 0xc9, 0xc, 0x3, 0x22, 0x0, 0x8, 0x40, 0x8, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x45, 0x89, 0x7, 0x35, 0x0, 0x40, 0x0, 0x82, 0x0, 0x0, 0x0, 0xe0, 0x83, 0xf, 0x3e, 0x0,
+]);
+var astc_12x10_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xa, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x64, 0x8, 0x11, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x44, 0x10, 0x4a, 0x49, 0x46, 0xf, 0x1c, 0x3f, 0x0, 0x28, 0xff, 0x1, 0xc0, 0x3f, 0xc, 0x0,
+]);
+var astc_12x12_argb_hdr = new Uint8Array([
+ //0x13, 0xab, 0xa1, 0x5c, 0xc, 0xc, 0x1, 0x10, 0x0, 0x0, 0x10, 0x0, 0x0, 0x1, 0x0, 0x0, HEADER
+ 0x64, 0xa8, 0x21, 0x3, 0x22, 0x0, 0x8, 0x40, 0x38, 0xfc, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x7f,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0xfc, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff,
+ 0x4, 0xd8, 0xe9, 0x2e, 0x0, 0x8, 0x1, 0x40, 0x80, 0xc0, 0x81, 0x28, 0x2a, 0x0, 0x0, 0x0,
+]);
+
+// Decoded ASTC textures generated with ARM's ASTC encoder
+// https://github.com/ARM-software/astc-encoder
+
+// As the original image is quite simple to compress,
+// several decoded images share the same data
+
+// LDR decoded with the following command line:
+// 'astcenc -d source.astc result.tga'
+var decoded_4x4To10x6_argb_ldr = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+var decoded_10x8_argb_ldr = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xdf, 0x20, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+var decoded_10x10_argb_ldr = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff,
+ 0x20, 0xdf, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x8f, 0x70, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+var decoded_12x10_argb_ldr = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xdf, 0x20, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+var decoded_12x12_argb_ldr = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff,
+ 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff,
+ 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff,
+ 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xbf, 0x40, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x60, 0x9f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+
+var decoded_10x8_argb_ldr_srgb = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xbc, 0x4, 0x0, 0xff, 0x4, 0xbc, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+var decoded_10x10_argb_ldr_srgb = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x4, 0xbc, 0x0, 0xff, 0x4, 0xbc, 0x0, 0xff,
+ 0x4, 0xbc, 0x0, 0xff, 0x4, 0xbc, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x46, 0x29, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+var decoded_12x10_argb_ldr_srgb = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xbc, 0x4, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x29, 0x46, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+var decoded_12x12_argb_ldr_srgb = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x1, 0xdc, 0x0, 0xff, 0x1, 0xdc, 0x0, 0xff,
+ 0x1, 0xdc, 0x0, 0xff, 0x1, 0xdc, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x29, 0x46, 0x0, 0xff, 0x29, 0x46, 0x0, 0xff,
+ 0x29, 0x46, 0x0, 0xff, 0x29, 0x46, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x9f, 0x8, 0x0, 0xff, 0x9f, 0x8, 0x0, 0xff,
+ 0x9f, 0x8, 0x0, 0xff, 0x9f, 0x8, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x85, 0xd, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x1e, 0x58, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+]);
+
+// HDR decoded with the following command line:
+// 'astcenc -d source.astc result.tga'
+
+var decoded_4x4_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfd, 0x0, 0xff, 0x0, 0xfd, 0x0, 0xff,
+ 0x0, 0xfd, 0x0, 0xff, 0x0, 0xfd, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_5x4_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_5x5_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_6x5_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_6x6_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_8x5_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_8x6_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_8x8_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfd, 0x0, 0xff, 0x0, 0xfd, 0x0, 0xff,
+ 0x0, 0xfd, 0x0, 0xff, 0x0, 0xfd, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xfd, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+
+var decoded_10x5To10x6_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xfe, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+
+var decoded_10x8_argb_hdr = new Uint8Array([
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xdf, 0x20, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_10x10_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff,
+ 0x20, 0xdf, 0x0, 0xff, 0x20, 0xdf, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x8f, 0x70, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_12x10_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xdf, 0x20, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+var decoded_12x12_argb_hdr = new Uint8Array([
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0x0, 0xfe, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff,
+ 0x10, 0xef, 0x0, 0xff, 0x10, 0xef, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff,
+ 0x70, 0x8f, 0x0, 0xff, 0x70, 0x8f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff,
+ 0xcf, 0x30, 0x0, 0xff, 0xcf, 0x30, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0xbf, 0x40, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x60, 0x9f, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+ 0x0, 0xff, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff,
+ 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff, 0xfe, 0x0, 0x0, 0xff,
+]);
+
+var wtu = WebGLTestUtils;
+var ctu = CompressedTextureUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+var program = wtu.setupTexturedQuad(gl);
+var nanToMagentaProgram2D, nanToMagentaProgram2DArray, nanToMagentaProgram3D;
+var program2DArray, program3D;
+
+gl.useProgram(program);
+
+var extFlag = "WEBGL_compressed_texture_astc";
+var ext = null;
+var vao = null;
+var validFormats = {
+
+ COMPRESSED_RGBA_ASTC_4x4_KHR : 0x93B0,
+ COMPRESSED_RGBA_ASTC_5x4_KHR : 0x93B1,
+ COMPRESSED_RGBA_ASTC_5x5_KHR : 0x93B2,
+ COMPRESSED_RGBA_ASTC_6x5_KHR : 0x93B3,
+ COMPRESSED_RGBA_ASTC_6x6_KHR : 0x93B4,
+ COMPRESSED_RGBA_ASTC_8x5_KHR : 0x93B5,
+ COMPRESSED_RGBA_ASTC_8x6_KHR : 0x93B6,
+ COMPRESSED_RGBA_ASTC_8x8_KHR : 0x93B7,
+ COMPRESSED_RGBA_ASTC_10x5_KHR : 0x93B8,
+ COMPRESSED_RGBA_ASTC_10x6_KHR : 0x93B9,
+ COMPRESSED_RGBA_ASTC_10x8_KHR : 0x93BA,
+ COMPRESSED_RGBA_ASTC_10x10_KHR : 0x93BB,
+ COMPRESSED_RGBA_ASTC_12x10_KHR : 0x93BC,
+ COMPRESSED_RGBA_ASTC_12x12_KHR : 0x93BD,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : 0x93D0,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : 0x93D1,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : 0x93D2,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : 0x93D3,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : 0x93D4,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : 0x93D5,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : 0x93D6,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : 0x93D7,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : 0x93D8,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : 0x93D9,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : 0x93DA,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : 0x93DB,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : 0x93DC,
+ COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : 0x93DD
+
+};
+var name;
+
+const errorColor = [255, 0, 255, 255];
+let hasHdr = false;
+
+var check2DTarget = 1;
+var check2DArrayTarget = 1;
+var check3DTarget = 1;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // The texture size 3 * 5 * 8 below is divisible by all the different block sizes supported by the extension.
+ ctu.testCompressedFormatsUnavailableWhenExtensionDisabled(gl, validFormats, expectedByteLength, 3 * 5 * 8);
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, extFlag);
+ if (!ext) {
+ testPassed("No WEBGL_compressed_texture_astc support -- this is legal");
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_astc", false);
+ } else {
+ testPassed("Successfully enabled WEBGL_compressed_texture_astc extension");
+
+ debug("");
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_astc", true);
+ runTestExtension();
+ }
+}
+
+function runTestExtension() {
+ debug("");
+ debug("Testing " + extFlag);
+
+ // Test that enum values are listed correctly in supported formats and in the extension object.
+ ctu.testCompressedFormatsListed(gl, validFormats);
+ ctu.testCorrectEnumValuesInExt(ext, validFormats);
+ // Test that texture upload buffer size is validated correctly.
+ ctu.testFormatRestrictionsOnBufferSize(gl, validFormats, expectedByteLength, getBlockDimensions);
+
+ if (contextVersion >= 2) {
+ // For LDR and non-sRGB formats, the error color is magenta *or* all NaNs. To
+ // make sure we accept this we create a program that transforms an all NaN
+ // sampling result to magenta.
+
+ nanToMagentaProgram2D = wtu.setupSimpleTextureProgramESSL300(gl, undefined, undefined,
+ `#version 300 es
+ precision mediump float;
+ uniform sampler2D tex;
+ in vec2 texCoord;
+ out vec4 out_color;
+ void main() {
+ vec4 c = texture(tex, texCoord);
+ if (all(isnan(c))) {
+ out_color = vec4(1, 0, 1, 1);
+ } else {
+ out_color = c;
+ }
+ }`
+ );
+
+ nanToMagentaProgram2DArray = wtu.setupSimpleTextureProgramESSL300(gl, undefined, undefined,
+ `#version 300 es
+ precision mediump float;
+ uniform mediump sampler2DArray tex;
+ in vec2 texCoord;
+ out vec4 out_color;
+ void main() {
+ vec4 c = texture(tex, vec3(texCoord, 0));
+ if (all(isnan(c))) {
+ out_color = vec4(1, 0, 1, 1);
+ } else {
+ out_color = c;
+ }
+ }`
+ );
+
+ nanToMagentaProgram3D = wtu.setupSimpleTextureProgramESSL300(gl, undefined, undefined,
+ `#version 300 es
+ precision mediump float;
+ uniform mediump sampler3D tex;
+ in vec2 texCoord;
+ out vec4 out_color;
+ void main() {
+ vec4 c = texture(tex, vec3(texCoord, 0));
+ if (all(isnan(c))) {
+ out_color = vec4(1, 0, 1, 1);
+ } else {
+ out_color = c;
+ }
+ }`
+ );
+
+ program2DArray = wtu.setupSimpleTextureProgramESSL300(gl, undefined, undefined,
+ `#version 300 es
+ precision mediump float;
+ uniform mediump sampler2DArray tex;
+ in vec2 texCoord;
+ out vec4 out_color;
+ void main() {
+ out_color = texture(tex, vec3(texCoord, 0));
+ }`
+ );
+
+ program3D = wtu.setupSimpleTextureProgramESSL300(gl, undefined, undefined,
+ `#version 300 es
+ precision mediump float;
+ uniform mediump sampler3D tex;
+ in vec2 texCoord;
+ out vec4 out_color;
+ void main() {
+ out_color = texture(tex, vec3(texCoord, 0));
+ }`
+ );
+ }
+
+ // Query supported profiles and test ASTC texture with appropriate formats
+ var profiles = ext.getSupportedProfiles();
+ // Check for HDR support first, since it affects sliced 3D support for LDR
+ if (profiles.indexOf("hdr") != -1) {
+ hasHdr = true;
+ testHDRTextures();
+ } else {
+ testPassed("HDR profile is not supported.");
+ }
+
+ if (profiles.indexOf("ldr") != -1) {
+ testLDRTextures();
+ } else {
+ testFailed('LDR profile must be supported.');
+ }
+}
+
+function testLDRTextures() {
+ debug("");
+ debug("Testing every LDR texture format compression");
+
+ var data = [];
+ var formats = [];
+ var sRGBformats = [];
+ var raws = [];
+ var sRGBraws = [];
+
+ data.push(astc_4x4_argb_ldr, astc_5x4_argb_ldr, astc_5x5_argb_ldr,
+ astc_6x5_argb_ldr, astc_6x6_argb_ldr, astc_8x5_argb_ldr,
+ astc_8x6_argb_ldr, astc_8x8_argb_ldr, astc_10x5_argb_ldr,
+ astc_10x6_argb_ldr, astc_10x8_argb_ldr, astc_10x10_argb_ldr,
+ astc_12x10_argb_ldr, astc_12x12_argb_ldr);
+
+ formats.push(ext.COMPRESSED_RGBA_ASTC_4x4_KHR, ext.COMPRESSED_RGBA_ASTC_5x4_KHR,
+ ext.COMPRESSED_RGBA_ASTC_5x5_KHR, ext.COMPRESSED_RGBA_ASTC_6x5_KHR,
+ ext.COMPRESSED_RGBA_ASTC_6x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x5_KHR,
+ ext.COMPRESSED_RGBA_ASTC_8x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x8_KHR,
+ ext.COMPRESSED_RGBA_ASTC_10x5_KHR, ext.COMPRESSED_RGBA_ASTC_10x6_KHR,
+ ext.COMPRESSED_RGBA_ASTC_10x8_KHR, ext.COMPRESSED_RGBA_ASTC_10x10_KHR,
+ ext.COMPRESSED_RGBA_ASTC_12x10_KHR, ext.COMPRESSED_RGBA_ASTC_12x12_KHR);
+
+ sRGBformats.push(ext.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, ext.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
+ ext.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, ext.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
+ ext.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, ext.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
+ ext.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, ext.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
+ ext.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, ext.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
+ ext.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, ext.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
+ ext.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, ext.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR);
+
+ // adds decoded image to use in the compare function
+ // certain block size share the same decoded data
+ // due to the fact that the test image is quite simple
+ for (var i = 0; i < 10; ++i)
+ raws.push(decoded_4x4To10x6_argb_ldr);
+ raws.push(decoded_10x8_argb_ldr, decoded_10x10_argb_ldr, decoded_12x10_argb_ldr, decoded_12x12_argb_ldr);
+
+ // Given that test images mostly use 0 and 255, sRGB decoding is the same as linear for 4x4 - 10x6 images
+ for (var i = 0; i < 10; ++i)
+ sRGBraws.push(decoded_4x4To10x6_argb_ldr);
+ sRGBraws.push(decoded_10x8_argb_ldr_srgb, decoded_10x10_argb_ldr_srgb, decoded_12x10_argb_ldr_srgb, decoded_12x12_argb_ldr_srgb);
+
+ testASTCTextures(buildTests(data, formats, raws, 'LDR'));
+ testASTCTextures(buildTests(data, sRGBformats, sRGBraws, 'LDR-sRGB'));
+}
+
+function testHDRTextures() {
+ debug("");
+ debug("Testing every HDR texture format compression");
+
+
+ var data = [];
+ var formats = [];
+ var raws = [];
+
+ data.push(astc_4x4_argb_hdr, astc_5x4_argb_hdr, astc_5x5_argb_hdr,
+ astc_6x5_argb_hdr, astc_6x6_argb_hdr, astc_8x5_argb_hdr,
+ astc_8x6_argb_hdr, astc_8x8_argb_hdr, astc_10x5_argb_hdr,
+ astc_10x6_argb_hdr, astc_10x8_argb_hdr, astc_10x10_argb_hdr,
+ astc_12x10_argb_hdr, astc_12x12_argb_hdr);
+
+ formats.push(ext.COMPRESSED_RGBA_ASTC_4x4_KHR, ext.COMPRESSED_RGBA_ASTC_5x4_KHR,
+ ext.COMPRESSED_RGBA_ASTC_5x5_KHR, ext.COMPRESSED_RGBA_ASTC_6x5_KHR,
+ ext.COMPRESSED_RGBA_ASTC_6x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x5_KHR,
+ ext.COMPRESSED_RGBA_ASTC_8x6_KHR, ext.COMPRESSED_RGBA_ASTC_8x8_KHR,
+ ext.COMPRESSED_RGBA_ASTC_10x5_KHR, ext.COMPRESSED_RGBA_ASTC_10x6_KHR,
+ ext.COMPRESSED_RGBA_ASTC_10x8_KHR, ext.COMPRESSED_RGBA_ASTC_10x10_KHR,
+ ext.COMPRESSED_RGBA_ASTC_12x10_KHR, ext.COMPRESSED_RGBA_ASTC_12x12_KHR);
+
+ // adds decoded image to use in the compare function
+ // certain block size share the same decoded data
+ // due to the fact that the test image is quite simple
+ raws.push(decoded_4x4_argb_hdr, decoded_5x4_argb_hdr, decoded_5x5_argb_hdr, decoded_6x5_argb_hdr,
+ decoded_6x6_argb_hdr, decoded_8x5_argb_hdr, decoded_8x6_argb_hdr, decoded_8x8_argb_hdr,
+ decoded_10x5To10x6_argb_hdr, decoded_10x5To10x6_argb_hdr, decoded_10x8_argb_hdr,
+ decoded_10x10_argb_hdr, decoded_12x10_argb_hdr, decoded_12x12_argb_hdr);
+
+ testASTCTextures(buildTests(data, formats, raws, 'HDR'));
+}
+
+function testASTCTextures(tests) {
+ debug("<hr/>");
+ for (var i = 0; i < tests.length; ++i) {
+ testASTCTexture(tests[i], contextVersion >= 2);
+ }
+}
+
+function testASTCTexture(test, useES3) {
+ var data = test.data;
+ var width = test.width;
+ var height = test.height;
+ var format = test.format;
+ var raw = test.raw;
+
+ canvas.width = width;
+ canvas.height = height;
+ gl.viewport(0, 0, width, height);
+ debug("");
+ debug("testing " + ctu.formatToString(ext, format) + " " + width + "x" + height + " (" + test.mode + ")" +
+ (useES3 ? " via ES 3.0 entrypoints" : " via compressedTexImage2D"));
+ debug("");
+
+ function errorColorMaybeNaN() {
+ return format >= ext.COMPRESSED_RGBA_ASTC_4x4_KHR && format <= ext.COMPRESSED_RGBA_ASTC_12x12_KHR;
+ }
+
+ function ensureParameters(target) {
+ gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ }
+
+ function setupEmptyTexture(target, useStorage) {
+ var tex = gl.createTexture();
+ gl.bindTexture(target, tex);
+ ensureParameters(target);
+
+ if (target == gl.TEXTURE_2D) {
+ if (useStorage) {
+ gl.texStorage2D(target, 1, format, width, height);
+ } else {
+ gl.compressedTexImage2D(target, 0, format, width, height, 0, new Uint8Array(data.length));
+ }
+ } else if (target == gl.TEXTURE_2D_ARRAY || target == gl.TEXTURE_3D) {
+ if (useStorage) {
+ gl.texStorage3D(target, 1, format, width, height, 1);
+ } else {
+ gl.compressedTexImage3D(target, 0, format, width, height, 1, 0, new Uint8Array(data.length));
+ }
+ }
+
+ return tex; // Keep reference to the texture so it could be deleted
+ }
+
+ function uploadSubData(target) {
+ function checkResult(target, expectations, dim) {
+ switch (target) {
+ case gl.TEXTURE_2D:
+ wtu.glErrorShouldBe(gl, expectations[0], "uploading compressed 2D texture data via compressedTexSubImage" + dim);
+ break;
+ case gl.TEXTURE_2D_ARRAY:
+ wtu.glErrorShouldBe(gl, expectations[1], "uploading compressed 2D array texture data via compressedTexSubImage" + dim);
+ break;
+ case gl.TEXTURE_3D:
+ wtu.glErrorShouldBe(gl, expectations[2], "uploading compressed 3D texture data via compressedTexSubImage" + dim);
+ break;
+ }
+ }
+
+ gl.compressedTexSubImage2D(target, 0, 0, 0, width, height, format, data);
+ checkResult(target, [gl.NO_ERROR, gl.INVALID_ENUM, gl.INVALID_ENUM ], "2D");
+
+ if (useES3) {
+ gl.compressedTexSubImage3D(target, 0, 0, 0, 0, width, height, 1, format, data);
+ checkResult(target, [gl.INVALID_ENUM, gl.NO_ERROR, gl.NO_ERROR], "3D");
+ }
+ }
+
+ function setupFilledTexture(target) {
+ var tex = gl.createTexture();
+ gl.bindTexture(target, tex);
+ ensureParameters(target);
+
+ if (target == gl.TEXTURE_2D) {
+ gl.compressedTexImage2D(target, 0, format, width, height, 1, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "non 0 border");
+
+ gl.compressedTexImage2D(target, 0, format, width, height, 0, data);
+ } else if (target == gl.TEXTURE_2D_ARRAY || target == gl.TEXTURE_3D) {
+ gl.compressedTexImage3D(target, 0, format, width, height, 1, 0, data);
+ }
+
+ return tex; // Keep reference to the texture so it could be deleted
+ }
+
+ function switchProgram(target) {
+ // For LDR non-sRGB and HDR formats, we accept all NaNs as a valid result.
+ // This program transforms all NaNs to the normal error color, magenta.
+
+ // There's no 100% reliable way to check NaN values on ESSL 1.0,
+ // so error color is verified only on ESSL 3.0.
+
+ if (errorColorMaybeNaN()) {
+ if (target == gl.TEXTURE_2D) {
+ gl.useProgram(nanToMagentaProgram2D);
+ } else if (target == gl.TEXTURE_2D_ARRAY) {
+ gl.useProgram(nanToMagentaProgram2DArray);
+ } else if (target == gl.TEXTURE_3D) {
+ gl.useProgram(nanToMagentaProgram3D);
+ }
+ } else {
+ if (target == gl.TEXTURE_2D) {
+ gl.useProgram(program);
+ } else if (target == gl.TEXTURE_2D_ARRAY) {
+ gl.useProgram(program2DArray);
+ } else if (target == gl.TEXTURE_3D) {
+ gl.useProgram(program3D);
+ }
+ }
+ }
+
+ function checkErrorColor() {
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad from empty texture");
+ wtu.checkCanvas(gl, errorColor, "texture should be initialized to error color");
+ }
+
+ function checkSampling(target) {
+ // Check that the decoded image is consistent with NEAREST filtering
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing quad with NEAREST filtering");
+ compareRect(width, height, test.channels, width, height, raw, data, format, undefined, "NEAREST");
+
+ // Check that the decoded image is consistent with LINEAR filtering
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing quad with LINEAR filtering");
+ compareRect(width, height, test.channels, width, height, raw, data, format, undefined, "LINEAR");
+
+ debug("");
+ // Mipmaps handling
+ gl.generateMipmap(target);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "trying to generate mipmaps from compressed texture");
+ }
+
+ var tex;
+
+ if (useES3) {
+ // 2D texture
+ if (check2DTarget) {
+ switchProgram(gl.TEXTURE_2D);
+
+ // immutable
+ tex = setupEmptyTexture(gl.TEXTURE_2D, true);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed texture via texStorage2D");
+ checkErrorColor();
+ uploadSubData(gl.TEXTURE_2D);
+ checkSampling(gl.TEXTURE_2D)
+ gl.deleteTexture(tex);
+
+ // mutable empty
+ tex = setupEmptyTexture(gl.TEXTURE_2D, false);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating empty compressed texture via compressedTexImage2D");
+ checkErrorColor();
+ uploadSubData(gl.TEXTURE_2D);
+ checkSampling(gl.TEXTURE_2D)
+ gl.deleteTexture(tex);
+
+ // mutable filled
+ tex = setupFilledTexture(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating filled compressed texture via compressedTexImage2D");
+ checkSampling(gl.TEXTURE_2D)
+ gl.deleteTexture(tex);
+ }
+
+ // 2D array
+ if (check2DArrayTarget) {
+ switchProgram(gl.TEXTURE_2D_ARRAY);
+
+ // immutable
+ tex = setupEmptyTexture(gl.TEXTURE_2D_ARRAY, true);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed texture array via texStorage3D");
+ checkErrorColor();
+ uploadSubData(gl.TEXTURE_2D_ARRAY);
+ checkSampling(gl.TEXTURE_2D_ARRAY)
+ gl.deleteTexture(tex);
+
+ // mutable empty
+ tex = setupEmptyTexture(gl.TEXTURE_2D_ARRAY, false);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating empty compressed texture array via compressedTexImage3D");
+ checkErrorColor();
+ uploadSubData(gl.TEXTURE_2D_ARRAY);
+ checkSampling(gl.TEXTURE_2D_ARRAY)
+ gl.deleteTexture(tex);
+
+ // mutable filled
+ tex = setupFilledTexture(gl.TEXTURE_2D_ARRAY);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating filled compressed texture array via compressedTexImage3D");
+ checkSampling(gl.TEXTURE_2D_ARRAY)
+ gl.deleteTexture(tex);
+ }
+
+ // 3D texture
+ if (check3DTarget) {
+ switchProgram(gl.TEXTURE_3D);
+ // immutable
+ tex = setupEmptyTexture(gl.TEXTURE_3D, true);
+ if (hasHdr) {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed sliced 3D texture via texStorage3D");
+ checkErrorColor();
+ uploadSubData(gl.TEXTURE_3D);
+ checkSampling(gl.TEXTURE_3D)
+ } else {
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "allocating compressed sliced 3D texture via texStorage3D");
+ }
+ gl.deleteTexture(tex);
+
+ // mutable empty
+ tex = setupEmptyTexture(gl.TEXTURE_3D, false);
+ if (hasHdr) {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating empty compressed sliced 3D texture via compressedTexImage3D");
+ checkErrorColor();
+ uploadSubData(gl.TEXTURE_3D);
+ checkSampling(gl.TEXTURE_3D)
+ } else {
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "allocating empty compressed sliced 3D texture via compressedTexImage3D");
+ }
+ gl.deleteTexture(tex);
+
+ // mutable filled
+ tex = setupFilledTexture(gl.TEXTURE_3D);
+ if (hasHdr) {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating filled compressed sliced 3D texture via compressedTexImage3D");
+ checkSampling(gl.TEXTURE_3D)
+ } else {
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "allocating filled compressed sliced 3D texture via compressedTexImage3D");
+ }
+ gl.deleteTexture(tex);
+ }
+ } else {
+ // 2D texture
+ if (check2DTarget) {
+ // mutable empty
+ tex = setupEmptyTexture(gl.TEXTURE_2D, false);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating empty compressed texture via compressedTexImage2D");
+
+ // Skip error color check on HDR and non-sRGB formats on WebGL 1.0
+ if (!errorColorMaybeNaN()) checkErrorColor();
+ uploadSubData(gl.TEXTURE_2D);
+ checkSampling(gl.TEXTURE_2D)
+ gl.deleteTexture(tex);
+
+ // mutable filled
+ tex = setupFilledTexture(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating filled compressed texture via compressedTexImage2D");
+ checkSampling(gl.TEXTURE_2D)
+ gl.deleteTexture(tex);
+ }
+ }
+}
+
+function compareRect(
+ actualWidth, actualHeight, actualChannels,
+ dataWidth, dataHeight, expectedData,
+ testData, testFormat, tolerance, filteringMode) {
+
+ if(typeof(tolerance) == 'undefined') { tolerance = 5; }
+ var actual = new Uint8Array(actualWidth * actualHeight * 4);
+ gl.readPixels(0, 0, actualWidth, actualHeight, gl.RGBA, gl.UNSIGNED_BYTE, actual);
+ flipImage(actual, actualWidth, actualHeight);
+
+ var div = document.createElement("div");
+ div.className = "testimages";
+ ctu.insertCaptionedImg(div, "expected", ctu.makeScaledImage(
+ actualWidth, actualHeight, dataWidth, expectedData,
+ actualChannels == 4));
+ ctu.insertCaptionedImg(div, "actual", ctu.makeScaledImage(
+ actualWidth, actualHeight, actualWidth, actual,
+ actualChannels == 4));
+ div.appendChild(document.createElement('br'));
+ document.getElementById("console").appendChild(div);
+
+ var failed = false;
+ for (var yy = 0; yy < actualHeight; ++yy) {
+ for (var xx = 0; xx < actualWidth; ++xx) {
+ var actualOffset = (yy * actualWidth + xx) * 4;
+ var expectedOffset = (yy * dataWidth + xx) * 4;
+ var expected = [
+ expectedData[expectedOffset + 0],
+ expectedData[expectedOffset + 1],
+ expectedData[expectedOffset + 2],
+ (actualChannels == 3 ? 255 : expectedData[expectedOffset + 3])
+ ];
+ for (var jj = 0; jj < 4; ++jj) {
+ if (Math.abs(actual[actualOffset + jj] - expected[jj]) > tolerance) {
+ failed = true;
+ var was = actual[actualOffset + 0].toString();
+ for (var j = 1; j < 4; ++j) {
+ was += "," + actual[actualOffset + j];
+ }
+ testFailed('at (' + xx + ', ' + yy +
+ ') expected: ' + expected + ' was ' + was);
+ }
+ }
+ }
+ }
+ if (!failed) {
+ testPassed("texture rendered correctly with " + filteringMode + " filtering");
+ }
+}
+
+// Builds several tests from two arrays
+// data gives each Uint8Array encoded data to use
+// formats the associate format to decode the data
+// raws gives each decoded Uint8Array data for texture comparison
+// mode 'LDR', 'LDR-sRGB', or 'HDR'
+function buildTests(data, formats, raws, mode) {
+
+ var tests = [];
+ for (var i = 0; i < data.length; ++i) {
+ var test = {
+ width: 16,
+ height: 16,
+ channels: 4,
+ data: data[i],
+ format: formats[i],
+ raw: raws[i],
+ mode: mode
+ };
+ tests.push(test);
+ }
+
+ return tests;
+}
+
+function expectedByteLength(w, h, format) {
+
+ if (format == validFormats.COMPRESSED_RGBA_ASTC_4x4_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR)
+ return Math.floor((w + 3) / 4) * Math.floor((h + 3) / 4) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_5x4_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR)
+ return Math.floor((w + 4) / 5) * Math.floor((h + 3) / 4) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_5x5_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR)
+ return Math.floor((w + 4) / 5) * Math.floor((h + 4) / 5) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_6x5_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR)
+ return Math.floor((w + 5) / 6) * Math.floor((h + 4) / 5) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_6x6_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR)
+ return Math.floor((w + 5) / 6) * Math.floor((h + 5) / 6) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_8x5_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR)
+ return Math.floor((w + 7) / 8) * Math.floor((h + 4) / 5) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_8x6_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR)
+ return Math.floor((w + 7) / 8) * Math.floor((h + 5) / 6) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_8x8_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR)
+ return Math.floor((w + 7) / 8) * Math.floor((h + 7) / 8) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_10x5_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR)
+ return Math.floor((w + 9) / 10) * Math.floor((h + 4) / 5) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_10x6_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR)
+ return Math.floor((w + 9) / 10) * Math.floor((h + 5) / 6) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_10x8_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR)
+ return Math.floor((w + 9) / 10) * Math.floor((h + 7) / 8) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_10x10_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR)
+ return Math.floor((w + 9) / 10) * Math.floor((h + 9) / 10) * 16;
+ else if (format == validFormats.COMPRESSED_RGBA_ASTC_12x10_KHR || format == validFormats.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR)
+ return Math.floor((w + 11) / 12) * Math.floor((h + 9) / 10) * 16;
+
+ return Math.floor((w + 11) / 12) * Math.floor((h + 11) / 12) * 16;
+}
+
+function getBlockDimensions(format) {
+ var re = /.*_(\d+)x(\d+)_KHR/;
+ for (name in validFormats) {
+ if (validFormats[name] === format) {
+ var match = name.match(re);
+ return {
+ width: parseInt(match[1], 10),
+ height: parseInt(match[2], 10)
+ };
+ }
+ }
+ testFailed('Could not find block dimensions for format ' + ctu.formatToString(ext, format));
+ return {width: 4, height: 4};
+}
+
+// Swaps two cells in an arraybuffer.
+// this function is used in the image flipping function
+function swapCell(array, i, j) {
+ var a = array[i];
+ array[i] = array[j];
+ array[j] = a;
+}
+
+function flipImage(imgBuffer, w, h) {
+ var halfHeight = h / 2;
+
+ for (var j = 0; j < halfHeight; j++) {
+ for (var i = 0; i < w; i++) {
+ var beginByte = (j * w + i) * 4;
+ var endByte = ((h - j - 1) * w + i) * 4;
+
+ swapCell(imgBuffer, beginByte, endByte);
+ swapCell(imgBuffer, beginByte + 1, endByte + 1);
+ swapCell(imgBuffer, beginByte + 2, endByte + 2);
+ swapCell(imgBuffer, beginByte + 3, endByte + 3);
+ }
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html
new file mode 100644
index 0000000000..8a85239ff9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc.html
@@ -0,0 +1,126 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WEBGL_compressed_texture_etc Conformance Tests</title>
+<LINK rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compressed-texture-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_compressed_texture_etc extension, if it is available.");
+
+debug("");
+
+var validFormats = {
+ COMPRESSED_R11_EAC : 0x9270,
+ COMPRESSED_SIGNED_R11_EAC : 0x9271,
+ COMPRESSED_RG11_EAC : 0x9272,
+ COMPRESSED_SIGNED_RG11_EAC : 0x9273,
+ COMPRESSED_RGB8_ETC2 : 0x9274,
+ COMPRESSED_SRGB8_ETC2 : 0x9275,
+ COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 : 0x9276,
+ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 : 0x9277,
+ COMPRESSED_RGBA8_ETC2_EAC : 0x9278,
+ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : 0x9279
+};
+
+function expectedByteLength(width, height, format) {
+ var blockSizeInBytes = 8;
+
+ var largerBlockFormats = [
+ validFormats.COMPRESSED_RG11_EAC,
+ validFormats.COMPRESSED_SIGNED_RG11_EAC,
+ validFormats.COMPRESSED_RGBA8_ETC2_EAC,
+ validFormats.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC];
+
+ if (largerBlockFormats.indexOf(format) >= 0) {
+ blockSizeInBytes = 16;
+ }
+
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * blockSizeInBytes;
+}
+
+function getBlockDimensions(format) {
+ return {width: 4, height: 4};
+}
+
+var wtu = WebGLTestUtils;
+var ctu = CompressedTextureUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var gl = wtu.create3DContext();
+var WEBGL_compressed_texture_etc;
+
+var formats = null;
+
+function runTest() {
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ ctu.testCompressedFormatsUnavailableWhenExtensionDisabled(gl, validFormats, expectedByteLength, 4);
+
+ WEBGL_compressed_texture_etc = gl.getExtension("WEBGL_compressed_texture_etc");
+
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_etc", WEBGL_compressed_texture_etc !== null);
+
+ var isPositive = WEBGL_compressed_texture_etc !== null;
+
+ if (isPositive) {
+ // Test that enum values are listed correctly in supported formats and in the extension object.
+ ctu.testCompressedFormatsListed(gl, validFormats);
+ ctu.testCorrectEnumValuesInExt(WEBGL_compressed_texture_etc, validFormats);
+ // Test that texture upload buffer size is validated correctly.
+ ctu.testFormatRestrictionsOnBufferSize(gl, validFormats, expectedByteLength, getBlockDimensions);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+
+ for (var name in validFormats) {
+ if (validFormats.hasOwnProperty(name)) {
+ var format = validFormats[name];
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, " + format + ", 4, 4, 0, new Uint8Array(" + expectedByteLength(4, 4, format) + "))");
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 4, 4, " + format + ", new Uint8Array(" + expectedByteLength(4, 4, format) + "))");
+ }
+ }
+ }
+
+ var tex2 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex2);
+
+ debug("");
+ if (contextVersion >= 2) {
+ var expectedError = isPositive ? gl.INVALID_OPERATION: [gl.INVALID_ENUM, gl.INVALID_OPERATION];
+ // `null` coerces into `0` for the PBO entrypoint, yielding INVALID_OP due to no PBO bound.
+ wtu.shouldGenerateGLError(gl, expectedError, "gl.compressedTexImage2D(gl.TEXTURE_2D, 0, validFormats.COMPRESSED_R11_EAC, 4, 4, 0, 0, null)");
+ wtu.shouldGenerateGLError(gl, expectedError, "gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, validFormats.COMPRESSED_R11_EAC, 0, null)");
+ wtu.shouldGenerateGLError(gl, expectedError, "gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, validFormats.COMPRESSED_R11_EAC, 4, 4, 4, 0, 0, null)");
+ wtu.shouldGenerateGLError(gl, expectedError, "gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, 0, validFormats.COMPRESSED_R11_EAC, 0, null)");
+ } else {
+ shouldThrow("gl.compressedTexImage2D(gl.TEXTURE_2D, 0, validFormats.COMPRESSED_R11_EAC, 4, 4, 0, null)");
+ shouldThrow("gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, validFormats.COMPRESSED_R11_EAC, null)");
+ shouldThrow("gl.compressedTexImage3D(gl.TEXTURE_2D_ARRAY, 0, validFormats.COMPRESSED_R11_EAC, 4, 4, 4, 0, null)");
+ shouldThrow("gl.compressedTexSubImage3D(gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, 0, 0, 0, validFormats.COMPRESSED_R11_EAC, null)");
+ }
+ }
+}
+
+runTest();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc1.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc1.html
new file mode 100644
index 0000000000..09a6ed0642
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-etc1.html
@@ -0,0 +1,74 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WEBGL_compressed_texture_etc1 Conformance Tests</title>
+<LINK rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compressed-texture-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_compressed_texture_etc1 extension, if it is available.");
+
+debug("");
+
+var validFormats = {
+ COMPRESSED_RGB_ETC1_WEBGL: 0x8D64,
+};
+
+function expectedByteLength(width, height, format) {
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;
+}
+
+function getBlockDimensions(format) {
+ return {width: 4, height: 4};
+}
+
+var wtu = WebGLTestUtils;
+var ctu = CompressedTextureUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var gl = wtu.create3DContext();
+var WEBGL_compressed_texture_etc1;
+
+var formats = null;
+
+function runTest() {
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ ctu.testCompressedFormatsUnavailableWhenExtensionDisabled(gl, validFormats, expectedByteLength, 4);
+
+ WEBGL_compressed_texture_etc1 = gl.getExtension("WEBGL_compressed_texture_etc1");
+
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_etc1", WEBGL_compressed_texture_etc1 !== null);
+
+ if (WEBGL_compressed_texture_etc1 !== null) {
+ // Test that enum values are listed correctly in supported formats and in the extension object.
+ ctu.testCompressedFormatsListed(gl, validFormats);
+ ctu.testCorrectEnumValuesInExt(WEBGL_compressed_texture_etc1, validFormats);
+ // Test that texture upload buffer size is validated correctly.
+ ctu.testFormatRestrictionsOnBufferSize(gl, validFormats, expectedByteLength, getBlockDimensions);
+ }
+ }
+}
+
+runTest();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html
new file mode 100644
index 0000000000..465f44a9cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-pvrtc.html
@@ -0,0 +1,371 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>WebGL WEBGL_compressed_texture_pvrtc Conformance Tests</title>
+<style>
+img {
+ border: 1px solid black;
+ margin-right: 1em;
+}
+.testimages {
+}
+
+.testimages br {
+ clear: both;
+}
+
+.testimages > div {
+ float: left;
+ margin: 1em;
+}
+</style>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_compressed_texture_pvrtc extension, if it is available.");
+
+debug("");
+
+var pvrtc_4x4_2bpp = new Uint8Array([
+ 0x77, 0x22, 0x77, 0x22, 0xbb, 0x2b, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+]);
+
+var pvrtc_4x4_4bpp = new Uint8Array([
+ 0x1b, 0x1b, 0x1b, 0x1b, 0xba, 0x2b, 0x00, 0x80, 0x1b, 0x1b, 0x1b, 0x1b, 0xba, 0x2b, 0x00, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+]);
+
+var pvrtc_4x4_rgba_decoded = new Uint8Array([
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x46, 0xb8, 0x76, 0x76, 0x71, 0x8a, 0xbd, 0xbd, 0xba, 0x44,
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x43, 0xb8, 0x76, 0x76, 0x71, 0x8a, 0xbd, 0xbd, 0xb5, 0x44,
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x43, 0xb8, 0x76, 0x76, 0x71, 0x8a, 0xbd, 0xbd, 0xb5, 0x44,
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x46, 0xb8, 0x76, 0x76, 0x71, 0x8a, 0xbd, 0xbd, 0xb7, 0x44,
+]);
+
+var pvrtc_4x4_rgb_decoded = new Uint8Array([
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x46, 0xff, 0x76, 0x76, 0x71, 0xff, 0xbd, 0xbd, 0xba, 0xff,
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x43, 0xff, 0x76, 0x76, 0x71, 0xff, 0xbd, 0xbd, 0xb5, 0xff,
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x43, 0xff, 0x76, 0x76, 0x71, 0xff, 0xbd, 0xbd, 0xb5, 0xff,
+ 0x00, 0x00, 0x00, 0xff, 0x46, 0x46, 0x46, 0xff, 0x76, 0x76, 0x71, 0xff, 0xbd, 0xbd, 0xb7, 0xff,
+]);
+
+var wtu = WebGLTestUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+var program = wtu.setupTexturedQuad(gl);
+var ext = null;
+var vao = null;
+var validFormats = {
+ COMPRESSED_RGB_PVRTC_4BPPV1_IMG : 0x8C00,
+ COMPRESSED_RGB_PVRTC_2BPPV1_IMG : 0x8C01,
+ COMPRESSED_RGBA_PVRTC_4BPPV1_IMG : 0x8C02,
+ COMPRESSED_RGBA_PVRTC_2BPPV1_IMG : 0x8C03,
+};
+var name;
+var supportedFormats;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ runTestDisabled();
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "WEBGL_compressed_texture_pvrtc");
+ if (!ext) {
+ testPassed("No WEBGL_compressed_texture_pvrtc support -- this is legal");
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled WEBGL_compressed_texture_pvrtc extension");
+
+ runSupportedTest(true);
+ runTestExtension();
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var name = wtu.getSupportedExtensionWithKnownPrefixes(gl, "WEBGL_compressed_texture_pvrtc");
+ if (name !== undefined) {
+ if (extensionEnabled) {
+ testPassed("WEBGL_compressed_texture_pvrtc listed as supported and getExtension succeeded");
+ } else {
+ testFailed("WEBGL_compressed_texture_pvrtc listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("WEBGL_compressed_texture_pvrtc not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("WEBGL_compressed_texture_pvrtc not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+
+function runTestDisabled() {
+ debug("Testing binding enum with extension disabled");
+
+ supportedFormats = gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS);
+ shouldBe("supportedFormats", "[]");
+}
+
+function formatExists(format, supportedFormats) {
+ for (var ii = 0; ii < supportedFormats.length; ++ii) {
+ if (format == supportedFormats[ii]) {
+ testPassed("supported format " + formatToString(format) + " is exists");
+ return;
+ }
+ }
+ testFailed("supported format " + formatToString(format) + " does not exist");
+}
+
+function formatToString(format) {
+ for (var p in ext) {
+ if (ext[p] == format) {
+ return p;
+ }
+ }
+ return "0x" + format.toString(16);
+}
+
+function runTestExtension() {
+ debug("Testing WEBGL_compressed_texture_pvrtc");
+
+ // check that all format enums exist.
+ for (name in validFormats) {
+ var expected = "0x" + validFormats[name].toString(16);
+ var actual = "ext['" + name + "']";
+ shouldBe(actual, expected);
+ }
+
+ supportedFormats = gl.getParameter(gl.COMPRESSED_TEXTURE_FORMATS);
+ // There should be exactly 4 formats for both WebGL 1.0 and WebGL 2.0.
+ shouldBe("supportedFormats.length", "4");
+
+ // check that all 4 formats exist
+ for (var name in validFormats.length) {
+ formatExists(validFormats[name], supportedFormats);
+ }
+
+ // Test each format
+ testPVRTC_RGBA_2BPP();
+ testPVRTC_RGB_2BPP();
+ testPVRTC_RGBA_4BPP();
+ testPVRTC_RGB_4BPP();
+}
+
+function testPVRTC_RGBA_2BPP() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: pvrtc_4x4_2bpp,
+ raw: pvrtc_4x4_rgba_decoded,
+ format: ext.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
+ }
+ ];
+ testPVRTCTextures(tests);
+}
+
+function testPVRTC_RGB_2BPP() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: pvrtc_4x4_2bpp,
+ raw: pvrtc_4x4_rgb_decoded,
+ format: ext.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
+ }
+ ];
+ testPVRTCTextures(tests);
+}
+
+function testPVRTC_RGBA_4BPP() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: pvrtc_4x4_4bpp,
+ raw: pvrtc_4x4_rgba_decoded,
+ format: ext.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
+ }
+ ];
+ testPVRTCTextures(tests);
+}
+
+function testPVRTC_RGB_4BPP() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: pvrtc_4x4_4bpp,
+ raw: pvrtc_4x4_rgb_decoded,
+ format: ext.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
+ }
+ ];
+ testPVRTCTextures(tests);
+}
+
+function testPVRTCTextures(tests) {
+ debug("<hr/>");
+ for (var ii = 0; ii < tests.length; ++ii) {
+ testPVRTCTexture(tests[ii]);
+ }
+}
+
+function testPVRTCTexture(test) {
+ var data = new Uint8Array(test.data);
+ var width = test.width;
+ var height = test.height;
+ var format = test.format;
+ var uncompressedData = test.raw;
+
+ canvas.width = width;
+ canvas.height = height;
+ gl.viewport(0, 0, width, height);
+ debug("testing " + formatToString(format) + " " + width + "x" + height);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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);
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture");
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "trying to generate mipmaps from compressed texture");
+ wtu.clearAndDrawUnitQuad(gl);
+ compareRect(width, height, test.channels, width, height, uncompressedData, data, format, undefined, "NEAREST");
+ // Test again with linear filtering.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ compareRect(width, height, test.channels, width, height, uncompressedData, data, format, undefined, "LINEAR");
+
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 1, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "non 0 border");
+
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 1, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 2, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 1, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 2, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "compressedTexSubImage2D allowed for reloading of complete textures");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width - 2, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "compressedTexSubImage2D not allowed for partial texture updates");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height - 2, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "compressedTexSubImage2D not allowed for partial texture updates");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 2, 0, width - 2, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "compressedTexSubImage2D not allowed for partial texture updates");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 2, width, height - 2, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "compressedTexSubImage2D not allowed for partial texture updates");
+}
+
+function insertImg(element, caption, img) {
+ var div = document.createElement("div");
+ div.appendChild(img);
+ var label = document.createElement("div");
+ label.appendChild(document.createTextNode(caption));
+ div.appendChild(label);
+ element.appendChild(div);
+}
+
+function makeImage(imageWidth, imageHeight, dataWidth, data, alpha) {
+ var scale = 8;
+ var c = document.createElement("canvas");
+ c.width = imageWidth * scale;
+ c.height = imageHeight * scale;
+ var ctx = c.getContext("2d");
+ for (var yy = 0; yy < imageHeight; ++yy) {
+ for (var xx = 0; xx < imageWidth; ++xx) {
+ var offset = (yy * dataWidth + xx) * 4;
+ ctx.fillStyle = "rgba(" +
+ data[offset + 0] + "," +
+ data[offset + 1] + "," +
+ data[offset + 2] + "," +
+ (alpha ? data[offset + 3] / 255 : 1) + ")";
+ ctx.fillRect(xx * scale, yy * scale, scale, scale);
+ }
+ }
+ return wtu.makeImageFromCanvas(c);
+}
+function compareRect(
+ actualWidth, actualHeight, actualChannels,
+ dataWidth, dataHeight, expectedData,
+ testData, testFormat, tolerance, filteringMode) {
+ if(typeof(tolerance) == 'undefined') { tolerance = 5; }
+ var actual = new Uint8Array(actualWidth * actualHeight * 4);
+ gl.readPixels(
+ 0, 0, actualWidth, actualHeight, gl.RGBA, gl.UNSIGNED_BYTE, actual);
+
+ var div = document.createElement("div");
+ div.className = "testimages";
+ insertImg(div, "expected", makeImage(
+ actualWidth, actualHeight, dataWidth, expectedData,
+ actualChannels == 4));
+ insertImg(div, "actual", makeImage(
+ actualWidth, actualHeight, actualWidth, actual,
+ actualChannels == 4));
+ div.appendChild(document.createElement('br'));
+ document.getElementById("console").appendChild(div);
+
+ var failed = false;
+ for (var yy = 0; yy < actualHeight; ++yy) {
+ for (var xx = 0; xx < actualWidth; ++xx) {
+ var actualOffset = (yy * actualWidth + xx) * 4;
+ var expectedOffset = (yy * dataWidth + xx) * 4;
+ var expected = [
+ expectedData[expectedOffset + 0],
+ expectedData[expectedOffset + 1],
+ expectedData[expectedOffset + 2],
+ (actualChannels == 3 ? 255 : expectedData[expectedOffset + 3])
+ ];
+ for (var jj = 0; jj < 4; ++jj) {
+ if (Math.abs(actual[actualOffset + jj] - expected[jj]) > tolerance) {
+ failed = true;
+ var was = actual[actualOffset + 0].toString();
+ for (var j = 1; j < 4; ++j) {
+ was += "," + actual[actualOffset + j];
+ }
+ testFailed('at (' + xx + ', ' + yy +
+ ') expected: ' + expected + ' was ' + was);
+ }
+ }
+ }
+ }
+ if (!failed) {
+ testPassed("texture rendered correctly with " + filteringMode + " filtering");
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html
new file mode 100644
index 0000000000..91fc3f0b1c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-s3tc-srgb.html
@@ -0,0 +1,912 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compressed-texture-utils.js"></script>
+<title>WebGL WEBGL_compressed_texture_s3tc_srgb Conformance Tests</title>
+<style>
+img {
+ border: 1px solid black;
+ margin-right: 1em;
+}
+
+.testimages br {
+ clear: both;
+}
+
+.testimages > div {
+ float: left;
+ margin: 1em;
+}
+</style>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_compressed_texture_s3tc_srgb extension, if it is available.");
+
+debug("");
+
+/*
+These tests use the same payloads as a non-sRGB version. When running side-by-side,
+images from these tests must appear much darker than linear counterparts.
+*/
+
+/*
+BC1 (DXT1) block
+e0 = [ 0, 255, 0]
+e1 = [255, 0, 0]
+e0 < e1, so it uses 3-color mode
+
+local palette
+ 0: [ 0, 255, 0, 255]
+ 1: [255, 0, 0, 255]
+ 2: [128, 128, 0, 255]
+ 3: [ 0, 0, 0, 255] // for BC1 RGB
+ 3: [ 0, 0, 0, 0] // for BC1 RGBA
+selectors
+ 3 2 1 0
+ 2 2 1 0
+ 1 1 1 0
+ 0 0 0 0
+
+Extending this block with opaque alpha and uploading as BC2 or BC3
+will generate wrong colors because BC2 and BC3 do not have 3-color mode.
+*/
+var img_4x4_rgba_dxt1 = new Uint8Array([
+ 0xE0, 0x07, 0x00, 0xF8, 0x1B, 0x1A, 0x15, 0x00
+]);
+
+/*
+BC2 (DXT3) block
+
+Quantized alpha values
+ 0 1 2 3
+ 4 5 6 7
+ 8 9 A B
+ C D E F
+
+RGB block
+e0 = [255, 0, 0]
+e1 = [ 0, 255, 0]
+BC2 has only 4-color mode
+
+local palette
+ 0: [255, 0, 0]
+ 1: [ 0, 255, 0]
+ 2: [170, 85, 0]
+ 3: [ 85, 170, 0]
+selectors
+ 0 1 2 3
+ 1 1 2 3
+ 2 2 2 3
+ 3 3 3 3
+*/
+var img_4x4_rgba_dxt3 = new Uint8Array([
+ 0x10, 0x32, 0x54, 0x76, 0x98, 0xBA, 0xDC, 0xFE,
+ 0x00, 0xF8, 0xE0, 0x07, 0xE4, 0xE5, 0xEA, 0xFF
+]);
+
+/*
+BC3 (DXT5) block
+
+Alpha block (aka DXT5A)
+e0 = 255
+e1 = 0
+e0 > e1, so using 6 intermediate points
+local palette
+ 255, 0, 219, 182, 146, 109, 73, 36
+selectors
+ 0 1 2 3
+ 1 2 3 4
+ 2 3 4 5
+ 3 4 5 6
+
+RGB block
+e0 = [255, 0, 0]
+e1 = [ 0, 255, 0]
+BC3 has only 4-color mode
+
+local palette
+ 0: [255, 0, 0]
+ 1: [ 0, 255, 0]
+ 2: [170, 85, 0]
+ 3: [ 85, 170, 0]
+selectors
+ 3 2 1 0
+ 3 2 1 1
+ 3 2 2 2
+ 3 3 3 3
+*/
+var img_4x4_rgba_dxt5 = new Uint8Array([
+ 0xFF, 0x00, 0x88, 0x16, 0x8D, 0x1A, 0x3B, 0xD6,
+ 0x00, 0xF8, 0xE0, 0x07, 0x1B, 0x5B, 0xAB, 0xFF
+]);
+
+/*
+8x8 block endpoints use half-intensity values (appear darker than 4x4)
+*/
+var img_8x8_rgba_dxt1 = new Uint8Array([
+ 0xe0,0x03,0x00,0x78,0x13,0x10,0x15,0x00,
+ 0x0f,0x00,0xe0,0x7b,0x11,0x10,0x15,0x00,
+ 0xe0,0x03,0x0f,0x78,0x44,0x45,0x40,0x55,
+ 0x0f,0x00,0xef,0x03,0x44,0x45,0x40,0x55
+]);
+var img_8x8_rgba_dxt3 = new Uint8Array([
+ 0xf6,0xff,0xf6,0xff,0xff,0xff,0xff,0xff,0x00,0x78,0xe0,0x03,0x44,0x45,0x40,0x55,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7b,0x0f,0x00,0x44,0x45,0x40,0x55,
+ 0xff,0xff,0xff,0xff,0xf6,0xff,0xf6,0xff,0x0f,0x78,0xe0,0x03,0x11,0x10,0x15,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xef,0x03,0x0f,0x00,0x11,0x10,0x15,0x00
+]);
+var img_8x8_rgba_dxt5 = new Uint8Array([
+0xff,0x69,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0x78,0xe0,0x03,0x44,0x45,0x40,0x55,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x7b,0x0f,0x00,0x44,0x45,0x40,0x55,
+ 0xff,0x69,0x00,0x00,0x00,0x01,0x10,0x00,0x0f,0x78,0xe0,0x03,0x11,0x10,0x15,0x00,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xef,0x03,0xef,0x00,0x11,0x10,0x15,0x00
+]);
+
+var wtu = WebGLTestUtils;
+var ctu = CompressedTextureUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+var program = wtu.setupTexturedQuad(gl);
+var ext = null;
+var vao = null;
+var validFormats = {
+ COMPRESSED_SRGB_S3TC_DXT1_EXT : 0x8C4C,
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT : 0x8C4D,
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT : 0x8C4E,
+ COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT : 0x8C4F,
+};
+var name;
+var supportedFormats;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ ctu.testCompressedFormatsUnavailableWhenExtensionDisabled(gl, validFormats, expectedByteLength, 4);
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "WEBGL_compressed_texture_s3tc_srgb");
+ if (!ext) {
+ testPassed("No WEBGL_compressed_texture_s3tc_srgb support -- this is legal");
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_s3tc_srgb", false);
+ } else {
+ testPassed("Successfully enabled WEBGL_compressed_texture_s3tc_srgb extension");
+
+ wtu.runExtensionSupportedTest(gl, "WEBGL_compressed_texture_s3tc_srgb", true);
+ runTestExtension();
+ }
+}
+
+function expectedByteLength(width, height, format) {
+ if (format == validFormats.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT || format == validFormats.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) {
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;
+ }
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;
+}
+
+function getBlockDimensions(format) {
+ return {width: 4, height: 4};
+}
+
+function runTestExtension() {
+ debug("");
+ debug("Testing WEBGL_compressed_texture_s3tc_srgb");
+
+ // Test that enum values are listed correctly in supported formats and in the extension object.
+ ctu.testCompressedFormatsListed(gl, validFormats);
+ ctu.testCorrectEnumValuesInExt(ext, validFormats);
+ // Test that texture upload buffer size is validated correctly.
+ ctu.testFormatRestrictionsOnBufferSize(gl, validFormats, expectedByteLength, getBlockDimensions);
+
+ // Test each format
+ testDXT1_SRGB();
+ testDXT1_SRGB_ALPHA();
+ testDXT3_SRGB_ALPHA();
+ testDXT5_SRGB_ALPHA();
+
+ // Test compressed PBOs with a single format
+ if (contextVersion >= 2) {
+ testDXT5_SRGB_ALPHA_PBO();
+ }
+
+ // Test TexImage validation on level dimensions combinations.
+ debug("");
+ debug("When level equals 0, width and height must be a multiple of 4.");
+ debug("When level is larger than 0, this constraint doesn't apply.");
+ ctu.testTexImageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { level: 0, width: 4, height: 3, expectation: gl.INVALID_OPERATION, message: "0: 4x3" },
+ { level: 0, width: 3, height: 4, expectation: gl.INVALID_OPERATION, message: "0: 3x4" },
+ { level: 0, width: 2, height: 2, expectation: gl.INVALID_OPERATION, message: "0: 2x2" },
+ { level: 0, width: 4, height: 4, expectation: gl.NO_ERROR, message: "0: 4x4" },
+ { level: 1, width: 2, height: 2, expectation: gl.NO_ERROR, message: "1: 2x2" },
+ { level: 2, width: 1, height: 1, expectation: gl.NO_ERROR, message: "2: 1x1" },
+ ]);
+
+ ctu.testTexSubImageDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions, 16, 16,
+ [
+ { xoffset: 0, yoffset: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "height is not a multiple of 4" },
+ { xoffset: 0, yoffset: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "width is not a multiple of 4" },
+ { xoffset: 1, yoffset: 0, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "xoffset is not a multiple of 4" },
+ { xoffset: 0, yoffset: 1, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "yoffset is not a multiple of 4" },
+ { xoffset: 12, yoffset: 12, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ ]);
+
+ if (contextVersion >= 2) {
+ debug("");
+ debug("Testing NPOT textures");
+ ctu.testTexImageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { level: 0, width: 12, height: 12, expectation: gl.NO_ERROR, message: "0: 12x12 is valid" },
+ { level: 1, width: 6, height: 6, expectation: gl.NO_ERROR, message: "1: 6x6, is valid" },
+ { level: 2, width: 3, height: 3, expectation: gl.NO_ERROR, message: "2: 3x3, is valid" },
+ { level: 3, width: 1, height: 1, expectation: gl.NO_ERROR, message: "3: 1x1, is valid" },
+ ]);
+
+ debug("");
+ debug("Testing partial updates");
+ ctu.testTexSubImageDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions, 12, 12,
+ [
+ { xoffset: 0, yoffset: 0, width: 4, height: 3,
+ expectation: gl.INVALID_OPERATION, message: "height is not a multiple of 4" },
+ { xoffset: 0, yoffset: 0, width: 3, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "width is not a multiple of 4" },
+ { xoffset: 1, yoffset: 0, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "xoffset is not a multiple of 4" },
+ { xoffset: 0, yoffset: 1, width: 4, height: 4,
+ expectation: gl.INVALID_OPERATION, message: "yoffset is not a multiple of 4" },
+ { xoffset: 8, yoffset: 8, width: 4, height: 4,
+ expectation: gl.NO_ERROR, message: "is valid" },
+ ]);
+
+ debug("");
+ debug("Testing immutable NPOT textures");
+ ctu.testTexStorageLevelDimensions(gl, ext, validFormats, expectedByteLength, getBlockDimensions,
+ [
+ { width: 12, height: 12, expectation: gl.NO_ERROR, message: "0: 12x12 is valid" },
+ { width: 6, height: 6, expectation: gl.NO_ERROR, message: "1: 6x6, is valid" },
+ { width: 3, height: 3, expectation: gl.NO_ERROR, message: "2: 3x3, is valid" },
+ { width: 1, height: 1, expectation: gl.NO_ERROR, message: "3: 1x1, is valid" },
+ ]);
+ }
+}
+
+function testDXT1_SRGB() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 3,
+ data: img_4x4_rgba_dxt1,
+ format: ext.COMPRESSED_SRGB_S3TC_DXT1_EXT,
+ hasAlpha: false,
+ },
+ { width: 8,
+ height: 8,
+ channels: 3,
+ data: img_8x8_rgba_dxt1,
+ format: ext.COMPRESSED_SRGB_S3TC_DXT1_EXT,
+ hasAlpha: false,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_rgba_dxt1
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXT1_SRGB_ALPHA() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: img_4x4_rgba_dxt1,
+ format: ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
+ // This is a special case -- the texture is still opaque
+ // though it's RGBA.
+ hasAlpha: false,
+ },
+ { width: 8,
+ height: 8,
+ channels: 4,
+ data: img_8x8_rgba_dxt1,
+ format: ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
+ // This is a special case -- the texture is still opaque
+ // though it's RGBA.
+ hasAlpha: false,
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXT3_SRGB_ALPHA() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: img_4x4_rgba_dxt3,
+ format: ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
+ hasAlpha: true,
+ },
+ { width: 8,
+ height: 8,
+ channels: 4,
+ data: img_8x8_rgba_dxt3,
+ format: ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
+ hasAlpha: true,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_rgba_dxt3
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXT5_SRGB_ALPHA() {
+ var tests = [
+ { width: 4,
+ height: 4,
+ channels: 4,
+ data: img_4x4_rgba_dxt5,
+ format: ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
+ hasAlpha: true,
+ },
+ { width: 8,
+ height: 8,
+ channels: 4,
+ data: img_8x8_rgba_dxt5,
+ format: ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,
+ hasAlpha: true,
+ subX0: 0,
+ subY0: 0,
+ subWidth: 4,
+ subHeight: 4,
+ subData: img_4x4_rgba_dxt5
+ }
+ ];
+ testDXTTextures(tests);
+}
+
+function testDXTTextures(tests) {
+ debug("<hr/>");
+ for (var ii = 0; ii < tests.length; ++ii) {
+ testDXTTexture(tests[ii], false);
+ if (contextVersion >= 2) {
+ debug("<br/>");
+ testDXTTexture(tests[ii], true);
+ }
+ }
+}
+
+function uncompressDXTBlockSRGB(
+ destBuffer, destX, destY, destWidth, src, srcOffset, format) {
+ // Decoding routines follow D3D11 functional spec wrt
+ // endpoints unquantization and interpolation.
+ // Some hardware may produce slightly different values - it's normal.
+
+ function make565(src, offset) {
+ return src[offset + 0] + (src[offset + 1] << 8);
+ }
+ function make8888From565(c) {
+ // These values exactly match hw decoder when selectors are 0 or 1.
+ function replicateBits(v, w) {
+ return (v << (8 - w)) | (v >> (w + w - 8));
+ }
+ return [
+ replicateBits((c >> 11) & 0x1F, 5),
+ replicateBits((c >> 5) & 0x3F, 6),
+ replicateBits((c >> 0) & 0x1F, 5),
+ 255
+ ];
+ }
+ function mix(mult, c0, c1, div) {
+ var r = [];
+ for (var ii = 0; ii < c0.length; ++ii) {
+ // For green channel (6 bits), this interpolation exactly matches hw decoders
+
+ // For red and blue channels (5 bits), this interpolation exactly
+ // matches only some hw decoders and stays within acceptable range for others.
+ r[ii] = Math.floor((c0[ii] * mult + c1[ii]) / div + 0.5);
+ }
+ return r;
+ }
+ var isDXT1 = format == ext.COMPRESSED_SRGB_S3TC_DXT1_EXT ||
+ format == ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ var colorOffset = srcOffset + (isDXT1 ? 0 : 8);
+ var color0 = make565(src, colorOffset + 0);
+ var color1 = make565(src, colorOffset + 2);
+ var c0gtc1 = color0 > color1 || !isDXT1;
+ var rgba0 = make8888From565(color0);
+ var rgba1 = make8888From565(color1);
+ var colors = [
+ rgba0,
+ rgba1,
+ c0gtc1 ? mix(2, rgba0, rgba1, 3) : mix(1, rgba0, rgba1, 2),
+ c0gtc1 ? mix(2, rgba1, rgba0, 3) : [0, 0, 0, 255]
+ ];
+
+ // yea I know there is a lot of math in this inner loop.
+ // so sue me.
+ for (var yy = 0; yy < 4; ++yy) {
+ var pixels = src[colorOffset + 4 + yy];
+ for (var xx = 0; xx < 4; ++xx) {
+ var dstOff = ((destY + yy) * destWidth + destX + xx) * 4;
+ var code = (pixels >> (xx * 2)) & 0x3;
+ var srcColor = colors[code];
+ var alpha;
+ switch (format) {
+ case ext.COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ alpha = 255;
+ break;
+ case ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ alpha = (code == 3 && !c0gtc1) ? 0 : 255;
+ break;
+ case ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ {
+ var alpha0 = src[srcOffset + yy * 2 + (xx >> 1)];
+ var alpha1 = (alpha0 >> ((xx % 2) * 4)) & 0xF;
+ alpha = alpha1 | (alpha1 << 4);
+ }
+ break;
+ case ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ {
+ var alpha0 = src[srcOffset + 0];
+ var alpha1 = src[srcOffset + 1];
+ var alphaOff = (yy >> 1) * 3 + 2;
+ var alphaBits =
+ src[srcOffset + alphaOff + 0] +
+ src[srcOffset + alphaOff + 1] * 256 +
+ src[srcOffset + alphaOff + 2] * 65536;
+ var alphaShift = (yy % 2) * 12 + xx * 3;
+ var alphaCode = (alphaBits >> alphaShift) & 0x7;
+ if (alpha0 > alpha1) {
+ switch (alphaCode) {
+ case 0:
+ alpha = alpha0;
+ break;
+ case 1:
+ alpha = alpha1;
+ break;
+ default:
+ alpha = Math.floor(((8 - alphaCode) * alpha0 + (alphaCode - 1) * alpha1) / 7.0 + 0.5);
+ break;
+ }
+ } else {
+ switch (alphaCode) {
+ case 0:
+ alpha = alpha0;
+ break;
+ case 1:
+ alpha = alpha1;
+ break;
+ case 6:
+ alpha = 0;
+ break;
+ case 7:
+ alpha = 255;
+ break;
+ default:
+ alpha = Math.floor(((6 - alphaCode) * alpha0 + (alphaCode - 1) * alpha1) / 5.0 + 0.5);
+ break;
+ }
+ }
+ }
+ break;
+ default:
+ throw "bad format";
+ }
+ destBuffer[dstOff + 0] = sRGBChannelToLinear(srcColor[0]);
+ destBuffer[dstOff + 1] = sRGBChannelToLinear(srcColor[1]);
+ destBuffer[dstOff + 2] = sRGBChannelToLinear(srcColor[2]);
+ destBuffer[dstOff + 3] = alpha;
+ }
+ }
+}
+
+function getBlockSize(format) {
+ var isDXT1 = format == ext.COMPRESSED_SRGB_S3TC_DXT1_EXT ||
+ format == ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ return isDXT1 ? 8 : 16;
+}
+
+function uncompressDXTSRGB(width, height, data, format) {
+ if (width % 4 || height % 4) throw "bad width or height";
+
+ var dest = new Uint8Array(width * height * 4);
+ var blocksAcross = width / 4;
+ var blocksDown = height / 4;
+ var blockSize = getBlockSize(format);
+ for (var yy = 0; yy < blocksDown; ++yy) {
+ for (var xx = 0; xx < blocksAcross; ++xx) {
+ uncompressDXTBlockSRGB(
+ dest, xx * 4, yy * 4, width, data,
+ (yy * blocksAcross + xx) * blockSize, format);
+ }
+ }
+ return dest;
+}
+
+function uncompressDXTIntoSubRegionSRGB(width, height, subX0, subY0, subWidth, subHeight, data, format)
+{
+ if (width % 4 || height % 4 || subX0 % 4 || subY0 % 4 || subWidth % 4 || subHeight % 4)
+ throw "bad dimension";
+
+ var dest = new Uint8Array(width * height * 4);
+ // Zero-filled DXT1 texture represents [0, 0, 0, 255]
+ if (format == ext.COMPRESSED_SRGB_S3TC_DXT1_EXT || format == ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT) {
+ for (var i = 3; i < dest.length; i += 4) dest[i] = 255;
+ }
+ var blocksAcross = subWidth / 4;
+ var blocksDown = subHeight / 4;
+ var blockSize = getBlockSize(format);
+ for (var yy = 0; yy < blocksDown; ++yy) {
+ for (var xx = 0; xx < blocksAcross; ++xx) {
+ uncompressDXTBlockSRGB(
+ dest, subX0 + xx * 4, subY0 + yy * 4, width, data,
+ (yy * blocksAcross + xx) * blockSize, format);
+ }
+ }
+ return dest;
+}
+
+function copyRect(data, srcX, srcY, dstX, dstY, width, height, stride) {
+ var bytesPerLine = width * 4;
+ var srcOffset = srcX * 4 + srcY * stride;
+ var dstOffset = dstX * 4 + dstY * stride;
+ for (; height > 0; --height) {
+ for (var ii = 0; ii < bytesPerLine; ++ii) {
+ data[dstOffset + ii] = data[srcOffset + ii];
+ }
+ srcOffset += stride;
+ dstOffset += stride;
+ }
+}
+
+function testDXTTexture(test, useTexStorage) {
+ var data = new Uint8Array(test.data);
+ var width = test.width;
+ var height = test.height;
+ var format = test.format;
+
+ var uncompressedData = uncompressDXTSRGB(width, height, data, format);
+
+ canvas.width = width;
+ canvas.height = height;
+ gl.viewport(0, 0, width, height);
+ debug("testing " + ctu.formatToString(ext, format) + " " + width + "x" + height +
+ (useTexStorage ? " via texStorage2D" : " via compressedTexImage2D"));
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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);
+ if (useTexStorage) {
+ if (test.subData) {
+ var uncompressedDataSub = uncompressDXTIntoSubRegionSRGB(
+ width, height, test.subX0, test.subY0, test.subWidth, test.subHeight, test.subData, format);
+ var tex1 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex1);
+ 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);
+
+ gl.texStorage2D(gl.TEXTURE_2D, 1, format, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed texture via texStorage2D");
+ gl.compressedTexSubImage2D(
+ gl.TEXTURE_2D, 0, test.subX0, test.subY0, test.subWidth, test.subHeight, format, test.subData);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture data via compressedTexSubImage2D");
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad 1");
+ compareRect(width, height, test.channels, uncompressedDataSub, "NEAREST");
+
+ // Clean up and recover
+ gl.deleteTexture(tex1);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ }
+
+ gl.texStorage2D(gl.TEXTURE_2D, 1, format, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "allocating compressed texture via texStorage2D");
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ var clearColor = (test.hasAlpha ? [0, 0, 0, 0] : [0, 0, 0, 255]);
+ wtu.checkCanvas(gl, clearColor, "texture should be initialized to black");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture data via compressedTexSubImage2D");
+ } else {
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture");
+ }
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "trying to generate mipmaps from compressed texture");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after clearing generateMipmap error");
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad 1");
+ compareRect(width, height, test.channels, uncompressedData, "NEAREST");
+ // Test again with linear filtering.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad 2");
+ compareRect(width, height, test.channels, uncompressedData, "LINEAR");
+
+ if (!useTexStorage) {
+ // It's not allowed to redefine textures defined via texStorage2D.
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height, 1, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "non 0 border");
+
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width + 4, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height + 4, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 4, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 4, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 1, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width - 2, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 1, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 0, format, width, height - 2, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+
+ if (width == 4) {
+ // The width/height of the implied base level must be a multiple of the block size.
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, 1, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions for level > 0");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, 2, height, 0, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "valid dimensions for level > 0");
+ }
+ if (height == 4) {
+ // The width/height of the implied base level must be a multiple of the block size.
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, width, 1, 0, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions for level > 0");
+ gl.compressedTexImage2D(gl.TEXTURE_2D, 1, format, width, 2, 0, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "valid dimensions for level > 0");
+ }
+ }
+
+ // pick a wrong format that uses the same amount of data.
+ var wrongFormat;
+ switch (format) {
+ case ext.COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ wrongFormat = ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
+ break;
+ case ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
+ wrongFormat = ext.COMPRESSED_SRGB_S3TC_DXT1_EXT;
+ break;
+ case ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
+ wrongFormat = ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
+ break;
+ case ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
+ wrongFormat = ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;
+ break;
+ }
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, wrongFormat, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "format does not match");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 4, 0, width, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "dimension out of range");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 4, width, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "dimension out of range");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width + 4, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height + 4, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width - 4, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height - 4, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "data size does not match dimensions");
+
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width - 1, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width - 2, height, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height - 1, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height - 2, format, data);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid dimensions");
+
+ var subData = new Uint8Array(data.buffer, 0, getBlockSize(format));
+
+ if (width == 8 && height == 8) {
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 1, 0, 4, 4, format, subData);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid offset");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 1, 4, 4, format, subData);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "invalid offset");
+ }
+
+ var stride = width * 4;
+ for (var yoff = 0; yoff < height; yoff += 4) {
+ for (var xoff = 0; xoff < width; xoff += 4) {
+ copyRect(uncompressedData, 0, 0, xoff, yoff, 4, 4, stride);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, xoff, yoff, 4, 4, format, subData);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading compressed texture");
+ // First test NEAREST filtering.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ wtu.clearAndDrawUnitQuad(gl);
+ compareRect(width, height, test.channels, uncompressedData, "NEAREST");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ // Next test LINEAR filtering.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ compareRect(width, height, test.channels, uncompressedData, "LINEAR");
+ }
+ }
+}
+
+function testDXT5_SRGB_ALPHA_PBO() {
+ debug("");
+ debug("testing PBO uploads");
+ var width = 8;
+ var height = 8;
+ var channels = 4;
+ var data = img_8x8_rgba_dxt5;
+ var format = ext.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT;
+ var uncompressedData = uncompressDXTSRGB(width, height, data, format);
+
+ var tex = gl.createTexture();
+
+ // First, PBO size = image size
+ var pbo1 = gl.createBuffer();
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo1);
+ gl.bufferData(gl.PIXEL_UNPACK_BUFFER, data, gl.STATIC_DRAW);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a PBO");
+
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texStorage2D(gl.TEXTURE_2D, 1, format, width, height);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data.length, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a texture from a PBO");
+
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ compareRect(width, height, channels, uncompressedData, "NEAREST");
+
+ // Clear the texture before the next test
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, new Uint8Array(data.length));
+
+ // Second, image is just a subrange of the PBO
+ var pbo2 = gl.createBuffer();
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo2);
+ gl.bufferData(gl.PIXEL_UNPACK_BUFFER, data.length*3, gl.STATIC_DRAW);
+ gl.bufferSubData(gl.PIXEL_UNPACK_BUFFER, data.length, data);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a PBO subrange");
+ gl.compressedTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, width, height, format, data.length, data.length);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "uploading a texture from a PBO subrange");
+ gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, null);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing unit quad");
+ compareRect(width, height, channels, uncompressedData, "NEAREST");
+}
+
+// See EXT_texture_sRGB, Section 3.8.x, sRGB Texture Color Conversion.
+function sRGBChannelToLinear(value) {
+ value = value / 255;
+ if (value <= 0.04045) {
+ value = value / 12.92;
+ } else {
+ value = Math.pow((value + 0.055) / 1.055, 2.4);
+ }
+ return Math.trunc(value * 255 + 0.5);
+}
+
+function compareRect(width, height, channels, expectedData, filteringMode) {
+ var actual = new Uint8Array(width * height * 4);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, actual);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "reading back pixels");
+
+ var div = document.createElement("div");
+ div.className = "testimages";
+ ctu.insertCaptionedImg(div, "expected", ctu.makeScaledImage(width, height, width, expectedData, true));
+ ctu.insertCaptionedImg(div, "actual", ctu.makeScaledImage(width, height, width, actual, true));
+ div.appendChild(document.createElement('br'));
+ document.getElementById("console").appendChild(div);
+
+ var failed = false;
+ for (var yy = 0; yy < height; ++yy) {
+ for (var xx = 0; xx < width; ++xx) {
+ var offset = (yy * width + xx) * 4;
+ var expected = expectedData.slice(offset, offset + 4);
+ // Compare RGB values
+ for (var jj = 0; jj < 3; ++jj) {
+ // Acceptable interpolation error depends on endpoints:
+ // 1.0 / 255.0 + 0.03 * max(abs(endpoint0 - endpoint1), abs(endpoint0_p - endpoint1_p))
+ // For simplicity, assume the worst case (e0 is 0.0, e1 is 1.0). After conversion to unorm8, it is 9.
+ if (Math.abs(actual[offset + jj] - expected[jj]) > 9) {
+ var was = actual[offset + 0].toString();
+ for (var j = 1; j < 3; ++j) {
+ was += "," + actual[offset + j];
+ }
+ failed = true;
+ testFailed('RGB at (' + xx + ', ' + yy +
+ ') expected: ' + expected + ' ± 9 was ' + was);
+ }
+ }
+
+ if (channels == 3) {
+ // BC1 RGB is allowed to be mapped to BC1 RGBA.
+ // In such a case, 3-color mode black value can be transparent:
+ // [0, 0, 0, 0] instead of [0, 0, 0, 255].
+
+ if (actual[offset + 3] != expected[3]) {
+ // Got non-opaque value for opaque format
+
+ // Check RGB values. Notice, that the condition here
+ // is more permissive than needed since we don't have
+ // compressed data at this point.
+ if (actual[offset] == 0 &&
+ actual[offset + 1] == 0 &&
+ actual[offset + 2] == 0 &&
+ actual[offset + 3] == 0) {
+ debug("<b>DXT1 SRGB is mapped to DXT1 SRGB ALPHA</b>");
+ } else {
+ failed = true;
+ testFailed('Alpha at (' + xx + ', ' + yy +
+ ') expected: ' + expected[3] + ' was ' + actual[offset + 3]);
+ }
+ }
+ } else {
+ // Compare Alpha values
+ // Acceptable interpolation error depends on endpoints:
+ // 1.0 / 65535.0 + 0.03 * max(abs(endpoint0 - endpoint1), abs(endpoint0_p - endpoint1_p))
+ // For simplicity, assume the worst case (e0 is 0.0, e1 is 1.0). After conversion to unorm8, it is 8.
+ if (Math.abs(actual[offset + 3] - expected[3]) > 8) {
+ var was = actual[offset + 3].toString();
+ failed = true;
+ testFailed('Alpha at (' + xx + ', ' + yy +
+ ') expected: ' + expected + ' ± 8 was ' + was);
+ }
+ }
+ }
+ }
+ if (!failed) {
+ testPassed("texture rendered correctly with " + filteringMode + " filtering");
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html
new file mode 100644
index 0000000000..ab50e64d07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-compressed-texture-size-limit.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL compressed texture size limit conformance 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="../../js/tests/webgl-compressed-texture-size-limit.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+enableJSTestPreVerboseLogging();
+description("Checks size limit of the webgl compressed textures")
+
+// ArrayBuffers can be at most 4GB (minus 1 byte), but any allocations larger than 1 GB are unreliable in practice. So limit allocations to 1 GB.
+// Textures that are wide in just one dimension can still be used to test max TEXTURE_2D size limit even if we can't allocate space for huge square textures.
+// Use a fairly conservative limit for positive test cube map size so OOM is avoided.
+runCompressedTextureSizeLimitTest(Math.pow(2, 30), 2048);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html
new file mode 100644
index 0000000000..7901225db7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-renderer-info.html
@@ -0,0 +1,104 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WebGL_debug_renderer_info Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 1px; height: 1px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders for testing standard derivatives -->
+
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_debug_renderer_info extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+var ext = null;
+var vao = null;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ runTestDisabled();
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("WEBGL_debug_renderer_info");
+ if (!ext) {
+ testPassed("No WEBGL_debug_renderer_info support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled WEBGL_debug_renderer_info extension");
+
+ runSupportedTest(true);
+ runTestEnabled();
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("WEBGL_debug_renderer_info") >= 0) {
+ if (extensionEnabled) {
+ testPassed("WEBGL_debug_renderer_info listed as supported and getExtension succeeded");
+ } else {
+ testFailed("WEBGL_debug_renderer_info listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("WEBGL_debug_renderer_info not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("WEBGL_debug_renderer_info not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runTestDisabled() {
+ debug("Testing enums with extension disabled");
+
+ // Use the constants directly as we don't have the extension
+
+ var UNMASKED_VENDOR_WEBGL = 0x9245;
+ gl.getParameter(UNMASKED_VENDOR_WEBGL);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "UNMASKED_VENDOR_WEBGL should not be queryable if extension is disabled");
+
+ var UNMASKED_RENDERER_WEBGL = 0x9246;
+ gl.getParameter(UNMASKED_RENDERER_WEBGL);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "UNMASKED_RENDERER_WEBGL should not be queryable if extension is disabled");
+}
+
+function runTestEnabled() {
+ debug("Testing enums with extension enabled");
+
+ shouldBe("ext.UNMASKED_VENDOR_WEBGL", "0x9245");
+ gl.getParameter(ext.UNMASKED_VENDOR_WEBGL);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "UNMASKED_VENDOR_WEBGL query should succeed if extension is enable");
+
+ shouldBe("ext.UNMASKED_RENDERER_WEBGL", "0x9246");
+ gl.getParameter(ext.UNMASKED_RENDERER_WEBGL);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "UNMASKED_RENDERER_WEBGL query should succeed if extension is enable");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html
new file mode 100644
index 0000000000..9a95736a86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-debug-shaders.html
@@ -0,0 +1,144 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WebGL_debug_shaders Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" style="width: 1px; height: 1px;"> </canvas>
+<div id="console"></div>
+<!-- Shaders for testing standard derivatives -->
+
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_debug_shaders extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+var ext = null;
+var shader = null;
+var program = null;
+var info = null;
+var translatedSource;
+var newTranslatedSource;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("WEBGL_debug_shaders");
+ if (!ext) {
+ testPassed("No WEBGL_debug_shaders support -- this is legal");
+
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled WEBGL_debug_shaders extension");
+
+ runSupportedTest(true);
+ runTestEnabled();
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("WEBGL_debug_shaders") >= 0) {
+ if (extensionEnabled) {
+ testPassed("WEBGL_debug_shaders listed as supported and getExtension succeeded");
+ } else {
+ testFailed("WEBGL_debug_shaders listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("WEBGL_debug_shaders not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("WEBGL_debug_shaders not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runTestEnabled() {
+ debug("Testing function with extension enabled");
+
+ var shaderInfos = [
+ {
+ source: "void main() { gl_Position = vec4(1.0, 0.0, 0.0, 1.0); }",
+ type: gl.VERTEX_SHADER
+ },
+ {
+ source: "void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }",
+ type: gl.FRAGMENT_SHADER
+ }
+ ];
+
+ // Do this twice to test for caching issues.
+ for (var jj = 0; jj < 2; ++jj) {
+ debug("pass:" + (jj + 1));
+ program = gl.createProgram();
+ for (var ii = 0; ii < shaderInfos.length; ++ii) {
+ info = shaderInfos[ii];
+
+ shader = gl.createShader(info.type);
+
+ // if no source has been defined or compileShader() has not been called,
+ // getTranslatedShaderSource() should return an empty string.
+ shouldBe("ext.getTranslatedShaderSource(shader)", '""');
+ gl.shaderSource(shader, info.source);
+ shouldBe("ext.getTranslatedShaderSource(shader)", '""');
+ gl.compileShader(shader);
+ shouldBeTrue("gl.getShaderParameter(shader, gl.COMPILE_STATUS)");
+ translatedSource = ext.getTranslatedShaderSource(shader);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "No gl error should occur");
+ if (translatedSource && translatedSource.length > 0) {
+ testPassed("Successfully called getTranslatedShaderSource()");
+ } else {
+ testFailed("Calling getTranslatedShaderSource() failed");
+ }
+ gl.attachShader(program, shader);
+ }
+ gl.linkProgram(program);
+ shouldBeTrue("gl.getProgramParameter(program, gl.LINK_STATUS)");
+ }
+
+ // Test changing the source. Make sure we get the correct source each time.
+ debug("test changing source");
+ shader = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(shader, "void main() { gl_FragColor = vec4(gl_FragCoord.x, 0.0, 0.0, 1.0); }");
+ gl.compileShader(shader);
+ shouldBeTrue("gl.getShaderParameter(shader, gl.COMPILE_STATUS)");
+ shouldThrow("ext.getTranslatedShaderSource(null)");
+ translatedSource = ext.getTranslatedShaderSource(shader);
+ shouldBeTrue('translatedSource && translatedSource.indexOf("gl_FragCoord") >= 0');
+ // change the source but don't compile.
+ gl.shaderSource(shader, "void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }");
+ // the source should NOT change. It should be the same as the old source.
+ newTranslatedSource = ext.getTranslatedShaderSource(shader);
+ shouldBe('newTranslatedSource', 'translatedSource');
+ // now compile.
+ gl.compileShader(shader);
+ shouldBeTrue("gl.getShaderParameter(shader, gl.COMPILE_STATUS)");
+ // the source should have change.
+ newTranslatedSource = ext.getTranslatedShaderSource(shader);
+ shouldNotBe('newTranslatedSource', 'translatedSource');
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html
new file mode 100644
index 0000000000..f2318cc1d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-depth-texture.html
@@ -0,0 +1,377 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>WebGL WEBGL_depth_texture Conformance Tests</title>
+</head>
+<body>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main()
+{
+ gl_Position = a_position;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D u_texture;
+uniform vec2 u_resolution;
+void main()
+{
+ vec2 texcoord = (gl_FragCoord.xy - vec2(0.5)) / (u_resolution - vec2(1.0));
+ gl_FragColor = texture2D(u_texture, texcoord);
+}
+</script>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_depth_texture extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+var program = wtu.setupTexturedQuad(gl);
+var ext = null;
+var vao = null;
+var tex;
+var name;
+var supportedFormats;
+var canvas2;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ runTestDisabled();
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = wtu.getExtensionWithKnownPrefixes(gl, "WEBGL_depth_texture");
+ if (!ext) {
+ testPassed("No WEBGL_depth_texture support -- this is legal");
+ runSupportedTest(false);
+ } else {
+ testPassed("Successfully enabled WEBGL_depth_texture extension");
+
+ runSupportedTest(true);
+ runTestExtension(true);
+ runTestExtension(false);
+ }
+}
+
+function runSupportedTest(extensionEnabled) {
+ var name = wtu.getSupportedExtensionWithKnownPrefixes(gl, "WEBGL_depth_texture");
+ if (name !== undefined) {
+ if (extensionEnabled) {
+ testPassed("WEBGL_depth_texture listed as supported and getExtension succeeded");
+ } else {
+ testFailed("WEBGL_depth_texture listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("WEBGL_depth_texture not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("WEBGL_depth_texture not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+
+function runTestDisabled() {
+ debug("Testing binding enum with extension disabled");
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ wtu.shouldGenerateGLError(gl, [gl.INVALID_ENUM, gl.INVALID_VALUE],
+ 'gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, 1, 1, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_SHORT, null)');
+ wtu.shouldGenerateGLError(gl, [gl.INVALID_ENUM, gl.INVALID_VALUE],
+ 'gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, 1, 1, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null)');
+}
+
+
+function dumpIt(gl, res, msg) {
+ return; // comment out to debug
+ debug(msg);
+ var actualPixels = new Uint8Array(res * res * 4);
+ gl.readPixels(0, 0, res, res, gl.RGBA, gl.UNSIGNED_BYTE, actualPixels);
+
+ for (var yy = 0; yy < res; ++yy) {
+ var strs = [];
+ for (var xx = 0; xx < res; ++xx) {
+ var actual = (yy * res + xx) * 4;
+ strs.push("(" + actualPixels[actual] + "," + actualPixels[actual+1] + "," + actualPixels[actual + 2] + "," + actualPixels[actual + 3] + ")");
+ }
+ debug(strs.join(" "));
+ }
+}
+function runTestExtension(unpackFlipY) {
+ debug("Testing WEBGL_depth_texture. UNPACK_FLIP_Y_WEBGL: " + unpackFlipY);
+
+ const res = 2;
+ const destRes = 4;
+
+ // make canvas for testing.
+ canvas2 = document.createElement("canvas");
+ canvas2.width = res;
+ canvas2.height = res;
+ var ctx = canvas2.getContext("2d");
+ ctx.fillStyle = "blue";
+ ctx.fillRect(0, 0, canvas2.width, canvas2.height);
+
+ var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['a_position']);
+ gl.useProgram(program);
+ gl.uniform2f(gl.getUniformLocation(program, "u_resolution"), destRes, destRes);
+
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array(
+ [ 1, 1, 1,
+ -1, 1, 0,
+ -1, -1, -1,
+ 1, 1, 1,
+ -1, -1, -1,
+ 1, -1, 0,
+ ]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, unpackFlipY);
+
+ var types = [
+ {obj: 'gl', attachment: 'DEPTH_ATTACHMENT', format: 'DEPTH_COMPONENT', type: 'UNSIGNED_SHORT', data: 'new Uint16Array(1)', depthBits: "16"},
+ {obj: 'gl', attachment: 'DEPTH_ATTACHMENT', format: 'DEPTH_COMPONENT', type: 'UNSIGNED_INT', data: 'new Uint32Array(1)', depthBits: "16"},
+ {obj: 'ext', attachment: 'DEPTH_STENCIL_ATTACHMENT', format: 'DEPTH_STENCIL', type: 'UNSIGNED_INT_24_8_WEBGL', data: 'new Uint32Array(1)', depthBits: "24", stencilBits: "8"}
+ ];
+
+ for (var ii = 0; ii < types.length; ++ii) {
+ var typeInfo = types[ii];
+ var type = typeInfo.type;
+ var typeStr = typeInfo.obj + '.' + type;
+
+ debug("");
+ debug("testing: " + type);
+
+ // check that cubemaps are not allowed.
+ var cubeTex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeTex);
+ var targets = [
+ 'TEXTURE_CUBE_MAP_POSITIVE_X',
+ 'TEXTURE_CUBE_MAP_NEGATIVE_X',
+ 'TEXTURE_CUBE_MAP_POSITIVE_Y',
+ 'TEXTURE_CUBE_MAP_NEGATIVE_Y',
+ 'TEXTURE_CUBE_MAP_POSITIVE_Z',
+ 'TEXTURE_CUBE_MAP_NEGATIVE_Z'
+ ];
+ for (var tt = 0; tt < targets.length; ++tt) {
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.texImage2D(gl.' + targets[ii] + ', 0, gl.' + typeInfo.format + ', 1, 1, 0, gl.' + typeInfo.format + ', ' + typeStr + ', null)');
+ }
+
+ // The WebGL_depth_texture extension supports both NEAREST and
+ // LINEAR filtering for depth textures, even though LINEAR
+ // doesn't have much meaning, and isn't supported in WebGL
+ // 2.0. Still, test both.
+ var filterModes = [
+ 'LINEAR',
+ 'NEAREST'
+ ];
+
+ for (var jj = 0; jj < filterModes.length; ++jj) {
+ debug('');
+ debug('testing ' + filterModes[jj] + ' filtering');
+ var filterMode = gl[filterModes[jj]];
+
+ // check 2d textures.
+ tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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, filterMode);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filterMode);
+
+ // test level > 0
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.texImage2D(gl.TEXTURE_2D, 1, gl.' + typeInfo.format + ', 1, 1, 0, gl.' + typeInfo.format + ', ' + typeStr + ', null)');
+
+ // test with data
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.texImage2D(gl.TEXTURE_2D, 0, gl.' + typeInfo.format + ', 1, 1, 0, gl.' + typeInfo.format + ', ' + typeStr + ', ' + typeInfo.data + ')');
+
+ // test with canvas
+ wtu.shouldGenerateGLError(gl, [gl.INVALID_VALUE, gl.INVALID_ENUM, gl.INVALID_OPERATION], 'gl.texImage2D(gl.TEXTURE_2D, 0, gl.' + typeInfo.format + ', gl.' + typeInfo.format + ', ' + typeStr + ', canvas2)');
+
+ // test copyTexImage2D
+ wtu.shouldGenerateGLError(gl, [gl.INVALID_ENUM, gl.INVALID_OPERATION], 'gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.' + typeInfo.format + ', 0, 0, 1, 1, 0)');
+
+ // test real thing
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, 'gl.texImage2D(gl.TEXTURE_2D, 0, gl.' + typeInfo.format + ', ' + res + ', ' + res + ', 0, gl.' + typeInfo.format + ', ' + typeStr + ', null)');
+
+ // test texSubImage2D
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 1, 1, gl.' + typeInfo.format + ', ' + typeStr + ', ' + typeInfo.data + ')');
+
+ // test copyTexSubImage2D
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1)');
+
+ // test generateMipmap
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, 'gl.generateMipmap(gl.TEXTURE_2D)');
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl[typeInfo.attachment], gl.TEXTURE_2D, tex, 0);
+
+ // Ensure DEPTH_BITS returns >= 16 bits for UNSIGNED_SHORT and UNSIGNED_INT, >= 24 UNSIGNED_INT_24_8_WEBGL.
+ // If there is stencil, ensure STENCIL_BITS reports >= 8 for UNSIGNED_INT_24_8_WEBGL.
+ shouldBeGreaterThanOrEqual('gl.getParameter(gl.DEPTH_BITS)', typeInfo.depthBits);
+ if (typeInfo.stencilBits === undefined) {
+ shouldBe('gl.getParameter(gl.STENCIL_BITS)', '0');
+ } else {
+ shouldBeGreaterThanOrEqual('gl.getParameter(gl.STENCIL_BITS)', typeInfo.stencilBits);
+ }
+
+ // TODO: remove this check if the spec is updated to require these combinations to work.
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE)
+ {
+ // try adding a color buffer.
+ var colorTex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, colorTex);
+ 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.RGBA, res, res, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTex, 0);
+ }
+
+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+
+ // use the default texture to render with while we return to the depth texture.
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ /* Setup 2x2 depth texture:
+ * 1 0.6 0.8
+ * |
+ * 0 0.2 0.4
+ * 0---1
+ */
+ const d00 = 0.2;
+ const d01 = 0.4;
+ const d10 = 0.6;
+ const d11 = 0.8;
+
+ gl.enable(gl.SCISSOR_TEST);
+
+ gl.scissor(0, 0, 1, 1);
+ gl.clearDepth(d00);
+ gl.clear(gl.DEPTH_BUFFER_BIT);
+
+ gl.scissor(1, 0, 1, 1);
+ gl.clearDepth(d10);
+ gl.clear(gl.DEPTH_BUFFER_BIT);
+
+ gl.scissor(0, 1, 1, 1);
+ gl.clearDepth(d01);
+ gl.clear(gl.DEPTH_BUFFER_BIT);
+
+ gl.scissor(1, 1, 1, 1);
+ gl.clearDepth(d11);
+ gl.clear(gl.DEPTH_BUFFER_BIT);
+
+ gl.disable(gl.SCISSOR_TEST);
+
+ // render the depth texture.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.canvas.width = destRes;
+ gl.canvas.height = destRes;
+ gl.viewport(0, 0, destRes, destRes);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+
+ gl.disable(gl.DITHER);
+ gl.enable(gl.DEPTH_TEST);
+ gl.clearColor(1, 0, 0, 1);
+ gl.clearDepth(1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ dumpIt(gl, res, "--depth--");
+
+ var actualPixels = new Uint8Array(destRes * destRes * 4);
+ gl.readPixels(0, 0, destRes, destRes, gl.RGBA, gl.UNSIGNED_BYTE, actualPixels);
+
+ const eps = 0.002;
+
+ let expectedMin;
+ let expectedMax;
+ if (filterMode == gl.NEAREST) {
+ expectedMin = [
+ d00, d00, d10, d10,
+ d00, d00, d10, d10,
+ d01, d01, d11, d11,
+ d01, d01, d11, d11
+ ];
+ expectedMax = expectedMin.slice();
+
+ expectedMin = expectedMin.map(x => x - eps);
+ expectedMax = expectedMax.map(x => x + eps);
+ } else {
+ expectedMin = [
+ d00-eps, d00, d00, d10-eps,
+ d00, d00, d00, d10,
+ d00, d00, d00, d10,
+ d01-eps, d01, d01, d11-eps,
+ ];
+ expectedMax = [
+ d00+eps, d10, d10, d10+eps,
+ d01, d11, d11, d11,
+ d01, d11, d11, d11,
+ d01+eps, d11, d11, d11+eps,
+ ];
+ }
+
+ for (var yy = 0; yy < destRes; ++yy) {
+ for (var xx = 0; xx < destRes; ++xx) {
+ const t = xx + destRes*yy;
+ const was = actualPixels[4*t] / 255.0; // 4bpp
+ const eMin = expectedMin[t];
+ const eMax = expectedMax[t];
+ let func = testPassed;
+ const text = `At ${xx},${yy}, expected within [${eMin},${eMax}], was ${was.toFixed(3)}`
+ if (was <= eMin || was >= eMax) {
+ func = testFailed;
+ }
+ func(text);
+ }
+ }
+
+ // check limitations
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl[typeInfo.attachment], gl.TEXTURE_2D, null, 0);
+ var badAttachment = typeInfo.attachment == 'DEPTH_ATTACHMENT' ? 'DEPTH_STENCIL_ATTACHMENT' : 'DEPTH_ATTACHMENT';
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, 'gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.' + badAttachment + ', gl.TEXTURE_2D, tex, 0)');
+ shouldNotBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+ wtu.shouldGenerateGLError(gl, gl.INVALID_FRAMEBUFFER_OPERATION, 'gl.clear(gl.DEPTH_BUFFER_BIT)');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+ }
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-broadcast-return.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-broadcast-return.html
new file mode 100644
index 0000000000..d773ae8621
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-broadcast-return.html
@@ -0,0 +1,138 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WEBGL_draw_buffers Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/webgl-draw-buffers-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="64" height="64"> </canvas>
+<div id="console"></div>
+<script id="fshaderRedWithReturn" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+uniform float u_zero;
+void main() {
+ gl_FragColor = vec4(1,0,0,1);
+ if (u_zero < 1.0) {
+ return;
+ }
+ gl_FragColor = vec4(0,0,1,1);
+}
+</script>
+<script id="fshaderWithDiscard" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+uniform float u_zero;
+void main() {
+ gl_FragColor = vec4(1,0,0,1);
+ if (u_zero < 1.0) {
+ discard;
+ }
+ gl_FragColor = vec4(0,0,1,1);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies gl_FragColor being broadcasted when using WEBGL_draw_buffers extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+var drawBuffersUtils;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("WEBGL_draw_buffers");
+ if (!ext) {
+ testPassed("No WEBGL_draw_buffers support -- this is legal");
+ } else {
+ testPassed("Successfully enabled WEBGL_draw_buffers extension");
+ drawBuffersUtils = WebGLDrawBuffersUtils(gl, ext);
+ runDrawTests();
+ }
+}
+
+function runDrawTests() {
+ debug("");
+ var fb = gl.createFramebuffer();
+
+ var maxUsable = drawBuffersUtils.getMaxUsableColorAttachments();
+ var bufs = drawBuffersUtils.makeColorAttachmentArray(maxUsable);
+
+ var width = 64;
+ var height = 64;
+ var attachments = [];
+ for (var ii = 0; ii < maxUsable; ++ii) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ 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.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ii, gl.TEXTURE_2D, tex, 0);
+ attachments.push({
+ texture: tex
+ });
+ }
+
+ debug("test that gl_FragColor broadcasts if extension is enabled in fragment shader and fragment shader main returns in the middle");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ var redProgramWithReturn = wtu.setupProgram(gl, [wtu.simpleVertexShader, "fshaderRedWithReturn"], ["vPosition"], undefined, true);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.useProgram(redProgramWithReturn);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after draw");
+
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [255, 0, 0, 255]);
+
+ debug("test that none of the attachments are written in case the fragment shader discards");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ var programWithDiscard = wtu.setupProgram(gl, [wtu.simpleVertexShader, "fshaderWithDiscard"], ["vPosition"], undefined, true);
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.useProgram(programWithDiscard);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after draw");
+
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [0, 0, 0, 0]);
+
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.deleteFramebuffer(fb);
+ attachments.forEach(function(attachment) {
+ gl.deleteTexture(attachment.texture);
+ });
+ gl.deleteProgram(redProgramWithReturn);
+ gl.deleteProgram(programWithDiscard);
+}
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html
new file mode 100644
index 0000000000..5866a3c38b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-framebuffer-unsupported.html
@@ -0,0 +1,126 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WEBGL_draw_buffers FRAMEBUFFER_UNSUPPORTED 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl;
+var canvas = document.getElementById("canvas");
+var fb1 = null;
+var fb2 = null;
+
+function checkFramebuffer(expected) {
+ var actual = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ if (expected.indexOf(actual) < 0) {
+ var msg = "checkFramebufferStatus expects [";
+ for (var index = 0; index < expected.length; ++index) {
+ msg += wtu.glEnumToString(gl, expected[index]);
+ if (index + 1 < expected.length)
+ msg += ", ";
+ }
+ msg += "], was " + wtu.glEnumToString(gl, actual);
+ testFailed(msg);
+ } else {
+ var msg = "checkFramebufferStatus got " + wtu.glEnumToString(gl, actual) +
+ " as expected";
+ testPassed(msg);
+ }
+}
+
+function testImageAttachedTwoPoints() {
+ debug("");
+ debug("Checking an image is attached to more than one color attachment in a framebuffer.");
+
+ var tex1 = gl.createTexture();
+ var tex2 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex1);
+ gl.texImage2D(gl.TEXTURE_2D,
+ 0, // level
+ gl.RGBA, // internalFormat
+ 1, // width
+ 1, // height
+ 0, // border
+ gl.RGBA, // format
+ gl.UNSIGNED_BYTE, // type
+ new Uint8Array(4)); // data
+ gl.bindTexture(gl.TEXTURE_2D, tex2);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Texture creation should succeed.");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb1);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, ext.COLOR_ATTACHMENT0_WEBGL, gl.TEXTURE_2D, tex1, 0);
+ checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, ext.COLOR_ATTACHMENT1_WEBGL, gl.TEXTURE_2D, tex2, 0);
+ checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, ext.COLOR_ATTACHMENT2_WEBGL, gl.TEXTURE_2D, tex1, 0);
+ checkFramebuffer([gl.FRAMEBUFFER_UNSUPPORTED]);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ var texCube = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube);
+ for (var target = gl.TEXTURE_CUBE_MAP_POSITIVE_X; target < gl.TEXTURE_CUBE_MAP_POSITIVE_X + 6; target++) {
+ gl.texImage2D(target, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));
+ }
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, ext.COLOR_ATTACHMENT0_WEBGL, gl.TEXTURE_CUBE_MAP_POSITIVE_X, texCube, 0);
+ checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, ext.COLOR_ATTACHMENT1_WEBGL, gl.TEXTURE_CUBE_MAP_POSITIVE_Y, texCube, 0);
+ checkFramebuffer([gl.FRAMEBUFFER_COMPLETE]);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, ext.COLOR_ATTACHMENT2_WEBGL, gl.TEXTURE_CUBE_MAP_POSITIVE_X, texCube, 0);
+ checkFramebuffer([gl.FRAMEBUFFER_UNSUPPORTED]);
+
+ // Clean up
+ gl.deleteTexture(tex1);
+ gl.deleteTexture(tex2);
+ gl.deleteTexture(texCube);
+}
+
+description("This tests FRAMEBUFFER_UNSUPPORTED.");
+
+shouldBeNonNull("gl = wtu.create3DContext(undefined, undefined, 1)");
+fb1 = gl.createFramebuffer();
+fb2 = gl.createFramebuffer();
+
+var ext = gl.getExtension("WEBGL_draw_buffers");
+if (!ext) {
+ testPassed("No WEBGL_draw_buffers support -- this is legal");
+} else {
+ var bufs = [ext.COLOR_ATTACHMENT0_WEBGL, ext.COLOR_ATTACHMENT1_WEBGL, ext.COLOR_ATTACHMENT2_WEBGL];
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb1);
+ ext.drawBuffersWEBGL(bufs);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call drawBuffersWEBGL successfully");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ ext.drawBuffersWEBGL(bufs);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call drawBuffersWEBGL successfully");
+
+ testPassed("Successfully enabled WEBGL_draw_buffers extension");
+ testImageAttachedTwoPoints();
+
+ gl.deleteFramebuffer(fb1);
+ gl.deleteFramebuffer(fb2);
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html
new file mode 100644
index 0000000000..8181a6a587
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers-max-draw-buffers.html
@@ -0,0 +1,118 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WEBGL_draw_buffers gl_FragData[gl_MaxDrawBuffers] Conformance 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>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="64" height="64"> </canvas>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main() {
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+void main() {
+ gl_FragData[gl_MaxDrawBuffers] = vec4(0.0);
+}
+</script>
+<script id="fshaderConstantIndex" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+void main() {
+ gl_FragData[$(gl_MaxDrawBuffers)] = vec4(0.0);
+}
+</script>
+<script id="fshaderTestMaxDrawBuffersValue" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+void main() {
+ gl_FragColor = ($(gl_MaxDrawBuffers) == gl_MaxDrawBuffers) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies that compiling the same shader using GL_EXT_draw_buffers twice will have similar results on both rounds.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+var maxDrawBuffers;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ ext = gl.getExtension("WEBGL_draw_buffers");
+ if (!ext) {
+ testPassed("No WEBGL_draw_buffers support -- this is legal");
+ finishTest();
+ } else {
+ testPassed("Successfully enabled WEBGL_draw_buffers extension");
+ maxDrawBuffers = gl.getParameter(ext.MAX_DRAW_BUFFERS_WEBGL);
+ runShadersTest();
+ finishTest();
+ }
+}
+
+function testValueOfMaxDrawBuffers() {
+ debug("Test the value of gl_MaxDrawBuffers in a shader");
+ var fshader = wtu.replaceParams(wtu.getScript("fshaderTestMaxDrawBuffersValue"), {"gl_MaxDrawBuffers": maxDrawBuffers});
+ var program = wtu.setupProgram(gl, ["vshader", fshader], ["a_position"], undefined, true);
+ expectTrue(program != null, "Test program should compile");
+ wtu.setupUnitQuad(gl);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green to indicate that gl_MaxDrawBuffers had the right value");
+ gl.deleteProgram(program);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function runSingleTest(shaders, indexMsg) {
+ var program = wtu.setupProgram(gl, shaders, ["a_position"], undefined, true);
+ var programLinkedSuccessfully = (program != null);
+ expectTrue(!programLinkedSuccessfully, "Program where gl_FragData is indexed by " + indexMsg + " should fail compilation.");
+ gl.deleteProgram(program);
+}
+
+function runShadersTest() {
+ debug("MAX_DRAW_BUFFERS_WEBGL is: " + maxDrawBuffers);
+
+ // For reference, use a constant out-of-range parameter to test:
+ debug("Test indexing gl_FragData with value of MAX_DRAW_BUFFERS_WEBGL");
+ var fshader = wtu.replaceParams(wtu.getScript("fshaderConstantIndex"), {"gl_MaxDrawBuffers": maxDrawBuffers});
+ runSingleTest(["vshader", fshader], maxDrawBuffers + " (value of MAX_DRAW_BUFFERS_WEBGL)");
+
+ debug("");
+
+ debug("Test indexing gl_FragData with gl_MaxDrawBuffers");
+ debug("Repeat this test twice as that has revealed a bug.");
+ for (var i = 0; i < 2; ++i) {
+ runSingleTest(["vshader", "fshader"], "gl_MaxDrawBuffers");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+ debug("");
+
+ testValueOfMaxDrawBuffers();
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html
new file mode 100644
index 0000000000..a33844f6b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-draw-buffers.html
@@ -0,0 +1,812 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL WEBGL_draw_buffers Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/webgl-draw-buffers-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="64" height="64"> </canvas>
+<div id="console"></div>
+<script id="fshader" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+uniform vec4 u_colors[$(numDrawingBuffers)];
+void main() {
+ for (int i = 0; i < $(numDrawingBuffers); ++i) {
+ gl_FragData[i] = u_colors[i];
+ }
+}
+</script>
+<script id="fshaderNoWrite" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+void main() {
+}
+</script>
+<script id="fshaderRed" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(1,0,0,1);
+}
+</script>
+<script id="fshaderRedWithExtension" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(1,0,0,1);
+}
+</script>
+<script id="fshaderMacroDisabled" type="x-shader/x-fragment">
+#ifdef GL_EXT_draw_buffers
+ bad code here
+#endif
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(0,0,0,0);
+}
+</script>
+<script id="fshaderMacroEnabled" type="x-shader/x-fragment">
+#ifdef GL_EXT_draw_buffers
+ #if GL_EXT_draw_buffers == 1
+ #define CODE
+ #else
+ #define CODE this_code_is_bad_it_should_have_compiled
+ #endif
+#else
+ #define CODE this_code_is_bad_it_should_have_compiled
+#endif
+CODE
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(0,0,0,0);
+}
+</script>
+<script id="fshaderBuiltInConstEnabled" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ gl_FragColor = (gl_MaxDrawBuffers == $(numDrawingBuffers)) ? vec4(0,1,0,1) : vec4(1,0,0,1);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies the functionality of the WEBGL_draw_buffers extension, if it is available.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+var ext = null;
+var programWithMaxDrawBuffersEqualOne = null;
+var drawBuffersUtils;
+let fb;
+
+var extensionConstants = [
+ { name: "MAX_COLOR_ATTACHMENTS_WEBGL", enum: 0x8CDF, expectedFn: function(v) { return v >= 4; }, passMsg: " should be >= 4"},
+ { name: "MAX_DRAW_BUFFERS_WEBGL", enum: 0x8824, expectedFn: function(v) { return v > 0; }, passMsg: " should be > 0"},
+
+ { name: "COLOR_ATTACHMENT0_WEBGL", enum: 0x8CE0, },
+ { name: "COLOR_ATTACHMENT1_WEBGL", enum: 0x8CE1, },
+ { name: "COLOR_ATTACHMENT2_WEBGL", enum: 0x8CE2, },
+ { name: "COLOR_ATTACHMENT3_WEBGL", enum: 0x8CE3, },
+ { name: "COLOR_ATTACHMENT4_WEBGL", enum: 0x8CE4, },
+ { name: "COLOR_ATTACHMENT5_WEBGL", enum: 0x8CE5, },
+ { name: "COLOR_ATTACHMENT6_WEBGL", enum: 0x8CE6, },
+ { name: "COLOR_ATTACHMENT7_WEBGL", enum: 0x8CE7, },
+ { name: "COLOR_ATTACHMENT8_WEBGL", enum: 0x8CE8, },
+ { name: "COLOR_ATTACHMENT9_WEBGL", enum: 0x8CE9, },
+ { name: "COLOR_ATTACHMENT10_WEBGL", enum: 0x8CEA, },
+ { name: "COLOR_ATTACHMENT11_WEBGL", enum: 0x8CEB, },
+ { name: "COLOR_ATTACHMENT12_WEBGL", enum: 0x8CEC, },
+ { name: "COLOR_ATTACHMENT13_WEBGL", enum: 0x8CED, },
+ { name: "COLOR_ATTACHMENT14_WEBGL", enum: 0x8CEE, },
+ { name: "COLOR_ATTACHMENT15_WEBGL", enum: 0x8CEF, },
+
+ { name: "DRAW_BUFFER0_WEBGL", enum: 0x8825, },
+ { name: "DRAW_BUFFER1_WEBGL", enum: 0x8826, },
+ { name: "DRAW_BUFFER2_WEBGL", enum: 0x8827, },
+ { name: "DRAW_BUFFER3_WEBGL", enum: 0x8828, },
+ { name: "DRAW_BUFFER4_WEBGL", enum: 0x8829, },
+ { name: "DRAW_BUFFER5_WEBGL", enum: 0x882A, },
+ { name: "DRAW_BUFFER6_WEBGL", enum: 0x882B, },
+ { name: "DRAW_BUFFER7_WEBGL", enum: 0x882C, },
+ { name: "DRAW_BUFFER8_WEBGL", enum: 0x882D, },
+ { name: "DRAW_BUFFER9_WEBGL", enum: 0x882E, },
+ { name: "DRAW_BUFFER10_WEBGL", enum: 0x882F, },
+ { name: "DRAW_BUFFER11_WEBGL", enum: 0x8830, },
+ { name: "DRAW_BUFFER12_WEBGL", enum: 0x8831, },
+ { name: "DRAW_BUFFER13_WEBGL", enum: 0x8832, },
+ { name: "DRAW_BUFFER14_WEBGL", enum: 0x8833, },
+ { name: "DRAW_BUFFER15_WEBGL", enum: 0x8834, },
+];
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ // Run tests with extension disabled
+ runEnumTestDisabled();
+ runShadersTestDisabled();
+ runAttachmentTestDisabled();
+
+ debug("");
+
+ // Query the extension and store globally so shouldBe can access it
+ ext = gl.getExtension("WEBGL_draw_buffers");
+ if (!ext) {
+ testPassed("No WEBGL_draw_buffers support -- this is legal");
+
+ runSupportedTest(false);
+ finishTest();
+ } else {
+ testPassed("Successfully enabled WEBGL_draw_buffers extension");
+
+ drawBuffersUtils = WebGLDrawBuffersUtils(gl, ext);
+ runSupportedTest(true);
+ runEnumTestEnabled();
+ runShadersTestEnabled();
+ runAttachmentTestEnabled();
+ runDrawTests();
+ runPreserveTests();
+ }
+}
+
+function createExtDrawBuffersProgram(scriptId, sub) {
+ var fsource = wtu.getScript(scriptId);
+ fsource = wtu.replaceParams(fsource, sub);
+ return wtu.setupProgram(gl, [wtu.simpleVertexShader, fsource], ["vPosition"], undefined, true);
+}
+
+function runSupportedTest(extensionEnabled) {
+ var supported = gl.getSupportedExtensions();
+ if (supported.indexOf("WEBGL_draw_buffers") >= 0) {
+ if (extensionEnabled) {
+ testPassed("WEBGL_draw_buffers listed as supported and getExtension succeeded");
+ } else {
+ testFailed("WEBGL_draw_buffers listed as supported but getExtension failed");
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed("WEBGL_draw_buffers not listed as supported but getExtension succeeded");
+ } else {
+ testPassed("WEBGL_draw_buffers not listed as supported and getExtension failed -- this is legal");
+ }
+ }
+}
+
+function runEnumTestDisabled() {
+ debug("");
+ debug("Testing binding enum with extension disabled");
+
+ // Use the constant directly as we don't have the extension
+ extensionConstants.forEach(function(c) {
+ if (c.expectedFn) {
+ shouldBeNull(`gl.getParameter(${c.enum})`);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, c.name + " should not be queryable if extension is disabled");
+ }
+ });
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function runEnumTestEnabled() {
+ debug("");
+ debug("Testing enums with extension enabled");
+
+ extensionConstants.forEach(function(c) {
+ shouldBe("ext." + c.name, "0x" + c.enum.toString(16));
+ if (c.expectedFn) {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "before getParameter");
+ debug(c.name + ": 0x" + ext[c.name].toString(16));
+ expectTrue(c.expectedFn(gl.getParameter(ext[c.name])), "gl.getParameter(ext." + c.name + ")" + c.passMsg);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, c.name + " query should succeed if extension is enabled");
+ }
+ });
+
+ shouldBeTrue("gl.getParameter(ext.MAX_COLOR_ATTACHMENTS_WEBGL) >= gl.getParameter(ext.MAX_DRAW_BUFFERS_WEBGL)");
+
+ debug("Testing drawBuffersWEBGL with default drawing buffer");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.BACK");
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "ext.drawBuffersWEBGL([])");
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "ext.drawBuffersWEBGL([gl.NONE, gl.NONE])");
+ wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "ext.drawBuffersWEBGL([ext.COLOR_ATTACHMENT0_WEBGL])");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.BACK");
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "ext.drawBuffersWEBGL([gl.NONE])");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.NONE");
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "ext.drawBuffersWEBGL([gl.BACK])");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.BACK");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+ debug("Testing drawBuffers and getParameter with bindFramebuffer, without drawing.");
+ fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.COLOR_ATTACHMENT0");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL+1)", "gl.NONE");
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "ext.drawBuffersWEBGL([gl.NONE])");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.BACK");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.NONE");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "ext.drawBuffersWEBGL([gl.NONE,gl.COLOR_ATTACHMENT0+1])");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.NONE");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL+1)", "gl.COLOR_ATTACHMENT0+1");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "ext.drawBuffersWEBGL([gl.COLOR_ATTACHMENT0,gl.COLOR_ATTACHMENT0+1])");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.COLOR_ATTACHMENT0");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL+1)", "gl.COLOR_ATTACHMENT0+1");
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteFramebuffer(fb)");
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL)", "gl.BACK");
+}
+
+function testShaders(tests, sub) {
+ tests.forEach(function(test) {
+ var shaders = [wtu.simpleVertexShader, wtu.replaceParams(wtu.getScript(test.fragmentShaderTemplate), sub)];
+ var program = wtu.setupProgram(gl, shaders, ["vPosition"], undefined, true);
+ var programLinkedSuccessfully = (program != null);
+ var expectedProgramToLinkSuccessfully = (test.expectFailure == true);
+ expectTrue(programLinkedSuccessfully != expectedProgramToLinkSuccessfully, test.msg);
+ gl.deleteProgram(program);
+ });
+}
+
+function runShadersTestDisabled() {
+ debug("");
+ debug("test shaders disabled");
+
+ var sub = {numDrawingBuffers: 1};
+ testShaders([
+ { fragmentShaderTemplate: "fshaderMacroDisabled",
+ msg: "GL_EXT_draw_buffers should not be defined in GLSL",
+ },
+ { fragmentShaderTemplate: "fshader",
+ msg: "#extension GL_EXT_draw_buffers should not be allowed in GLSL",
+ expectFailure: true,
+ },
+ ], sub);
+
+ programWithMaxDrawBuffersEqualOne = createExtDrawBuffersProgram("fshaderBuiltInConstEnabled", sub);
+ wtu.setupUnitQuad(gl);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function runShadersTestEnabled() {
+ debug("");
+ debug("test shaders enabled");
+
+ var sub = {numDrawingBuffers: gl.getParameter(ext.MAX_DRAW_BUFFERS_WEBGL)};
+ testShaders([
+ { fragmentShaderTemplate: "fshaderMacroEnabled",
+ msg: "GL_EXT_draw_buffers should be defined as 1 in GLSL",
+ },
+ { fragmentShaderTemplate: "fshader",
+ msg: "fragment shader containing the #extension directive should compile",
+ },
+ ], sub);
+
+ var program = createExtDrawBuffersProgram("fshaderBuiltInConstEnabled", sub);
+ wtu.setupUnitQuad(gl);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ gl.deleteProgram(program);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+ debug("");
+ debug("test that gl_MaxDrawBuffers is frozen at link time and enabling the extension won't change it.");
+ gl.useProgram(programWithMaxDrawBuffersEqualOne);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ gl.deleteProgram(programWithMaxDrawBuffersEqualOne);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function runAttachmentTestDisabled() {
+ debug("");
+ debug("test attachment disabled");
+ var tex = gl.createTexture();
+ var fb = gl.createFramebuffer();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + 1, gl.TEXTURE_2D, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "should not be able to attach to gl.COLOR_ATTACHMENT1");
+ gl.deleteFramebuffer(fb);
+ gl.deleteTexture(tex);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function makeArray(size, value) {
+ var array = []
+ for (var ii = 0; ii < size; ++ii) {
+ array.push(value);
+ }
+ return array;
+}
+
+function runAttachmentTestEnabled() {
+ debug("");
+ debug("test attachment enabled");
+
+ var maxDrawingBuffers = gl.getParameter(ext.MAX_DRAW_BUFFERS_WEBGL);
+ var maxColorAttachments = gl.getParameter(ext.MAX_COLOR_ATTACHMENTS_WEBGL);
+
+ var tex = gl.createTexture();
+ var fb = gl.createFramebuffer();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + maxColorAttachments, gl.TEXTURE_2D, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "should not be able to attach pass the max attachment point: gl.COLOR_ATTACHMENT0 + " + maxColorAttachments);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + maxColorAttachments - 1, gl.TEXTURE_2D, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to attach to the max attachment point: gl.COLOR_ATTACHMENT0 + " + (maxColorAttachments - 1));
+ ext.drawBuffersWEBGL(makeArray(maxDrawingBuffers, gl.NONE));
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call drawBuffersWEBGL with array NONE of size " + maxColorAttachments);
+ var bufs = drawBuffersUtils.makeColorAttachmentArray(maxDrawingBuffers);
+ ext.drawBuffersWEBGL(bufs);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call drawBuffersWEBGL with array attachments of size " + maxColorAttachments);
+ bufs[0] = gl.NONE;
+ ext.drawBuffersWEBGL(bufs);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call drawBuffersWEBGL with mixed array attachments of size " + maxColorAttachments);
+ if (maxDrawingBuffers > 1) {
+ bufs[0] = ext.COLOR_ATTACHMENT1_WEBGL;
+ bufs[1] = ext.COLOR_ATTACHMENT0_WEBGL;
+ ext.drawBuffersWEBGL(bufs);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "should not be able to call drawBuffersWEBGL with out of order attachments of size " + maxColorAttachments);
+ var bufs = drawBuffersUtils.makeColorAttachmentArray(Math.floor(maxDrawingBuffers / 2));
+ ext.drawBuffersWEBGL(bufs);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be able to call drawBuffersWEBGL with short array of attachments of size " + bufs.length);
+ }
+
+ gl.deleteFramebuffer(fb);
+ gl.deleteTexture(tex);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function makeColorByIndex(index) {
+ var low = (index - 1) % 15 + 1;
+ var high = (index - 1) / 15;
+
+ var zeroOrOne = function(v) {
+ return v ? 1 : 0;
+ };
+
+ var oneOrTwo = function(v) {
+ return v ? 2 : 1;
+ }
+
+ var makeComponent = function(b0, b1, b2) {
+ return Math.floor(255 * zeroOrOne(b0) / oneOrTwo(b1) / oneOrTwo(b2));
+ };
+ return [
+ makeComponent(low & (1 << 0), high & (1 << 0), high & (1 << 4)),
+ makeComponent(low & (1 << 1), high & (1 << 1), high & (1 << 5)),
+ makeComponent(low & (1 << 2), high & (1 << 2), high & (1 << 6)),
+ makeComponent(low & (1 << 3), high & (1 << 3), high & (1 << 7)),
+ ];
+}
+
+function runDrawTests() {
+ debug("");
+ debug("--------- draw tests -----------");
+ var fb = gl.createFramebuffer();
+ var fb2 = gl.createFramebuffer();
+ var halfFB1 = gl.createFramebuffer();
+ var halfFB2 = gl.createFramebuffer();
+ var endsFB = gl.createFramebuffer();
+ var middleFB = gl.createFramebuffer();
+
+ var maxDrawingBuffers = gl.getParameter(ext.MAX_DRAW_BUFFERS_WEBGL);
+ var maxUsable = drawBuffersUtils.getMaxUsableColorAttachments();
+ var half = Math.floor(maxUsable / 2);
+ var bufs = drawBuffersUtils.makeColorAttachmentArray(maxUsable);
+ var nones = makeArray(maxUsable, gl.NONE);
+
+ [fb, fb2, halfFB1, halfFB2, endsFB, middleFB].forEach(function(fbo) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ });
+
+ var checkProgram = wtu.setupTexturedQuad(gl);
+ var redProgram = wtu.setupProgram(gl, [wtu.simpleVertexShader, "fshaderRed"], ["vPosition"]);
+ var redProgramWithExtension = wtu.setupProgram(gl, [wtu.simpleVertexShader, "fshaderRedWithExtension"], ["vPosition"]);
+ var drawProgram = createExtDrawBuffersProgram("fshader", {numDrawingBuffers: maxDrawingBuffers});
+ var width = 64;
+ var height = 64;
+ var attachments = [];
+ // Makes 6 framebuffers.
+ // fb and fb2 have all the attachments.
+ // halfFB1 has the first half of the attachments
+ // halfFB2 has the second half of the attachments
+ // endsFB has the first and last attachments
+ // middleFB has all but the first and last attachments
+ for (var ii = 0; ii < maxUsable; ++ii) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ 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.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ii, gl.TEXTURE_2D, tex, 0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ii, gl.TEXTURE_2D, tex, 0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, ii < half ? halfFB1 : halfFB2);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ii, gl.TEXTURE_2D, tex, 0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, (ii == 0 || ii == (maxUsable - 1)) ? endsFB : middleFB);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + ii, gl.TEXTURE_2D, tex, 0);
+ var location = gl.getUniformLocation(drawProgram, "u_colors[" + ii + "]");
+ var color = makeColorByIndex(ii + 1);
+ var floatColor = [color[0] / 255, color[1] / 255, color[2] / 255, color[3] / 255];
+ gl.uniform4fv(location, floatColor);
+ attachments.push({
+ texture: tex,
+ color: color
+ });
+ }
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+
+ var drawAndCheckAttachments = function(testFB, msg, testFn) {
+ debug("test clearing " + msg);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, testFB);
+
+ attachments.forEach(function(attachment, index) {
+ debug("attachment: " + index + " = " + wtu.glEnumToString(gl, gl.getParameter(ext.DRAW_BUFFER0_WEBGL + index)) +
+ ", " + wtu.glEnumToString(gl, gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0 + index, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)));
+ });
+
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("framebuffer not complete");
+ debug("");
+ return;
+ }
+
+ // Clear all the attachments
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ //drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ // return [0, 0, 0, 0];
+ //});
+ //debug("--");
+
+ // Clear some attachments using testFB
+ gl.bindFramebuffer(gl.FRAMEBUFFER, testFB);
+
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return testFn(attachment, index) ? [0, 255, 0, 255] : [0, 0, 0, 0];
+ });
+
+ debug("test drawing to " + msg);
+
+ // Draw to some attachments using testFB
+ gl.useProgram(drawProgram);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, testFB);
+ wtu.drawUnitQuad(gl);
+
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return testFn(attachment, index) ? attachment.color : [0, 0, 0, 0];
+ });
+ };
+
+ gl.useProgram(drawProgram);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ ext.drawBuffersWEBGL(bufs);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+
+ wtu.drawUnitQuad(gl);
+
+ debug("test that each texture got the correct color.");
+
+ drawBuffersUtils.checkAttachmentsForColor(attachments);
+
+ debug("test clearing clears all the textures");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [0, 255, 0, 255]);
+
+ debug("test a fragment shader writing to neither gl_FragColor nor gl_FragData does not touch attachments");
+ var noWriteProgram = wtu.setupProgram(gl, [wtu.simpleVertexShader, "fshaderNoWrite"], ["vPosition"]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no GL error setting up the program");
+ if (!noWriteProgram) {
+ testFailed("Setup a program where fragment shader writes nothing failed");
+ } else {
+ gl.useProgram(noWriteProgram);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Active draw buffers with missing frag outputs.");
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [0, 255, 0, 255]);
+ gl.deleteProgram(noWriteProgram);
+ }
+
+ debug("test that NONE draws nothing");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(nones);
+ gl.useProgram(redProgram);
+ wtu.clearAndDrawUnitQuad(gl);
+
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [0, 255, 0, 255]);
+
+ debug("test that gl_FragColor does not broadcast unless extension is enabled in fragment shader");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ gl.useProgram(redProgram);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Active draw buffers with missing frag outputs.");
+ gl.colorMask(false, false, false, false);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors when all 4 channels of color mask are disabled.");
+ gl.colorMask(false, true, false, false);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "partially diabled color mask shall have no impact.");
+ gl.colorMask(true, true, true, true);
+
+ debug("test that gl_FragColor broadcasts if extension is enabled in fragment shader");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ gl.useProgram(redProgramWithExtension);
+ wtu.drawUnitQuad(gl);
+
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [255, 0, 0, 255]);
+
+ if (maxUsable > 1) {
+ // First half of color buffers disable.
+ var bufs1 = drawBuffersUtils.makeColorAttachmentArray(maxUsable);
+ // Second half of color buffers disable.
+ var bufs2 = drawBuffersUtils.makeColorAttachmentArray(maxUsable);
+ // Color buffers with even indices disabled.
+ var bufs3 = drawBuffersUtils.makeColorAttachmentArray(maxUsable);
+ // Color buffers with odd indices disabled.
+ var bufs4 = drawBuffersUtils.makeColorAttachmentArray(maxUsable);
+ for (var ii = 0; ii < maxUsable; ++ii) {
+ if (ii < half) {
+ bufs1[ii] = gl.NONE;
+ } else {
+ bufs2[ii] = gl.NONE;
+ }
+ if (ii % 2) {
+ bufs3[ii] = gl.NONE;
+ } else {
+ bufs4[ii] = gl.NONE;
+ }
+ }
+
+ debug("test setting first half to NONE and clearing");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ // We should clear all buffers rather than depending on the previous
+ // gl_FragColor broadcasts test to succeed and setting the colors.
+ ext.drawBuffersWEBGL(bufs);
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ ext.drawBuffersWEBGL(bufs1);
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return index < half ? [255, 0, 0, 255] : [0, 255, 0, 255];
+ });
+
+ debug("test setting first half to NONE and drawing");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.useProgram(drawProgram);
+ wtu.drawUnitQuad(gl);
+
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return index < half ? [255, 0, 0, 255] : attachment.color;
+ });
+
+ debug("test setting second half to NONE and clearing");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ ext.drawBuffersWEBGL(bufs2);
+ gl.clearColor(0, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return index < half ? [0, 0, 255, 255] : [255, 0, 0, 255];
+ });
+
+ debug("test setting second half to NONE and drawing");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.useProgram(drawProgram);
+ wtu.drawUnitQuad(gl);
+
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return index < half ? attachment.color : [255, 0, 0, 255];
+ });
+
+ debug("test setting buffers with even indices to NONE and clearing");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ ext.drawBuffersWEBGL(bufs3);
+ gl.clearColor(1, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return (index % 2) ? [255, 0, 0, 255] : [255, 0, 255, 255];
+ });
+
+ debug("test setting buffers with odd indices to NONE and drawing");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ gl.clearColor(0, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.useProgram(drawProgram);
+ ext.drawBuffersWEBGL(bufs4);
+ wtu.drawUnitQuad(gl);
+
+ drawBuffersUtils.checkAttachmentsForColorFn(attachments, function(attachment, index) {
+ return (index % 2 == 0) ? [0, 0, 0, 255] : attachment.color;
+ });
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, halfFB1);
+ ext.drawBuffersWEBGL(bufs);
+ drawAndCheckAttachments(
+ halfFB1, "framebuffer that only has first half of attachments",
+ function(attachment, index) {
+ return index < half;
+ });
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, halfFB2);
+ ext.drawBuffersWEBGL(bufs);
+ drawAndCheckAttachments(
+ halfFB2, "framebuffer that only has second half of attachments",
+ function(attachment, index) {
+ return index >= half;
+ });
+
+ if (maxUsable > 2) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, endsFB);
+ ext.drawBuffersWEBGL(bufs);
+ drawAndCheckAttachments(
+ endsFB, "framebuffer that only has first and last attachments",
+ function(attachment, index) {
+ return index == 0 || index == (maxUsable - 1);
+ });
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, middleFB);
+ ext.drawBuffersWEBGL(bufs);
+ drawAndCheckAttachments(
+ middleFB,
+ "framebuffer that has all but the first and last attachments",
+ function(attachment, index) {
+ return index != 0 && index != (maxUsable - 1);
+ });
+ }
+ }
+
+ debug("test switching between fbos does not affect any color attachment contents");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ ext.drawBuffersWEBGL(nones);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ ext.drawBuffersWEBGL(bufs);
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [255, 0, 0, 255]);
+
+ // fb2 still has the NONE draw buffers from before, so this draw should be a no-op.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ gl.useProgram(drawProgram);
+ wtu.drawUnitQuad(gl);
+ drawBuffersUtils.checkAttachmentsForColor(attachments, [255, 0, 0, 255]);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.useProgram(drawProgram);
+ wtu.drawUnitQuad(gl);
+ drawBuffersUtils.checkAttachmentsForColor(attachments);
+
+ debug("test queries");
+ debug("check framebuffer with all attachments on");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ for (var ii = 0; ii < maxUsable; ++ii) {
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL + " + ii + ")", "gl.COLOR_ATTACHMENT0 + " + ii);
+ }
+
+ debug("check framebuffer with all attachments off");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ for (var ii = 0; ii < maxUsable; ++ii) {
+ shouldBe("gl.getParameter(ext.DRAW_BUFFER0_WEBGL + " + ii + ")", "gl.NONE");
+ }
+
+ debug("test attachment size mis-match");
+ gl.bindTexture(gl.TEXTURE_2D, attachments[0].texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width * 2, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ shouldBeTrue("gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE");
+
+ gl.deleteFramebuffer(fb);
+ gl.deleteFramebuffer(fb2);
+ gl.deleteFramebuffer(halfFB1);
+ gl.deleteFramebuffer(halfFB2);
+ attachments.forEach(function(attachment) {
+ gl.deleteTexture(attachment.texture);
+ });
+ gl.deleteProgram(checkProgram);
+ gl.deleteProgram(redProgram);
+ gl.deleteProgram(redProgramWithExtension);
+ gl.deleteProgram(drawProgram);
+}
+
+function runPreserveTests() {
+ debug("");
+ debug("--------- preserve tests -----------");
+
+ debug("Testing that frame buffer is cleared after compositing");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ gl.clearColor(1, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvas(gl, [255, 255, 0, 255], "should be yellow");
+
+ // set the draw buffer to NONE
+ ext.drawBuffersWEBGL([gl.NONE]);
+ gl.clearColor(1, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // make sure the canvas is still clear
+ wtu.checkCanvas(gl, [255, 255, 0, 255], "should be yellow");
+
+ wtu.waitForComposite(function() {
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvas(gl, [0, 0, 0, 0], "should be clear");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+ runEndTests();
+ });
+}
+
+function runEndTests() {
+ // Create new context and verify shader tests with no extension still succeeds.
+ debug("");
+ debug("Testing new context with no extension");
+ gl = wtu.create3DContext();
+ if (!gl) {
+ testFailed("New WebGL context does not exist");
+ } else {
+ testPassed("New WebGL context exists");
+ runEnumTestDisabled();
+ runShadersTestDisabled();
+ runAttachmentTestDisabled();
+ }
+
+ finishTest();
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-multi-draw.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-multi-draw.html
new file mode 100644
index 0000000000..ae4bbc1af0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-multi-draw.html
@@ -0,0 +1,1064 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ANGLE_multi_draw Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/compositing-test.js"></script>
+<script src="../../js/tests/invalid-vertex-attrib-test.js"></script>
+</head>
+<body>
+<script id="vshaderIllegalDrawID" type="x-shader/x-vertex">
+attribute vec2 vPosition;
+varying vec4 color;
+void main()
+{
+ color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_Position = vec4(vPosition * 2.0 - 1.0, gl_DrawID, 1);
+}
+</script>
+<script id="vshaderDrawIDZero" type="x-shader/x-vertex">
+#extension GL_ANGLE_multi_draw : require
+attribute vec2 vPosition;
+varying vec4 color;
+void main()
+{
+ if (gl_DrawID == 0) {
+ color = vec4(0, 1, 0, 1);
+ } else {
+ color = vec4(1, 0, 0, 1);
+ }
+ gl_Position = vec4(vPosition * 2.0 - 1.0, 0, 1);
+}
+</script>
+<!-- The behavior of the shaders below is described in runPixelTests() -->
+<script id="vshaderWithDrawID" type="x-shader/x-vertex">
+#extension GL_ANGLE_multi_draw : require
+attribute vec2 vPosition;
+attribute float vInstance;
+varying vec4 color;
+void main()
+{
+ // color_id = (gl_DrawID / 2) % 3
+ float quad_id = float(gl_DrawID / 2);
+ float color_id = quad_id - (3.0 * floor(quad_id / 3.0));
+ if (color_id < 0.5) {
+ color = vec4(1, 0, 0, 1);
+ } else if (color_id < 1.5) {
+ color = vec4(0, 1, 0, 1);
+ } else {
+ color = vec4(0, 0, 1, 1);
+ }
+ mat3 transform = mat3(1.0);
+ // vInstance starts at 1.0 on instanced calls
+ if (vInstance >= 1.0) {
+ transform[0][0] = 0.5;
+ transform[1][1] = 0.5;
+ }
+ if (vInstance == 1.0) {
+ } else if (vInstance == 2.0) {
+ transform[2][0] = 0.5;
+ } else if (vInstance == 3.0) {
+ transform[2][1] = 0.5;
+ } else if (vInstance == 4.0) {
+ transform[2][0] = 0.5;
+ transform[2][1] = 0.5;
+ }
+ gl_Position = vec4(transform * vec3(vPosition, 1.0) * 2.0 - 1.0, 1);
+}
+</script>
+<script id="vshaderEmulatedDrawID" type="x-shader/x-vertex">
+uniform int drawID;
+attribute vec2 vPosition;
+attribute float vInstance;
+varying vec4 color;
+void main()
+{
+ float quad_id = float(drawID / 2);
+ float color_id = quad_id - (3.0 * floor(quad_id / 3.0));
+ if (color_id == 0.0) {
+ color = vec4(1, 0, 0, 1);
+ } else if (color_id == 1.0) {
+ color = vec4(0, 1, 0, 1);
+ } else {
+ color = vec4(0, 0, 1, 1);
+ }
+ mat3 transform = mat3(1.0);
+ // vInstance starts at 1.0 on instanced calls
+ if (vInstance >= 1.0) {
+ transform[0][0] = 0.5;
+ transform[1][1] = 0.5;
+ }
+ if (vInstance == 1.0) {
+ } else if (vInstance == 2.0) {
+ transform[2][0] = 0.5;
+ } else if (vInstance == 3.0) {
+ transform[2][1] = 0.5;
+ } else if (vInstance == 4.0) {
+ transform[2][0] = 0.5;
+ transform[2][1] = 0.5;
+ }
+ gl_Position = vec4(transform * vec3(vPosition, 1.0) * 2.0 - 1.0, 1);
+}
+</script>
+<script id="vshaderNoDrawID" type="x-shader/x-vertex">
+attribute vec2 vPosition;
+attribute float vInstance;
+varying vec4 color;
+void main()
+{
+ color = vec4(1.0, 0.0, 0.0, 1.0);
+ mat3 transform = mat3(1.0);
+ // vInstance starts at 1.0 on instanced calls
+ if (vInstance >= 1.0) {
+ transform[0][0] = 0.5;
+ transform[1][1] = 0.5;
+ }
+ if (vInstance == 1.0) {
+ } else if (vInstance == 2.0) {
+ transform[2][0] = 0.5;
+ } else if (vInstance == 3.0) {
+ transform[2][1] = 0.5;
+ } else if (vInstance == 4.0) {
+ transform[2][0] = 0.5;
+ transform[2][1] = 0.5;
+ }
+ gl_Position = vec4(transform * vec3(vPosition, 1.0) * 2.0 - 1.0, 1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+void main() {
+ gl_FragColor = color;
+}
+</script>
+<div id="description"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("This test verifies the functionality of the ANGLE_multi_draw extension, if it is available.");
+
+const wtu = WebGLTestUtils;
+const canvas = document.getElementById("canvas");
+const gl = wtu.create3DContext(canvas);
+const instancedExt = gl && gl.getExtension('ANGLE_instanced_arrays');
+const bufferUsageSet = [ gl.STATIC_DRAW, gl.DYNAMIC_DRAW ];
+
+// Check if the extension is either both enabled and supported or
+// not enabled and not supported.
+function runSupportedTest(extensionName, extensionEnabled) {
+ const supported = gl.getSupportedExtensions();
+ if (supported.indexOf(extensionName) >= 0) {
+ if (extensionEnabled) {
+ testPassed(extensionName + ' listed as supported and getExtension succeeded');
+ return true;
+ } else {
+ testFailed(extensionName + ' listed as supported but getExtension failed');
+ }
+ } else {
+ if (extensionEnabled) {
+ testFailed(extensionName + ' not listed as supported but getExtension succeeded');
+ } else {
+ testPassed(extensionName + ' not listed as supported and getExtension failed -- this is legal');
+ }
+ }
+ return false;
+}
+
+function runTest() {
+ if (!gl) {
+ return function() {
+ testFailed('WebGL context does not exist');
+ }
+ }
+
+ const extensionName = 'WEBGL_multi_draw';
+ const ext = gl.getExtension(extensionName);
+ if (!runSupportedTest(extensionName, ext)) {
+ return;
+ }
+
+ doTest(ext, false);
+ doTest(ext, true);
+}
+
+function doTest(ext, instanced) {
+
+ function runValidationTests(bufferUsage) {
+ const vertexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0.2,0.2, 0.8,0.2, 0.5,0.8 ]), bufferUsage);
+
+ const indexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array([ 0, 1, 2, 0]), bufferUsage);
+
+ const instanceBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, instanceBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0, 1, 2, 3 ]), bufferUsage);
+
+ const program = wtu.setupProgram(gl, ["vshaderNoDrawID", "fshader"], ["vPosition", "vInstance"], [0, 1]);
+ expectTrue(program != null, "can compile simple program");
+
+ function setupDrawArrays() {
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ }
+
+ function setupDrawElements() {
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ }
+
+ function setupInstanced() {
+ gl.bindBuffer(gl.ARRAY_BUFFER, instanceBuffer);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 1, gl.FLOAT, false, 0, 0);
+ if (wtu.getDefault3DContextVersion() < 2) {
+ instancedExt.vertexAttribDivisorANGLE(1, 1);
+ } else {
+ gl.vertexAttribDivisor(1, 1);
+ }
+ }
+
+ function setupDrawArraysInstanced() {
+ setupDrawArrays();
+ setupInstanced();
+ }
+
+ function setupDrawElementsInstanced() {
+ setupDrawElements();
+ setupInstanced();
+ }
+
+ // Wrap a draw call in a function to setup the draw call, execute,
+ // and check errors.
+ // The `drawFunc` is one of the extension entrypoints being tested. It may
+ // be undefined if that entrypoint is not supported on the context
+ function makeDrawCheck(drawFunc, setup) {
+ if (!drawFunc) {
+ return function() {};
+ }
+ return function(f_args, expect, msg) {
+ setup();
+ drawFunc.apply(ext, f_args);
+ wtu.glErrorShouldBe(gl, expect, drawFunc.name + " " + msg);
+ gl.disableVertexAttribArray(0);
+ gl.disableVertexAttribArray(1);
+ }
+ }
+
+ const checkMultiDrawArrays = makeDrawCheck(
+ ext.multiDrawArraysWEBGL, setupDrawArrays);
+ const checkMultiDrawElements = makeDrawCheck(
+ ext.multiDrawElementsWEBGL, setupDrawElements);
+ const checkMultiDrawArraysInstanced = makeDrawCheck(
+ ext.multiDrawArraysInstancedWEBGL, setupDrawArraysInstanced);
+ const checkMultiDrawElementsInstanced = makeDrawCheck(
+ ext.multiDrawElementsInstancedWEBGL, setupDrawElementsInstanced);
+
+ gl.useProgram(program);
+
+ // Check that drawing a single triangle works
+ if (!instanced) {
+ checkMultiDrawArrays(
+ [gl.TRIANGLES, [0], 0, [3], 0, 1],
+ gl.NO_ERROR, "with gl.TRIANGLES");
+ checkMultiDrawElements(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 0, 1],
+ gl.NO_ERROR, "with gl.TRIANGLES");
+ } else {
+ checkMultiDrawElementsInstanced(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 0, [1], 0, 1],
+ gl.NO_ERROR, "with gl.TRIANGLES");
+ checkMultiDrawArraysInstanced(
+ [gl.TRIANGLES, [0], 0, [3], 0, [1], 0, 1],
+ gl.NO_ERROR, "with gl.TRIANGLES");
+ }
+
+ // Zero drawcount permitted
+ if (!instanced) {
+ checkMultiDrawArrays(
+ [gl.TRIANGLES, [0], 0, [3], 0, 0],
+ gl.NO_ERROR, "with drawcount == 0");
+ checkMultiDrawElements(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 0, 0],
+ gl.NO_ERROR, "with drawcount == 0");
+ } else {
+ checkMultiDrawElementsInstanced(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 0, [1], 0, 0],
+ gl.NO_ERROR, "with drawcount == 0");
+ checkMultiDrawArraysInstanced(
+ [gl.TRIANGLES, [0], 0, [3], 0, [1], 0, 0],
+ gl.NO_ERROR, "with drawcount == 0");
+ }
+
+ // Check negative drawcount
+ if (!instanced) {
+ checkMultiDrawArrays(
+ [gl.TRIANGLES, [0], 0, [3], 0, -1],
+ gl.INVALID_VALUE, "with drawcount < 0");
+ checkMultiDrawElements(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 0, -1],
+ gl.INVALID_VALUE, "with drawcount < 0");
+ } else {
+ checkMultiDrawElementsInstanced(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 0, [1], 0, -1],
+ gl.INVALID_VALUE, "with drawcount < 0");
+ checkMultiDrawArraysInstanced(
+ [gl.TRIANGLES, [0], 0, [3], 0, [1], 0, -1],
+ gl.INVALID_VALUE, "with drawcount < 0");
+ }
+
+ // Check offsets greater than array length
+ if (!instanced) {
+ checkMultiDrawArrays(
+ [gl.TRIANGLES, [0], 1, [3], 0, 1],
+ gl.INVALID_OPERATION, "with firstsStart >= firstsList.length");
+ checkMultiDrawArrays(
+ [gl.TRIANGLES, [0], 0, [3], 1, 1],
+ gl.INVALID_OPERATION, "with countsStart >= countsList.length");
+
+ checkMultiDrawElements(
+ [gl.TRIANGLES, [3], 1, gl.UNSIGNED_BYTE, [0], 0, 1],
+ gl.INVALID_OPERATION, "with countsStart >= countsList.length");
+ checkMultiDrawElements(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 1, 1],
+ gl.INVALID_OPERATION, "with offsetsStart >= offsetsList.length");
+ } else {
+ checkMultiDrawArraysInstanced(
+ [gl.TRIANGLES, [0], 1, [3], 0, [1], 0, 1],
+ gl.INVALID_OPERATION, "with firstsStart >= firstsList.length");
+ checkMultiDrawArraysInstanced(
+ [gl.TRIANGLES, [0], 0, [3], 1, [1], 0, 1],
+ gl.INVALID_OPERATION, "with countsStart >= countsList.length");
+ checkMultiDrawArraysInstanced(
+ [gl.TRIANGLES, [0], 0, [3], 0, [1], 1, 1],
+ gl.INVALID_OPERATION, "with instanceCountsStart >= instanceCountsList.length");
+
+ checkMultiDrawElementsInstanced(
+ [gl.TRIANGLES, [3], 1, gl.UNSIGNED_BYTE, [0], 0, [1], 0, 1],
+ gl.INVALID_OPERATION, "with countsStart >= countsList.length");
+ checkMultiDrawElementsInstanced(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 1, [1], 0, 1],
+ gl.INVALID_OPERATION, "with offsetsStart >= offsetsList.length");
+ checkMultiDrawElementsInstanced(
+ [gl.TRIANGLES, [3], 0, gl.UNSIGNED_BYTE, [0], 0, [1], 1, 1],
+ gl.INVALID_OPERATION, "with instanceCountsStart >= instanceCountsList.length");
+ }
+ }
+
+ function runShaderTests(bufferUsage) {
+ const illegalProgram = wtu.setupProgram(gl, ["vshaderIllegalDrawID", "fshader"], ["vPosition"], [0]);
+ expectTrue(illegalProgram == null, "cannot compile program with gl_DrawID but no extension directive");
+
+ const drawIDProgram = wtu.setupProgram(gl, ["vshaderDrawIDZero", "fshader"], ["vPosition"], [0]);
+ wtu.setupProgram(gl, ["vshaderDrawIDZero", "fshader"], ["vPosition"], [0]);
+ expectTrue(drawIDProgram !== null, "can compile program with gl_DrawID");
+ gl.useProgram(drawIDProgram);
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0, 1,0, 0,1, 0,1, 1,0, 1,1 ]), bufferUsage);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "gl_DrawID is 0 for non-Multi* draw calls", 0);
+ }
+
+ function runPixelTests(bufferUsage, useSharedArrayBuffer) {
+ // An array of quads is tiled across the screen.
+ // gl_DrawID is checked by using it to select the color of the draw.
+ // Instanced entrypoints are tested here scaling and then instancing the
+ // array of quads over four quadrants on the screen.
+
+ // These tests also include "manyDraw" tests which emulate a multiDraw with
+ // a Javascript for-loop and gl_DrawID with a uniform constiable. They are
+ // included to ensure the test is written correctly.
+
+ const width = gl.canvas.width;
+ const height = gl.canvas.height;
+ const x_count = 8;
+ const y_count = 8;
+ const quad_count = x_count * y_count;
+ const tri_count = quad_count * 2;
+ const tileSize = [ 1/x_count, 1/y_count ];
+ const tilePixelSize = [ Math.floor(width / x_count), Math.floor(height / y_count) ];
+ const quadRadius = [ 0.25 * tileSize[0], 0.25 * tileSize[1] ];
+ const pixelCheckSize = [ Math.floor(quadRadius[0] * width), Math.floor(quadRadius[1] * height) ];
+
+ function getTileCenter(x, y) {
+ return [ tileSize[0] * (0.5 + x), tileSize[1] * (0.5 + y) ];
+ }
+
+ function getQuadVertices(x, y) {
+ const center = getTileCenter(x, y);
+ return [
+ [center[0] - quadRadius[0], center[1] - quadRadius[1], 0],
+ [center[0] + quadRadius[0], center[1] - quadRadius[1], 0],
+ [center[0] + quadRadius[0], center[1] + quadRadius[1], 0],
+ [center[0] - quadRadius[0], center[1] + quadRadius[1], 0],
+ ]
+ }
+
+ const indicesData = [];
+ const verticesData = [];
+ const nonIndexedVerticesData = [];
+ {
+ const is = new Uint16Array([0, 1, 2, 0, 2, 3]);
+ for (let y = 0; y < y_count; ++y) {
+ for (let x = 0; x < x_count; ++x) {
+ const quadIndex = y * x_count + x;
+ const starting_index = 4 * quadIndex;
+ const vs = getQuadVertices(x, y);
+ for (let i = 0; i < is.length; ++i) {
+ indicesData.push(starting_index + is[i]);
+ }
+ for (let i = 0; i < vs.length; ++i) {
+ for (let v = 0; v < vs[i].length; ++v) verticesData.push(vs[i][v]);
+ }
+ for (let i = 0; i < is.length; ++i) {
+ for (let v = 0; v < vs[is[i]].length; ++v) nonIndexedVerticesData.push(vs[is[i]][v]);
+ }
+ }
+ }
+ }
+
+ const indices = new Uint16Array(indicesData);
+ const vertices = new Float32Array(verticesData);
+ const nonIndexedVertices = new Float32Array(nonIndexedVerticesData);
+
+ const indexBuffer = gl.createBuffer();
+ const vertexBuffer = gl.createBuffer();
+ const nonIndexedVertexBuffer = gl.createBuffer();
+ const instanceBuffer = gl.createBuffer();
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, nonIndexedVertexBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, nonIndexedVertices, bufferUsage);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, bufferUsage);
+
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, bufferUsage);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, instanceBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 2, 3, 4]), bufferUsage);
+
+ function checkResult(config, msg) {
+ const rects = [];
+ const expected = [
+ [255, 0, 0, 255],
+ [0, 255, 0, 255],
+ [0, 0, 255, 255],
+ ];
+ for (let y = 0; y < y_count; ++y) {
+ for (let x = 0; x < x_count; ++x) {
+ const center_x = x * tilePixelSize[0] + Math.floor(tilePixelSize[0] / 2);
+ const center_y = y * tilePixelSize[1] + Math.floor(tilePixelSize[1] / 2);
+ const quadID = y * x_count + x;
+ const colorID = config.drawID ? quadID % 3 : 0;
+ if (config.instanced) {
+ rects.push(wtu.makeCheckRect(
+ center_x / 2 - Math.floor(pixelCheckSize[0] / 4),
+ center_y / 2 - Math.floor(pixelCheckSize[1] / 4),
+ pixelCheckSize[0] / 2,
+ pixelCheckSize[1] / 2,
+ expected[colorID],
+ msg + " (" + x + "," + y + ")", 0));
+ rects.push(wtu.makeCheckRect(
+ center_x / 2 - Math.floor(pixelCheckSize[0] / 4) + width / 2,
+ center_y / 2 - Math.floor(pixelCheckSize[1] / 4),
+ pixelCheckSize[0] / 2,
+ pixelCheckSize[1] / 2,
+ expected[colorID],
+ msg + " (" + x + "," + y + ")", 0));
+ rects.push(wtu.makeCheckRect(
+ center_x / 2 - Math.floor(pixelCheckSize[0] / 4),
+ center_y / 2 - Math.floor(pixelCheckSize[1] / 4) + height / 2,
+ pixelCheckSize[0] / 2,
+ pixelCheckSize[1] / 2,
+ expected[colorID],
+ msg + " (" + x + "," + y + ")", 0));
+ rects.push(wtu.makeCheckRect(
+ center_x / 2 - Math.floor(pixelCheckSize[0] / 4) + width / 2,
+ center_y / 2 - Math.floor(pixelCheckSize[1] / 4) + height / 2,
+ pixelCheckSize[0] / 2,
+ pixelCheckSize[1] / 2,
+ expected[colorID],
+ msg + " (" + x + "," + y + ")", 0));
+ } else {
+ rects.push(wtu.makeCheckRect(
+ center_x - Math.floor(pixelCheckSize[0] / 2),
+ center_y - Math.floor(pixelCheckSize[1] / 2),
+ pixelCheckSize[0],
+ pixelCheckSize[1],
+ expected[colorID],
+ msg + " (" + x + "," + y + ")", 0));
+ }
+ }
+ }
+ wtu.checkCanvasRects(gl, rects);
+ }
+
+ function newIntArray(count) {
+ if (!useSharedArrayBuffer) {
+ return new Int32Array(count);
+ }
+ let sab = new SharedArrayBuffer(count * Int32Array.BYTES_PER_ELEMENT);
+ return new Int32Array(sab);
+ }
+
+ const firsts = newIntArray(tri_count);
+ const counts = newIntArray(tri_count);
+ const offsets = newIntArray(tri_count);
+ const instances = newIntArray(tri_count);
+
+ for (let i = 0; i < firsts.length; ++i) firsts[i] = i * 3;
+ counts.fill(3);
+ for (let i = 0; i < offsets.length; ++i) offsets[i] = i * 3 * 2;
+ instances.fill(4);
+
+ const firstsOffset = 47;
+ const countsOffset = firstsOffset + firsts.length;
+ const offsetsOffset = countsOffset + counts.length;
+ const instancesOffset = offsetsOffset + instances.length;
+
+ const buffer = newIntArray(firstsOffset + firsts.length + counts.length + offsets.length + instances.length);
+ buffer.set(firsts, firstsOffset);
+ buffer.set(counts, countsOffset);
+ buffer.set(offsets, offsetsOffset);
+ buffer.set(instances, instancesOffset);
+
+ let drawIDLocation;
+
+ const multiDrawArrays = function() {
+ ext.multiDrawArraysWEBGL(gl.TRIANGLES, firsts, 0, counts, 0, tri_count);
+ }
+
+ const multiDrawArraysWithNonzeroOffsets = function() {
+ ext.multiDrawArraysWEBGL(gl.TRIANGLES, buffer, firstsOffset, buffer, countsOffset, tri_count);
+ }
+
+ const multiDrawElements = function() {
+ ext.multiDrawElementsWEBGL(gl.TRIANGLES, counts, 0, gl.UNSIGNED_SHORT, offsets, 0, tri_count);
+ }
+
+ const multiDrawElementsWithNonzeroOffsets = function() {
+ ext.multiDrawElementsWEBGL(gl.TRIANGLES, buffer, countsOffset, gl.UNSIGNED_SHORT, buffer, offsetsOffset, tri_count);
+ }
+
+ const multiDrawArraysInstanced = function() {
+ ext.multiDrawArraysInstancedWEBGL(gl.TRIANGLES, firsts, 0, counts, 0, instances, 0, tri_count);
+ }
+
+ const multiDrawArraysInstancedWithNonzeroOffsets = function() {
+ ext.multiDrawArraysInstancedWEBGL(gl.TRIANGLES, buffer, firstsOffset, buffer, countsOffset, buffer, instancesOffset, tri_count);
+ }
+
+ const multiDrawElementsInstanced = function() {
+ ext.multiDrawElementsInstancedWEBGL(gl.TRIANGLES, counts, 0, gl.UNSIGNED_SHORT, offsets, 0, instances, 0, tri_count);
+ }
+
+ const multiDrawElementsInstancedWithNonzeroOffsets = function() {
+ ext.multiDrawElementsInstancedWEBGL(gl.TRIANGLES, buffer, countsOffset, gl.UNSIGNED_SHORT, buffer, offsetsOffset, buffer, instancesOffset, tri_count);
+ }
+
+ const manyDrawArrays = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ gl.drawArrays(gl.TRIANGLES, firsts[i], counts[i]);
+ }
+ }
+
+ const manyDrawElements = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ gl.drawElements(gl.TRIANGLES, counts[i], gl.UNSIGNED_SHORT, offsets[i]);
+ }
+ }
+
+ const manyDrawArraysEmulateDrawID = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ gl.uniform1i(drawIDLocation, i);
+ gl.drawArrays(gl.TRIANGLES, firsts[i], counts[i]);
+ }
+ }
+
+ const manyDrawElementsEmulateDrawID = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ gl.uniform1i(drawIDLocation, i);
+ gl.drawElements(gl.TRIANGLES, counts[i], gl.UNSIGNED_SHORT, offsets[i]);
+ }
+ }
+
+ function drawArraysInstanced() {
+ if (wtu.getDefault3DContextVersion() < 2) {
+ instancedExt.drawArraysInstancedANGLE.apply(instancedExt, arguments);
+ } else {
+ gl.drawArraysInstanced.apply(gl, arguments);
+ }
+ }
+
+ function drawElementsInstanced() {
+ if (wtu.getDefault3DContextVersion() < 2) {
+ instancedExt.drawElementsInstancedANGLE.apply(instancedExt, arguments);
+ } else {
+ gl.drawElementsInstanced.apply(gl, arguments);
+ }
+ }
+
+ function vertexAttribDivisor(attrib, divisor) {
+ if (wtu.getDefault3DContextVersion() < 2) {
+ instancedExt.vertexAttribDivisorANGLE(attrib, divisor);
+ } else {
+ gl.vertexAttribDivisor(attrib, divisor);
+ }
+ }
+
+ const manyDrawArraysInstanced = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ drawArraysInstanced(gl.TRIANGLES, firsts[i], counts[i], 4);
+ }
+ }
+
+ const manyDrawElementsInstanced = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ drawElementsInstanced(gl.TRIANGLES, counts[i], gl.UNSIGNED_SHORT, offsets[i], 4);
+ }
+ }
+
+ const manyDrawArraysInstancedEmulateDrawID = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ gl.uniform1i(drawIDLocation, i);
+ drawArraysInstanced(gl.TRIANGLES, firsts[i], counts[i], 4);
+ }
+ }
+
+ const manyDrawElementsInstancedEmulateDrawID = function() {
+ for (let i = 0; i < tri_count; ++i) {
+ gl.uniform1i(drawIDLocation, i);
+ drawElementsInstanced(gl.TRIANGLES, counts[i], gl.UNSIGNED_SHORT, offsets[i], 4);
+ }
+ }
+
+ function checkDraw(config) {
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ if (config.indexed) {
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ } else {
+ gl.bindBuffer(gl.ARRAY_BUFFER, nonIndexedVertexBuffer);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ }
+
+ if (config.instanced) {
+ gl.bindBuffer(gl.ARRAY_BUFFER, instanceBuffer);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 1, gl.FLOAT, false, 0, 0);
+ vertexAttribDivisor(1, 1);
+ }
+
+ config.drawFunc();
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ checkResult(config, config.drawFunc.name + (
+ config.instanced ? ' instanced' : ''
+ ) + (
+ config.drawID ? ' with gl_DrawID' : ''
+ ) + (
+ useSharedArrayBuffer ? ' and SharedArrayBuffer' : ''
+ ));
+
+ gl.disableVertexAttribArray(0);
+ gl.disableVertexAttribArray(1);
+ }
+
+ const noDrawIDProgram = wtu.setupProgram(gl, ["vshaderNoDrawID", "fshader"], ["vPosition", "vInstance"], [0, 1]);
+ expectTrue(noDrawIDProgram != null, "can compile simple program");
+ if (noDrawIDProgram) {
+ gl.useProgram(noDrawIDProgram);
+
+ if (!instanced) {
+ checkDraw({
+ drawFunc: multiDrawArrays,
+ drawID: false,
+ });
+ checkDraw({
+ drawFunc: multiDrawArraysWithNonzeroOffsets,
+ drawID: false,
+ });
+ checkDraw({
+ drawFunc: multiDrawElements,
+ indexed: true,
+ drawID: false,
+ });
+ checkDraw({
+ drawFunc: multiDrawElementsWithNonzeroOffsets,
+ indexed: true,
+ drawID: false,
+ });
+ checkDraw({
+ drawFunc: manyDrawArrays,
+ drawID: false,
+ });
+ checkDraw({
+ drawFunc: manyDrawElements,
+ indexed: true,
+ drawID: false,
+ });
+ } else {
+ checkDraw({
+ drawFunc: multiDrawArraysInstanced,
+ drawID: false,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawArraysInstancedWithNonzeroOffsets,
+ drawID: false,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawElementsInstanced,
+ indexed: true,
+ drawID: false,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawElementsInstancedWithNonzeroOffsets,
+ indexed: true,
+ drawID: false,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: manyDrawArraysInstanced,
+ drawID: false,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: manyDrawElementsInstanced,
+ indexed: true,
+ drawID: false,
+ instanced: true,
+ });
+ }
+ }
+
+ const withDrawIDProgram = wtu.setupProgram(gl, ["vshaderWithDrawID", "fshader"], ["vPosition", "vInstance"], [0, 1]);
+ expectTrue(withDrawIDProgram != null, "can compile program with ANGLE_multi_draw");
+ if (withDrawIDProgram) {
+ gl.useProgram(withDrawIDProgram);
+
+ if (!instanced) {
+ checkDraw({
+ drawFunc: multiDrawArrays,
+ drawID: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawArraysWithNonzeroOffsets,
+ drawID: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawElements,
+ indexed: true,
+ drawID: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawElementsWithNonzeroOffsets,
+ indexed: true,
+ drawID: true,
+ });
+ } else {
+ checkDraw({
+ drawFunc: multiDrawArraysInstanced,
+ drawID: true,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawArraysInstancedWithNonzeroOffsets,
+ drawID: true,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawElementsInstanced,
+ indexed: true,
+ drawID: true,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: multiDrawElementsInstancedWithNonzeroOffsets,
+ indexed: true,
+ drawID: true,
+ instanced: true,
+ });
+ }
+ }
+
+ const emulatedDrawIDProgram = wtu.setupProgram(gl, ["vshaderEmulatedDrawID", "fshader"], ["vPosition", "vInstance"], [0, 1]);
+ expectTrue(emulatedDrawIDProgram != null, "can compile program to emulate gl_DrawID");
+ drawIDLocation = gl.getUniformLocation(emulatedDrawIDProgram, "drawID");
+ if (emulatedDrawIDProgram) {
+ gl.useProgram(emulatedDrawIDProgram);
+
+ if (!instanced) {
+ checkDraw({
+ drawFunc: manyDrawArraysEmulateDrawID,
+ drawID: true,
+ });
+ checkDraw({
+ drawFunc: manyDrawElementsEmulateDrawID,
+ indexed: true,
+ drawID: true,
+ });
+ } else {
+ checkDraw({
+ drawFunc: manyDrawArraysInstancedEmulateDrawID,
+ drawID: true,
+ instanced: true,
+ });
+ checkDraw({
+ drawFunc: manyDrawElementsInstancedEmulateDrawID,
+ indexed: true,
+ drawID: true,
+ instanced: true,
+ });
+ }
+ }
+ }
+
+ for (let i = 0; i < bufferUsageSet.length; i++) {
+ let bufferUsage = bufferUsageSet[i];
+ debug("Testing with BufferUsage = " + bufferUsage);
+ runValidationTests(bufferUsage);
+ runShaderTests(bufferUsage);
+ runPixelTests(bufferUsage, false);
+ }
+
+ // Run a subset of the pixel tests with SharedArrayBuffer if supported.
+ if (window.SharedArrayBuffer) {
+ runPixelTests(bufferUsageSet[0], true);
+ }
+}
+
+function waitForComposite() {
+ debug('wait for composite');
+ return new Promise(resolve => wtu.waitForComposite(resolve));
+}
+
+async function testPreserveDrawingBufferFalse(gl, drawFn) {
+ debug('');
+ debug('test preserveDrawingBuffer: false');
+
+ if (drawFn(gl)) {
+ debug('skipped: extension does not exist');
+ return;
+ }
+
+ wtu.checkCanvasRect(gl, 0, 0, 20, 20, [255, 0, 0, 255],
+ "canvas should be red");
+
+ // enable scissor here, before compositing, to make sure it's correctly
+ // ignored and restored
+ gl.scissor(0, 10, 10, 10);
+ gl.enable(gl.SCISSOR_TEST);
+
+ await waitForComposite();
+
+ // scissor was set earlier
+ gl.clearColor(0, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ wtu.checkCanvasRect(gl, 0, 10, 10, 10, [0, 0, 255, 255],
+ "cleared corner should be blue, stencil should be preserved");
+ wtu.checkCanvasRect(gl, 0, 0, 10, 10, [0, 0, 0, 0],
+ "remainder of buffer should be cleared");
+
+ gl.disable(gl.SCISSOR_TEST);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+async function testPreserveDrawingBufferTrue(gl, drawFn) {
+ debug('');
+ debug('test preserveDrawingBuffer: true');
+ if (drawFn(gl)) {
+ debug('skipped: extension does not exist');
+ return;
+ }
+
+ wtu.checkCanvasRect(gl, 0, 0, 20, 20, [255, 0, 0, 255],
+ "canvas should be red");
+
+ await waitForComposite();
+
+ wtu.checkCanvasRect(gl, 0, 0, 20, 20, [255, 0, 0, 255],
+ "canvas should be red");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+async function doCompositingTests([glPreserveDrawingBufferFalse, glPreserveDrawingBufferTrue], drawFn) {
+ debug('');
+ debug(drawFn.name);
+
+ await testPreserveDrawingBufferFalse(glPreserveDrawingBufferFalse, drawFn);
+ await testPreserveDrawingBufferTrue(glPreserveDrawingBufferTrue, drawFn);
+}
+
+async function runDrawTests(testFn) {
+ function drawArrays(gl) {
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+
+ function drawElements(gl) {
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0);
+ }
+
+ function drawArraysInstanced(gl) {
+ gl.drawArraysInstanced(gl.TRIANGLES, 0, 6, 1);
+ }
+
+ function drawElementsInstanced(gl) {
+ gl.drawElementsInstanced(gl.TRIANGLES, 6, gl.UNSIGNED_BYTE, 0, 1);
+ }
+
+ function multiDrawArraysWEBGL(gl) {
+ const ext = gl.getExtension('WEBGL_multi_draw');
+ if (!ext) {
+ throw 'Should not have run this test without WEBGL_multi_draw';
+ }
+
+ ext.multiDrawArraysWEBGL(
+ gl.TRIANGLES,
+ [0], 0, // firsts
+ [6], 0, // counts
+ 1, // drawCount
+ );
+ }
+
+ function multiDrawElementsWEBGL(gl) {
+ const ext = gl.getExtension('WEBGL_multi_draw');
+ if (!ext) {
+ throw 'Should not have run this test without WEBGL_multi_draw';
+ }
+
+ ext.multiDrawElementsWEBGL(
+ gl.TRIANGLES,
+ [6], 0, // counts
+ gl.UNSIGNED_BYTE,
+ [0], 0, // offsets
+ 1, // drawCount
+ );
+ }
+
+ function multiDrawArraysInstancedWEBGL(gl) {
+ const ext = gl.getExtension('WEBGL_multi_draw');
+ if (!ext) {
+ throw 'Should not have run this test without WEBGL_multi_draw';
+ }
+ ext.multiDrawArraysInstancedWEBGL(
+ gl.TRIANGLES,
+ [0], 0, // firsts
+ [6], 0, // counts
+ [1], 0, // instances
+ 1, // drawCount
+ );
+ }
+
+ function multiDrawElementsInstancedWEBGL(gl) {
+ const ext = gl.getExtension('WEBGL_multi_draw');
+ if (!ext) {
+ throw 'Should not have run this test without WEBGL_multi_draw';
+ }
+ ext.multiDrawElementsInstancedWEBGL(
+ gl.TRIANGLES,
+ [6], 0, // counts
+ gl.UNSIGNED_BYTE,
+ [0], 0, // offsets
+ [1], 0, // instances
+ 1, // drawCount
+ );
+ }
+
+ await testFn(drawArrays); // sanity check
+ await testFn(drawElements); // sanity check
+
+ // It's only legal to call testFn if the extension is supported,
+ // since the invalid vertex attrib tests, in particular, expect the
+ // draw function to have an effect.
+ if (gl.getExtension('WEBGL_multi_draw')) {
+ await testFn(multiDrawArraysWEBGL);
+ await testFn(multiDrawElementsWEBGL);
+ await testFn(multiDrawArraysInstancedWEBGL);
+ await testFn(multiDrawElementsInstancedWEBGL);
+ }
+}
+
+async function runCompositingTests() {
+ const compositingTestFn = createCompositingTestFn({
+ webglVersion: 1,
+ shadersFn(gl) {
+ const vs = `\
+ //#extension GL_ANGLE_multi_draw : enable
+ attribute vec4 position;
+ void main() {
+ gl_Position = position;
+ }
+ `;
+ const fs = `\
+ precision mediump float;
+ void main() {
+ gl_FragColor = vec4(1, 0, 0, 1);
+ }
+ `;
+ return [vs, fs];
+ },
+ });
+ await runDrawTests(compositingTestFn);
+}
+
+async function runInvalidAttribTests(gl) {
+ const invalidAttribTestFn = createInvalidAttribTestFn(gl);
+ await runDrawTests(invalidAttribTestFn);
+}
+
+function testSideEffects() {
+ debug("")
+ debug("Testing that ANGLE_instanced_arrays is implicitly enabled")
+ const canvas = document.createElement("canvas");
+ const gl = wtu.create3DContext(canvas, undefined, 1);
+ if (!gl) {
+ testFailed('WebGL context creation failed');
+ return;
+ }
+ gl.enableVertexAttribArray(0);
+ const VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
+ gl.getVertexAttrib(0, VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "divisor enum unknown");
+ const ext = gl.getExtension("WEBGL_multi_draw");
+ if (ext) {
+ debug("WEBGL_multi_draw enabled");
+ gl.getVertexAttrib(0, VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "divisor enum known");
+ }
+}
+
+async function main() {
+ runTest();
+ testSideEffects();
+ await runInvalidAttribTests(gl);
+ await runCompositingTests();
+ finishTest();
+}
+main();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-webcodecs-video-frame.html b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-webcodecs-video-frame.html
new file mode 100644
index 0000000000..f0e413e2f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/extensions/webgl-webcodecs-video-frame.html
@@ -0,0 +1,211 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="UTF-8">
+ <link rel="stylesheet" href="../../resources/js-test-style.css" />
+ <script src="../../js/js-test-pre.js"></script>
+ <script src="../../js/webgl-test-utils.js"></script>
+ <script src="../../js/tests/out-of-bounds-test.js"></script>
+ <script src="../../../../extensions/proposals/WEBGL_webcodecs_video_frame/webgl_webcodecs_video_frame.js"></script>
+ <style>
+ canvas {
+ padding: 10px;
+ background: gold;
+ }
+
+ button {
+ background-color: #555555;
+ border: none;
+ color: white;
+ padding: 15px 32px;
+ width: 150px;
+ text-align: center;
+ display: block;
+ font-size: 16px;
+ }
+ </style>
+</head>
+
+<body>
+ <canvas id="src" width="640" height="480"></canvas>
+ <canvas id="dst" width="640" height="480"></canvas>
+ <p id="info"></p>
+ <div id="description"></div>
+ <div id="console"></div>
+ <script>
+ "use strict";
+ description("Test of importing Videoframe from Webcodecs to Webgl");
+
+ const kIsRunningTest = true;
+ const kMaxFrame = 10;
+ const kTestPixel = [255, 128, 0, 255];
+ // Sum of pixel difference of R/G/B channel. Use to decide whether a
+ // pixel is matched with another.
+ const codec_string = "vp09.00.51.08.00";
+
+ let wtu = WebGLTestUtils;
+ let cnv = document.getElementById("src");
+ let src_width = cnv.width;
+ let src_height = cnv.height;
+ let src_color = "rgba(" + kTestPixel[0].toString() + "," + kTestPixel[1].toString() + ","
+ + kTestPixel[2].toString() + "," + kTestPixel[3].toString() + ")";
+ let frame_counter = 0;
+ let pixelCompareTolerance = 5;
+
+ function getQueryVariable(variable) {
+ var query = window.location.search.substring(1);
+ var vars = query.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] == variable) { return pair[1]; }
+ }
+ return false;
+ }
+
+ let th = parseInt(getQueryVariable('threshold'));
+ if (!isNaN(th))
+ pixelCompareTolerance = th;
+
+ async function startDrawing() {
+ let cnv = document.getElementById("src");
+ var ctx = cnv.getContext('2d', { alpha: false });
+
+ ctx.fillStyle = src_color;
+ let drawOneFrame = function (time) {
+ ctx.fillStyle = src_color;
+ ctx.fillRect(0, 0, src_width, src_height);
+ window.requestAnimationFrame(drawOneFrame);
+ }
+ window.requestAnimationFrame(drawOneFrame);
+ }
+
+ function captureAndEncode(processChunk) {
+ let cnv = document.getElementById("src");
+ let fps = 60;
+ let pending_outputs = 0;
+ let stream = cnv.captureStream(fps);
+ let processor = new MediaStreamTrackProcessor(stream.getVideoTracks()[0]);
+
+ const init = {
+ output: (chunk) => {
+ testPassed("Encode frame successfully.");
+ pending_outputs--;
+ processChunk(chunk);
+ },
+ error: (e) => {
+ testFailed("Failed to encode frame.");
+ finishTest();
+ vtr.stop();
+ }
+ };
+
+ const config = {
+ codec: codec_string,
+ width: cnv.width,
+ height: cnv.height,
+ bitrate: 10e6,
+ framerate: fps,
+ };
+
+ let encoder = new VideoEncoder(init);
+ encoder.configure(config);
+
+ const frame_reader = processor.readable.getReader();
+ frame_reader.read().then(function processFrame({done, value}) {
+ if (done)
+ return;
+
+ if (pending_outputs > 30) {
+ console.log("drop this frame");
+ // Too many frames in flight, encoder is overwhelmed
+ // let's drop this frame.
+ value.close();
+ frame_reader.read().then(processFrame);
+ return;
+ }
+
+ if(frame_counter == kMaxFrame) {
+ frame_reader.releaseLock();
+ processor.readable.cancel();
+ value.close();
+ return;
+ }
+
+ frame_counter++;
+ pending_outputs++;
+ const insert_keyframe = (frame_counter % 150) == 0;
+ encoder.encode(value, { keyFrame: insert_keyframe });
+
+ frame_reader.read().then(processFrame);
+ });
+ }
+
+ function startDecodingAndRendering(cnv, handleFrame) {
+ const init = {
+ output: handleFrame,
+ error: (e) => {
+ testFailed("Failed to decode frame.");
+ finishTest();
+ }
+ };
+
+ const config = {
+ codec: codec_string,
+ codedWidth: cnv.width,
+ codedHeight: cnv.height,
+ acceleration: "deny",
+
+ };
+
+ let decoder = new VideoDecoder(init);
+ decoder.configure(config);
+ return decoder;
+ }
+
+ function isFramePixelMatched(gl, th_per_pixel = pixelCompareTolerance) {
+ WebGLTestUtils.checkCanvasRect(gl, 0, 0, src_width, src_width, kTestPixel, "should be orange", pixelCompareTolerance)
+ }
+
+ function main() {
+ if (!("VideoEncoder" in window)) {
+ testPassed("WebCodecs API is not supported.");
+ finishTest();
+ return;
+ }
+ let cnv = document.getElementById("dst");
+
+ let webgl_webcodecs_test_context = {
+ maxFrameTested: kMaxFrame,
+ displayed_frame: 0,
+ isFramePixelMatched: isFramePixelMatched,
+ testFailed: testFailed,
+ testPassed: testPassed,
+ finishTest: finishTest
+ };
+ setTestMode(webgl_webcodecs_test_context);
+ let handleFrame = requestWebGLVideoFrameHandler(cnv);
+ if (handleFrame === null) {
+ finishTest();
+ return;
+ }
+
+ startDrawing();
+ let decoder = startDecodingAndRendering(cnv, handleFrame);
+ captureAndEncode((chunk) => {
+ decoder.decode(chunk);
+ });
+ }
+
+ document.body.onload = main;
+ </script>
+
+</body>
+
+</html> \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt
new file mode 100644
index 0000000000..8ab2039cc6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/00_test_list.txt
@@ -0,0 +1,12 @@
+bugs/00_test_list.txt
+--min-version 1.0.3 constructors/00_test_list.txt
+functions/00_test_list.txt
+implicit/00_test_list.txt
+--min-version 1.0.2 literals/00_test_list.txt
+--min-version 1.0.2 matrices/00_test_list.txt
+misc/00_test_list.txt
+--min-version 1.0.4 preprocessor/00_test_list.txt
+reserved/00_test_list.txt
+--min-version 1.0.2 samplers/00_test_list.txt
+variables/00_test_list.txt
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt
new file mode 100644
index 0000000000..c84e94bbd0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/00_test_list.txt
@@ -0,0 +1,52 @@
+--min-version 1.0.4 angle-ambiguous-function-call.html
+--min-version 1.0.4 angle-constructor-invalid-parameters.html
+--min-version 1.0.3 angle-d3d11-compiler-error.html
+--min-version 1.0.3 angle-dx-variable-bug.html
+--min-version 1.0.3 array-of-struct-with-int-first-position.html
+--min-version 1.0.4 assign-to-swizzled-twice-in-function.html
+--min-version 1.0.4 bool-type-cast-bug-int-float.html
+--min-version 1.0.4 character-set.html
+--min-version 1.0.3 compare-loop-index-to-uniform.html
+--min-version 1.0.3 complex-glsl-does-not-crash.html
+--min-version 1.0.4 compound-assignment-type-combination.html
+--min-version 1.0.3 conditional-discard-in-loop.html
+--min-version 1.0.3 conditional-discard-optimization.html
+--min-version 1.0.4 conditional-texture-fetch.html
+--min-version 1.0.3 constant-precision-qualifier.html
+--min-version 1.0.3 --max-version 1.99 essl3-shaders-with-webgl1.html
+--min-version 1.0.4 floor-div-cos-should-not-truncate.html
+--min-version 1.0.3 floored-division-accuracy.html
+--min-version 1.0.3 fragcoord-linking-bug.html
+--min-version 1.0.4 gl-fragcoord-multisampling-bug.html
+--min-version 1.0.4 global-invariant-does-not-leak-across-shaders.html
+--min-version 1.0.4 if-return-and-elseif.html
+--min-version 1.0.4 init-array-with-loop.html
+--min-version 1.0.4 invariant-does-not-leak-across-shaders.html
+--min-version 1.0.4 in-parameter-passed-as-inout-argument-and-global.html
+--min-version 1.0.4 logic-inside-block-without-braces.html
+--min-version 1.0.3 long-expressions-should-not-crash.html
+--min-version 1.0.4 loop-if-loop-gradient.html
+--min-version 1.0.3 modulo-arithmetic-accuracy.html
+--min-version 1.0.3 multiplication-assignment.html
+--min-version 1.0.3 nested-functions-should-not-crash.html
+--min-version 1.0.4 nested-loops-with-break-and-continue.html
+--min-version 1.0.4 nested-sequence-operator.html
+--min-version 1.0.4 pow-of-small-constant-in-user-defined-function.html
+--min-version 1.0.4 pow-with-constant-exponent-should-not-crash.html
+--min-version 1.0.4 qualcomm-crash.html
+--min-version 1.0.4 qualcomm-loop-with-continue-crash.html
+--min-version 1.0.4 sampler-array-struct-function-arg.html
+--min-version 1.0.3 sampler-array-using-loop-index.html
+--min-version 1.0.4 sampler-struct-function-arg.html
+--min-version 1.0.4 sequence-operator-evaluation-order.html
+--min-version 1.0.4 sketchfab-lighting-shader-crash.html
+--min-version 1.0.4 struct-constructor-highp-bug.html
+--min-version 1.0.4 struct-with-single-member-constructor.html
+--min-version 1.0.3 temp-expressions-should-not-crash.html
+--min-version 1.0.4 unary-minus-operator-float-bug.html
+--min-version 1.0.4 undefined-index-should-not-crash.html
+--min-version 1.0.3 uniforms-should-not-lose-values.html
+--min-version 1.0.4 varying-arrays-should-not-be-reversed.html
+--min-version 1.0.4 vector-matrix-constructor-scalarization.html
+--min-version 1.0.4 vector-scalar-arithmetic-inside-loop.html
+--min-version 1.0.4 vector-scalar-arithmetic-inside-loop-complex.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md
new file mode 100644
index 0000000000..d917f6d741
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/README.md
@@ -0,0 +1,18 @@
+BUGS
+====
+
+This folder is for GLSL tests that test driver specific bugs.
+
+Most tests in other folders are fairly generic. While they might
+only fail on specific drivers the tests themselves are designed
+to test something in a generic way.
+
+Tests in this folder on the otherhand are very targeted. They may
+have very specific shaders that only fail under specific circumstances
+on specific drivers.
+
+An example might be if there was a driver that failed only when
+and identifier was named "ABC". It makes no sense to have a generic
+test that says "must allow ABC". A generic test would test some
+subset of all possible identifiers not just one.
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html
new file mode 100644
index 0000000000..c7f10a05f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-ambiguous-function-call.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>ANGLE ambiguous function call 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="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderAmbiguousHLSLFunctionCall" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 uv;
+uniform mat2 um;
+vec4 foo(vec4 v) {
+ return v;
+}
+vec4 foo(mat2 m) {
+ return vec4(m);
+}
+void main()
+{
+ gl_FragColor = foo(uv) + foo(um);
+}
+</script>
+<script id="fshaderAmbiguousHLSLStructFunctionCall" type="x-shader/x-fragment">
+precision mediump float;
+uniform float u_zero;
+struct S { float foo; };
+struct S2 { float foo; };
+float get(S s) { return s.foo + u_zero; }
+float get(S2 s2) { return 0.25 + s2.foo + u_zero; }
+void main()
+{
+ S s;
+ s.foo = 0.5;
+ S2 s2;
+ s2.foo = 0.25;
+ gl_FragColor = vec4(0.0, get(s) + get(s2), 0.0, 1.0);
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description("Test overloaded functions with vec4 and mat2 parameters that have had issues in ANGLE. Issues were due to HLSL compiler treating float4 and float2x2 as the same type when resolving which overloaded function to call.");
+
+GLSLConformanceTester.runTests([
+{
+ fShaderId: 'fshaderAmbiguousHLSLFunctionCall',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Disambiguate correctly between overloaded function calls with 4-component float parameters"
+},
+{
+ fShaderId: 'fshaderAmbiguousHLSLStructFunctionCall',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Disambiguate correctly between overloaded function calls with struct parameters",
+ render: true
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html
new file mode 100644
index 0000000000..6c663811f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-constructor-invalid-parameters.html
@@ -0,0 +1,56 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>ANGLE constructor bugs 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="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderSamplerInConstructorArguments" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D s;
+void main()
+{
+ gl_FragColor = vec4(0.0, s, 0.0, 0.0);
+}
+</script>
+<script id="fshaderVoidInConstructorArguments" type="x-shader/x-fragment">
+precision mediump float;
+void foo() {}
+void main()
+{
+ gl_FragColor = vec4(0.0, foo(), 0.0, 0.0);
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description("Test constructors that have had issues in ANGLE");
+
+GLSLConformanceTester.runTests([
+{
+ fShaderId: 'fshaderSamplerInConstructorArguments',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Sampler in constructor arguments should not compile"
+},
+{
+ fShaderId: 'fshaderVoidInConstructorArguments',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Void in constructor arguments should not compile"
+},
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html
new file mode 100644
index 0000000000..158ddad08f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-d3d11-compiler-error.html
@@ -0,0 +1,96 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>ANGLE D3D11 Bug - Shader compilation error</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+
+<script id="vs" type="x-shader/x-fragment">
+precision mediump float;
+uniform float A;
+void main() {
+ bool B = bool(A);
+ float x = B ? -A : 1.+A;
+ float y = B ? 1.+A : -A;
+ gl_Position = vec4(x, y, 0, 0);
+}
+
+</script>
+<script id="fs" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(1, 0, 0, 1);
+}
+</script>
+
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+// See http://crbug.com/371868 for original failing case.
+description("This test checks an ANGLE D3D11 shader compiler error.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking shader compilation and linking.");
+
+ checkCompilation();
+}
+
+function checkCompilation() {
+ var vs = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vs, document.getElementById("vs").text);
+ gl.compileShader(vs);
+ if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) {
+ testFailed("Vertex Shader failed to compile: " + gl.getShaderInfoLog(vs));
+ return;
+ }
+
+ var fs = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fs, document.getElementById("fs").text);
+ gl.compileShader(fs);
+ if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) {
+ testFailed("Fragment Shader failed to compile: " + gl.getShaderInfoLog(fs));
+ return;
+ }
+
+ var p = gl.createProgram();
+ gl.attachShader(p, vs);
+ gl.attachShader(p, fs);
+ gl.linkProgram(p);
+ if (!gl.getProgramParameter(p, gl.LINK_STATUS)) {
+ testFailed("Program failed to link: " + gl.getProgramInfoLog(p));
+ return;
+ }
+
+ testPassed("Linked Successfully");
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html
new file mode 100644
index 0000000000..c094beff66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/angle-dx-variable-bug.html
@@ -0,0 +1,96 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>ANGLE D3D11 Bug - Variables beginning with "dx_"</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+
+<script id="vs" type="x-shader/x-fragment">
+precision mediump float;
+attribute vec4 position;
+varying float dx_var;
+void main() {
+ gl_Position = position;
+ dx_var = position.x;
+}
+
+</script>
+<script id="fs" type="x-shader/x-fragment">
+precision mediump float;
+varying float dx_var;
+void main() {
+ gl_FragColor = vec4(dx_var, 0, 0, 1);
+}
+</script>
+
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+// See http://crbug.com/371868 for original failing case.
+description("This test checks an ANGLE D3D11 shader compiler error.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking shader compilation and linking.");
+
+ checkCompilation()
+}
+
+function checkCompilation() {
+ var vs = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vs, document.getElementById("vs").text);
+ gl.compileShader(vs);
+ if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) {
+ testFailed("Vertex Shader failed to compile: " + gl.getShaderInfoLog(vs));
+ return;
+ }
+
+ var fs = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fs, document.getElementById("fs").text);
+ gl.compileShader(fs);
+ if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) {
+ testFailed("Fragment Shader failed to compile: " + gl.getShaderInfoLog(fs));
+ return;
+ }
+
+ var p = gl.createProgram();
+ gl.attachShader(p, vs);
+ gl.attachShader(p, fs);
+ gl.linkProgram(p);
+ if (!gl.getProgramParameter(p, gl.LINK_STATUS)) {
+ testFailed("Program failed to link: " + gl.getProgramInfoLog(p));
+ return;
+ }
+
+ testPassed("Linked Successfully");
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html
new file mode 100644
index 0000000000..e7dd805566
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/array-of-struct-with-int-first-position.html
@@ -0,0 +1,141 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Driver Bug - Array of structs with int or bool in first position</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+
+<body>
+<canvas id="example" style="border: none;" width="788" height="256"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="shader-vs" type="x-shader/x-vertex">
+attribute vec2 pos;
+void main(void) {
+ gl_Position = vec4(pos, 0.0, 1.0);
+}
+</script>
+
+<script id="shader-fs-int" type="x-shader/x-fragment">
+precision mediump float;
+struct Light {
+ int unused;
+ vec3 color;
+};
+const int numLights = 1;
+void main() {
+ Light lights[numLights];
+ lights[0].color = vec3(0.0, 0.5, 0.0);
+
+ vec3 result = vec3(0.0, 0.0, 0.0);
+ for (int i=0; i<numLights; i++) {
+ result += lights[i].color;
+ }
+ gl_FragColor = vec4(result.rgb, 1.0);
+}
+</script>
+
+<script id="shader-fs-bool" type="x-shader/x-fragment">
+precision mediump float;
+struct Light {
+ bool unused;
+ vec3 color;
+};
+const int numLights = 1;
+void main() {
+ Light lights[numLights];
+ lights[0].color = vec3(0.0, 0.5, 0.0);
+
+ vec3 result = vec3(0.0, 0.0, 0.0);
+ for (int i=0; i<numLights; i++) {
+ result += lights[i].color;
+ }
+ gl_FragColor = vec4(result.rgb, 1.0);
+}
+</script>
+
+<script id="shader-fs-bool-read" type="x-shader/x-fragment">
+precision mediump float;
+struct Light {
+ bool useLight;
+ vec3 color;
+};
+const int numLights = 1;
+void main() {
+ Light lights[numLights];
+ lights[0].color = vec3(0.0, 0.5, 0.0);
+ lights[0].useLight = true;
+
+ vec3 result = vec3(0.0, 0.0, 0.0);
+ for (int i=0; i<numLights; i++) {
+ Light light = lights[i];
+ if (light.useLight) {
+ result += light.color;
+ }
+ }
+ gl_FragColor = vec4(result.rgb, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+
+function test() {
+ description();
+ debug(
+ "This test checks accessing an array of structs, where the struct " +
+ "definition has an int or bool in the first position. " +
+ "This test has has failed in OS X on some NVIDIA cards, " +
+ "such as the NVIDIA GeForce GT 650M. If things are working " +
+ "correctly, then there will be a series of 50% green squares.")
+ debug("");
+
+ var wtu = WebGLTestUtils;
+ var canvas = document.getElementById("example");
+ var gl = wtu.create3DContext(canvas);
+
+ var testNum = 0;
+ var border = 10; // border between test squares for visibility
+ var squareSize = 256;
+ var expectedColor = [0, 127, 0, 255]; // 50% green
+
+ function subTest(message, fragmentShader) {
+ debug(message);
+ var startX = (squareSize + border) * testNum;
+ var program = wtu.setupProgram(
+ gl, ["shader-vs", fragmentShader], ["pos"], null, true);
+ gl.viewport(startX, 0, squareSize, squareSize);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(
+ gl, startX, 0, squareSize, squareSize,
+ expectedColor, "square should be 50% green", 1);
+ debug("");
+ testNum++;
+ }
+
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ wtu.setupUnitQuad(gl);
+ subTest("Test unused int in first struct position.", "shader-fs-int");
+ subTest("Test unused bool in first struct position.", "shader-fs-bool");
+ subTest("Test used bool in first struct position.", "shader-fs-bool-read");
+ }
+}
+
+test();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/assign-to-swizzled-twice-in-function.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/assign-to-swizzled-twice-in-function.html
new file mode 100644
index 0000000000..847127a408
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/assign-to-swizzled-twice-in-function.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Assigning an assignment to a swizzled value inside function</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+vec2 f()
+{
+ vec2 r = vec2(0);
+ r.x = r.y = 1.0;
+ return r;
+}
+
+void main()
+{
+ gl_FragColor.ga = f();
+}
+
+</script>
+<script type="text/javascript">
+"use strict";
+description();
+
+// Minimal test case based on report at http://crbug.com/798117
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Assigning an assignment to a swizzled value inside a user-defined function"
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html
new file mode 100644
index 0000000000..984c4e0289
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/bool-type-cast-bug-int-float.html
@@ -0,0 +1,312 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Verify int(bool) and float(bool) work correctly (Mac AMD driver bug)</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader-int1" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+varying mediump float fvalue;
+uniform bool bvalue;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+ int ivalue = int(bvalue);
+ if (ivalue == 0) {
+ fvalue = 0.0;
+ } else if (ivalue == 1) {
+ fvalue = 1.0;
+ } else {
+ fvalue = -1.0;
+ }
+}
+</script>
+<script id="fshader-int1" type="x-shader/x-fragment">
+varying mediump float fvalue;
+
+void main() {
+ if (fvalue == 1.0)
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == 0.0)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-int2" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader-int2" type="x-shader/x-fragment">
+uniform bool bvalue;
+
+void main() {
+ int ivalue = int(bvalue);
+
+ if (ivalue == 1)
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (ivalue == 0)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-float1" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+varying mediump float fvalue;
+uniform bool bvalue;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+ fvalue = float(bvalue);
+}
+</script>
+<script id="fshader-float1" type="x-shader/x-fragment">
+varying mediump float fvalue;
+
+void main() {
+ if (fvalue == 1.0)
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == 0.0)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-float2" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader-float2" type="x-shader/x-fragment">
+uniform bool bvalue;
+
+void main() {
+ mediump float fvalue = float(bvalue);
+
+ if (fvalue == 1.0)
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == 0.0)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-vec2-1" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+varying mediump vec2 fvalue;
+uniform bool bvalue;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+ fvalue = vec2(bvalue);
+}
+</script>
+<script id="fshader-vec2-1" type="x-shader/x-fragment">
+varying mediump vec2 fvalue;
+
+void main() {
+ if (fvalue == vec2(1.0, 1.0))
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == vec2(0.0, 0.0))
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-vec2-2" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader-vec2-2" type="x-shader/x-fragment">
+precision mediump float;
+uniform bool bvalue;
+
+void main() {
+ vec2 fvalue = vec2(bvalue);
+
+ if (fvalue == vec2(1.0, 1.0))
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == vec2(0.0, 0.0))
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-vec3-1" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+varying mediump vec3 fvalue;
+uniform bool bvalue;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+ fvalue = vec3(bvalue);
+}
+</script>
+<script id="fshader-vec3-1" type="x-shader/x-fragment">
+varying mediump vec3 fvalue;
+
+void main() {
+ if (fvalue == vec3(1.0, 1.0, 1.0))
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == vec3(0.0, 0.0, 0.0))
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-vec3-2" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader-vec3-2" type="x-shader/x-fragment">
+precision mediump float;
+uniform bool bvalue;
+
+void main() {
+ vec3 fvalue = vec3(bvalue);
+
+ if (fvalue == vec3(1.0, 1.0, 1.0))
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == vec3(0.0, 0.0, 0.0))
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-vec4-1" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+varying mediump vec4 fvalue;
+uniform bool bvalue;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+ fvalue = vec4(bvalue);
+}
+</script>
+<script id="fshader-vec4-1" type="x-shader/x-fragment">
+varying mediump vec4 fvalue;
+
+void main() {
+ if (fvalue == vec4(1.0, 1.0, 1.0, 1.0))
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == vec4(0.0, 0.0, 0.0, 0.0))
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="vshader-vec4-2" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader-vec4-2" type="x-shader/x-fragment">
+precision mediump float;
+uniform bool bvalue;
+
+void main() {
+ vec4 fvalue = vec4(bvalue);
+
+ if (fvalue == vec4(1.0, 1.0, 1.0, 1.0))
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else if (fvalue == vec4(0.0, 0.0, 0.0, 0.0))
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+ <script type="application/javascript">
+"use strict";
+description("Verify int(bool) and float(bool) work correctly");
+debug("");
+var wtu = WebGLTestUtils;
+function test() {
+ var gl = wtu.create3DContext("canvas");
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ wtu.setupUnitQuad(gl);
+
+ var testCases = [
+ { vshader: "vshader-int1", fshader: "fshader-int1", desc: "vertex shader int" },
+ { vshader: "vshader-int2", fshader: "fshader-int2", desc: "fragment shader int" },
+ { vshader: "vshader-float1", fshader: "fshader-float1", desc: "vertex shader float" },
+ { vshader: "vshader-float2", fshader: "fshader-float2", desc: "fragment shader float" },
+ { vshader: "vshader-vec2-1", fshader: "fshader-vec2-1", desc: "vertex shader vec2" },
+ { vshader: "vshader-vec2-2", fshader: "fshader-vec2-2", desc: "fragment shader vec2" },
+ { vshader: "vshader-vec3-1", fshader: "fshader-vec3-1", desc: "vertex shader vec3" },
+ { vshader: "vshader-vec3-2", fshader: "fshader-vec3-2", desc: "fragment shader vec3" },
+ { vshader: "vshader-vec4-1", fshader: "fshader-vec4-1", desc: "vertex shader vec4" },
+ { vshader: "vshader-vec4-2", fshader: "fshader-vec4-2", desc: "fragment shader vec4" },
+ ];
+
+ for (var idx = 0; idx < testCases.length; ++idx) {
+ var test = testCases[idx];
+
+ debug("");
+ var program = wtu.setupProgram(gl, [test.vshader, test.fshader], ["aPosition"]);
+ if (!program) {
+ testFailed("Fail to set up program");
+ } else {
+ var uniformLoc = gl.getUniformLocation(program, 'bvalue');
+ debug("Testing " + test.desc + " with false");
+ gl.uniform1i(uniformLoc, 0);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255]);
+ debug("Testing " + test.desc + " with true");
+ gl.uniform1i(uniformLoc, 1);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255]);
+ gl.deleteProgram(program);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from testing");
+ }
+ }
+};
+
+test();
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/character-set.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/character-set.html
new file mode 100644
index 0000000000..6d6fca5f89
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/character-set.html
@@ -0,0 +1,115 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Character Set</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+// See http://crbug.com/1108588 for original failing case.
+// Check "OpenGL Registry The OpenGL ES Shading Language"
+// Section 3.2 Character Sets For more info
+description("This test checks character set validation for glsl.");
+
+debug("");
+debug("Canvas.getContext");
+
+let wtu = WebGLTestUtils;
+let gl = wtu.create3DContext("canvas");
+let consoleDiv = document.getElementById("console");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking shader character set validation and compilation");
+
+ runTest();
+}
+
+function testShaderSource(shaderSource, msg) {
+ if (!quietMode()) {
+ wtu.addShaderSource(consoleDiv, "test fragment shader", shaderSource);
+ }
+
+ let shader = gl.createShader(gl.FRAGMENT_SHADER);
+ if (shader == null) {
+ testFailed("*** Error: unable to create shader '" + shaderSource + "'");
+ return;
+ }
+
+ gl.shaderSource(shader, shaderSource);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, msg);
+}
+
+function MUST(ifTruthy) {
+ return ifTruthy ? 'MUST' : 'MUST NOT';
+}
+
+function runTest() {
+
+ const BAD_STRINGS = [
+ '$',
+ '"',
+ '一些注释',
+ '#line 42 "foo.glsl"',
+ ];
+ const TESTS = [
+ ['in identifier', s => s, false],
+ ['in comment', s => `// ${s}`, true, true],
+ ['in ifdef-out', s => `#if 0 \n${s} \n#endif`, true],
+ ['in ifdef-out #preproc', s => `#if 0 \n#${s} \n#endif`, true],
+ ['in #preproc', s => `#${s}`, false],
+ ['in comment after #define', s => `#define TEST // ${s}`, true], // Regression test for crbug.com/940865
+ ];
+
+ const glsl_tests = [];
+
+ for (const s of BAD_STRINGS) {
+ for (const [where, template, validCompile] of TESTS) {
+ const st = template(s);
+ const src = `
+precision mediump float;
+${st}
+void main() {
+ gl_FragColor = vec4(1, 0, 0, 1);
+}`.trim();
+
+ testShaderSource(src, `shaderSource allows Out-of-charset string '${s}' ${where} until compilation.`);
+
+ glsl_tests.push(
+ {
+ fShaderSource: src,
+ fShaderSuccess: validCompile,
+ linkSuccess: validCompile,
+ passMsg: `Out-of-charset string '${s}' ${where} ${MUST(validCompile)} compile.`
+ }
+ );
+ }
+ }
+
+ GLSLConformanceTester.runTests(glsl_tests);
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html
new file mode 100644
index 0000000000..a96da7fea9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compare-loop-index-to-uniform.html
@@ -0,0 +1,50 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Driver bug - Comparing loop index against uniform in a fragment shader should work</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform int uCount;
+
+void main() {
+ float a = 0.0;
+ for (int i = 0; i < 5; ++i) {
+ if (i < uCount) {
+ a += 0.2;
+ }
+ }
+ gl_FragColor = vec4(1.0 - a, a, 0.0, 1.0);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description("Comparing loop index to an uniform in a fragment shader should work.");
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Compare a loop index to an uniform',
+ uniforms: [{name: "uCount", functionName: "uniform1i", value: 5}]
+}
+]);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html
new file mode 100644
index 0000000000..7b324def84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/complex-glsl-does-not-crash.html
@@ -0,0 +1,191 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Driver Bug - complex glsl should not crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main()
+{
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader" type="x-shader/x-vertex">
+precision mediump float;
+varying vec4 v_varying;
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="vshaderArrayTest" type="x-shader/x-vertex">
+attribute vec4 a_position;
+varying vec4 v_varying;
+uniform $(type) u_uniform[$(numTestType)];
+void main()
+{
+ v_varying = $(code);
+ gl_Position = a_position;
+}
+</script>
+<script id="fshaderArrayTest" type="x-shader/x-fragment">
+precision mediump float;
+uniform $(type) u_uniform[$(numTestType)];
+void main()
+{
+ gl_FragColor = $(code);
+}
+</script>
+<script id="vshaderUniformTest" type="x-shader/x-fragment">
+attribute vec4 a_position;
+varying vec4 v_varying;
+$(uniforms)
+void main()
+{
+ v_varying = $(code);
+ gl_Position = a_position;
+}
+</script>
+<script id="fshaderUniformTest" type="x-shader/x-fragment">
+precision mediump float;
+$(uniforms)
+void main()
+{
+ gl_FragColor = $(code);
+}
+</script>
+<script>
+"use strict";
+description();
+debug("");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var uniformTypes = [
+ { type: "bool", componentsPerRow: 1, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0, 0)", },
+ { type: "float", componentsPerRow: 1, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0, 0)", },
+ { type: "int", componentsPerRow: 1, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0, 0)", },
+ { type: "vec2", componentsPerRow: 2, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0)", },
+ { type: "ivec2", componentsPerRow: 2, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0)", },
+ { type: "bvec2", componentsPerRow: 2, rows: 1, code: "vec4(u_uniform$(id)$(index), 0, 0)", },
+ { type: "vec3", componentsPerRow: 3, rows: 1, code: "vec4(u_uniform$(id)$(index), 0)", },
+ { type: "ivec3", componentsPerRow: 3, rows: 1, code: "vec4(u_uniform$(id)$(index), 0)", },
+ { type: "bvec3", componentsPerRow: 3, rows: 1, code: "vec4(u_uniform$(id)$(index), 0)", },
+ { type: "vec4", componentsPerRow: 4, rows: 1, code: "vec4(u_uniform$(id)$(index))", },
+ { type: "ivec4", componentsPerRow: 4, rows: 1, code: "vec4(u_uniform$(id)$(index))", },
+ { type: "bvec4", componentsPerRow: 4, rows: 1, code: "vec4(u_uniform$(id)$(index))", },
+// Yes, the spec says mat2 takes 4 columns, 2 rows.
+ { type: "mat2", componentsPerRow: 4, rows: 2, code: "vec4(u_uniform$(id)$(index)[0], 0, 0)", },
+ { type: "mat3", componentsPerRow: 3, rows: 3, code: "vec4(u_uniform$(id)$(index)[0], 0)", },
+ { type: "mat4", componentsPerRow: 4, rows: 4, code: "vec4(u_uniform$(id)$(index)[0])", },
+// Samplers generally have more restictive limits.
+// { type: "sampler2D", componentsPerRow: 1, rows: 1, code: "vec4(texture2D(u_uniform[$(index)], vec2(0, 0)))", },
+// { type: "samplerCube", componentsPerRow: 1, rows: 1, code: "vec4(textureCube(u_uniform[$(index)], vec3(0, 0, 0)))", },
+];
+
+var vBaseSource = wtu.getScript("vshader");
+var fBaseSource = wtu.getScript("fshader");
+var vArrayTestSource = wtu.getScript("vshaderArrayTest");
+var fArrayTestSource = wtu.getScript("fshaderArrayTest");
+var vUniformTestSource = wtu.getScript("vshaderUniformTest");
+var fUniformTestSource = wtu.getScript("fshaderUniformTest");
+
+var tests = [];
+var shaderTypes = [
+ { type: "vertex",
+ // For tests that expect failure which shader might fail.
+ vertExpectation: false,
+ fragExpectation: true,
+ vertArrayTest: vArrayTestSource,
+ fragArrayTest: fBaseSource,
+ vertUniformTest: vUniformTestSource,
+ fragUniformTest: fBaseSource,
+ maxVectors: gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS),
+ minVectors: 128, // GLSL ES 1.0.17 Appendix A.7,
+ },
+ { type: "fragment",
+ // For tests that expect failure which shader might fail.
+ vertExpectation: true,
+ fragExpectation: false,
+ vertArrayTest: vBaseSource,
+ fragArrayTest: fArrayTestSource,
+ vertUniformTest: vBaseSource,
+ fragUniformTest: fUniformTestSource,
+ maxVectors: gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS),
+ minVectors: 16, // GLSL ES 1.0.17 Appendix A.7,
+ },
+];
+for (var ss = 0; ss < shaderTypes.length; ++ss) {
+ var shaderType = shaderTypes[ss];
+ debug("max " + shaderType.type + ": " + shaderType.maxVectors);
+ for (var ii = 0; ii < uniformTypes.length; ++ii) {
+ var info = uniformTypes[ii];
+ wtu.log("checking: " + info.type);
+ // Compute the maximum amount of this type allowed in a single array.
+ var numVars = Math.floor(shaderType.maxVectors / info.rows);
+ // Compute the minimum required to work in a single array.
+ var minVars = Math.floor(shaderType.minVectors / info.rows);
+ // Compute the maximum allowed as single elements
+ var numPerRow = Math.floor(4 / info.componentsPerRow);
+ var numMax = Math.floor(shaderType.maxVectors * numPerRow / info.rows);
+
+ // Test array[max] of the type
+ // Note: We can't test for success or failer as actual GL drivers are only required to be able to
+ // do the minimum number. After that it can fail for any reason.
+ var code = wtu.replaceParams(info.code, {id: "", index: "[" + (numVars - 1) + "]"});
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: numVars, code: code}, info),
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: numVars, code: code}, info),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: true,
+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + numVars + " elements (the maximum)",
+ });
+
+ var generateCode = function(numVars) {
+ var uniforms = [];
+ var codes = [];
+ for (var uu = 0; uu < numVars; ++uu) {
+ uniforms.push(" uniform " + info.type + " u_uniform" + uu + ";");
+ codes.push(wtu.replaceParams(info.code, {id: uu, index: ""}));
+ }
+ return {
+ uniforms: uniforms.join("\n"),
+ code: codes.join(" + \n "),
+ };
+ };
+
+ // Test max uniforms of type.
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertUniformTest, generateCode(numMax), info),
+ vShaderSuccess: shaderType.vertExpectation,
+ fShaderSource: wtu.replaceParams(shaderType.fragUniformTest, generateCode(numMax), info),
+ fShaderSuccess: shaderType.fragExpectation,
+ linkSuccess: true,
+ ignoreResults: true,
+ passMsg: shaderType.type + " shader with " + (numMax) + " uniforms of " + info.type,
+ });
+ }
+}
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html
new file mode 100644
index 0000000000..7b61946b35
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/compound-assignment-type-combination.html
@@ -0,0 +1,26 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Result type should match the l-value type in compound assignment</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/tests/compound-assignment-type-combination.js"></script>
+</head>
+<body onload="runTest(1)">
+<div id="description"></div>
+<div id="console"></div>
+<script type="application/javascript">
+description();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html
new file mode 100644
index 0000000000..1c4709dd10
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-in-loop.html
@@ -0,0 +1,142 @@
+<!--
+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.
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Conditional discard in loop issue</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+
+<body>
+<canvas id="output" style="border: none;" width="256" height="256"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="shader-vs" type="x-shader/x-vertex">
+// Inputs
+attribute vec4 a_position;
+attribute vec2 a_tex_coords;
+
+// Output
+varying vec2 v_tex_coords;
+
+void main(void) {
+ v_tex_coords = a_tex_coords;
+ gl_Position = a_position;
+}
+</script>
+
+<script id="shader-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+// Constants
+const float TEXEL_COUNT_V = 256.0;
+const float TEXEL_HEIGHT = 1.0 / TEXEL_COUNT_V;
+const float SEP_IX = TEXEL_COUNT_V / 2.0;
+
+const vec4 GREEN = vec4(0.0, 1.0, 0.0, 1.0);
+const vec4 BLUE = vec4(0.0, 0.0, 1.0, 1.0);
+
+// Input
+varying vec2 v_tex_coords;
+
+uniform sampler2D u_data;
+
+// Without this function or directly returning the data, the issue does not occur
+mediump vec4 UnpackData(in vec4 inData) {
+ float s = inData.x;
+ // Note s is always 0
+ // mod(0, 1) = 0
+ // So return value = (0, 0, -1, 0)
+ return vec4(0.0, 0.0, mod(s, 1.0) - 1.0, 0.0);
+
+ // Comment out the line above and uncomment the line below and the test succeeds on angle-dx11
+ // return vec4(0.0, 0.0, -1.0, 0.0);
+}
+
+void main(void) {
+ // Set initial color
+ gl_FragColor = BLUE;
+
+ if (gl_FragCoord.y <= SEP_IX) {
+ mediump vec2 addr = vec2(v_tex_coords.x, TEXEL_HEIGHT);
+
+ for (float e_ix = 0.0; e_ix < TEXEL_COUNT_V; ++e_ix) {
+ vec4 entry = texture2D(u_data, addr);
+ mediump vec4 unpack = UnpackData(entry);
+
+ // Buffer is filled with 0, unpack is always (0, 0, -1, 0)
+ // So discard is always triggered
+ if (unpack.z == -1.0) {
+ discard;
+ }
+
+ addr.y += unpack.z * TEXEL_HEIGHT;
+ }
+ // If discard is not triggered the output color is blue
+ }
+ else {
+ gl_FragColor = GREEN;
+ }
+}
+</script>
+
+
+<script>
+"use strict";
+
+description();
+debug("");
+debug("If the code is executed correctly, the upper half of the viewport will be green, the lower half will be red.");
+debug("This is a conformance suite test for the issue reported here : https://code.google.com/p/angleproject/issues/detail?id=706");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("output");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+
+ // Create texture filled with zero's
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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);
+ wtu.fillTexture(gl, tex, 256, 256, [0, 0, 0, 0]);
+
+ // Clear complete viewport to red
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ var attribBuffers = wtu.setupUnitQuad(gl, 0, 1);
+ var program = wtu.setupProgram(gl, ["shader-vs", "shader-fs"], ["a_position", "a_tex_coords"], [0, 1], true);
+
+ // Bind texture
+ var uniformMap = wtu.getUniformMap(gl, program);
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.uniform1i(uniformMap.u_data.location, 0);
+
+ // Draw
+ wtu.drawUnitQuad(gl);
+
+ // Verify output
+ wtu.checkCanvasRect(gl, 0, 0, 256, 128, [ 255, 0, 0, 255 ], "should be red", 1);
+ wtu.checkCanvasRect(gl, 0, 128, 256, 128, [ 0, 255, 0, 255 ], "should be green", 1);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html
new file mode 100644
index 0000000000..1c3b1bb6fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-discard-optimization.html
@@ -0,0 +1,117 @@
+<!--
+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: Bill Baxter (wbaxter at google.com) -->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>ANGLE WebGL Shader Conditionals Repro</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+
+<body>
+<canvas id="repro" style="border: none;" width="256" height="256"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="shader-vs" type="x-shader/x-vertex">
+attribute vec2 pos;
+varying mediump float varA;
+void main(void) {
+ varA = 0.;
+ gl_Position = vec4(pos, 0.0, 1.0);
+}
+</script>
+
+<script id="shader-fs" type="x-shader/x-fragment">
+precision mediump float;
+varying float varA;
+void main(void) {
+ if (varA < -1. || (varA < -1. && varA > 1.)) {
+ discard;
+ }
+ gl_FragColor = vec4(0, 1, 0, 1) + 2. * varA * 2.;
+}
+</script>
+
+<script id="shader-fs-mutable" type="x-shader/x-fragment">
+precision mediump float;
+varying float varA;
+void main(void) {
+ float b = varA;
+ if (varA < (b -= 1.) || (varA < b && varA > (b += 2.))) {
+ discard;
+ }
+ gl_FragColor = vec4(0, 1, 0, 1) + 2. * varA * 2.;
+}
+</script>
+<script id="shader-fs-unfolded" type="x-shader/x-fragment">
+precision mediump float;
+varying float varA;
+void main(void) {
+ bool s1 = varA < -1.;
+ if (!s1) {
+ bool s2 = varA < -1.;
+ if (s2) {
+ s2 = varA > 1.;
+ }
+ s1 = s2;
+ }
+ if (s1) {
+ discard;
+ }
+ gl_FragColor = vec4(0, 1, 0, 1) + 2. * varA * 2.;
+}
+</script>
+<script>
+"use strict";
+
+description();
+debug("");
+debug("If things are working correctly, then there will be a green square.");
+debug("Otherwise it will be a black void.");
+debug("This is a repro for an issue seen on the D3D9 ANGLE implementation of WebGL on Chrome in a shader with a conditional discard, where the conditional is of the form (a || (b && c)).");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("repro");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ gl.clearColor(0.0, 0.0, 0.0, 1.0);
+ wtu.setupUnitQuad(gl);
+
+ debug("");
+ debug("Testing shader with conditional discard");
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ var program = wtu.setupProgram(gl, ["shader-vs", "shader-fs"], ["pos"], undefined, true);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 128, 128, 128, 128, [ 0, 255, 0, 255 ], "should be green", 1);
+
+ debug("");
+ debug("Testing conditional discard with side-effects in conditions");
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ var programMutable = wtu.setupProgram(gl, ["shader-vs", "shader-fs-mutable"], ["pos"], undefined, true);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 128, 128, 128, 128, [ 0, 255, 0, 255 ], "should be green", 1);
+
+ debug("");
+ debug("Testing conditional discard with unfolded condition logic");
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ var programMutable = wtu.setupProgram(gl, ["shader-vs", "shader-fs-unfolded"], ["pos"], undefined, true);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 128, 128, 128, 128, [ 0, 255, 0, 255 ], "should be green", 1);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-texture-fetch.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-texture-fetch.html
new file mode 100644
index 0000000000..f382b8c800
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/conditional-texture-fetch.html
@@ -0,0 +1,130 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Conditional texture fetch 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="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<canvas id="output" style="border: none;" width="64" height="64"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshaderConditionalTextureFetch" type="x-shader/x-vertex">
+attribute vec2 a_position;
+attribute vec4 a_canvasTileColor;
+attribute vec2 a_texCoord;
+varying vec2 texCoord;
+varying vec4 canvasTileColor;
+void main()
+{
+ canvasTileColor = a_canvasTileColor;
+ texCoord = a_texCoord;
+ gl_Position = vec4(a_position, 0.0, 1.0);
+}
+</script>
+<script id="fshaderConditionalTextureFetch" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 canvasTileColor;
+uniform bool hasTexture;
+uniform sampler2D canvasTileTexture;
+varying vec2 texCoord;
+uniform vec4 uvRect;
+void main()
+{
+ vec4 finalColor = canvasTileColor;
+ if (hasTexture) {
+ vec2 clampedUV = clamp(texCoord.xy, uvRect.xy, uvRect.zw);
+ finalColor = texture2D(canvasTileTexture, clampedUV);
+ }
+ gl_FragColor = finalColor;
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description();
+debug("If the test passes correctly the viewport will be green.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("output");
+var gl = wtu.create3DContext(canvas);
+
+var createGreenTexture = function() {
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ 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);
+ wtu.fillTexture(gl, texture, 1, 1, [0, 255, 0, 255]);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ return texture;
+};
+
+var test = function(greenTexture) {
+ // This is a reduced test case for a problem reported by Figma.
+ // Program compilation produces the following warning/error on ANGLE's
+ // D3D9 backend:
+ // [WARNING:angle_platform_impl.cc(51)] : rx::HLSLCompiler::compileToBinary(228): C:\fakepath(26,12): error X6077: texld/texldb/texldp/dsx/dsy instructions with r# as source cannot be used inside dynamic conditional 'if' blocks, dynamic conditional subroutine calls, or loop/rep with break*.
+ //
+ // All of the operations in the shader -- including the clamping of the
+ // texture coordinates -- seem to be needed in order to provoke this
+ // error.
+ //
+ // However, this doesn't seem to produce incorrect rendering results.
+ var program = wtu.setupProgram(
+ gl,
+ ["vshaderConditionalTextureFetch",
+ "fshaderConditionalTextureFetch"],
+ ["a_position", "a_canvasTileColor", "a_texCoord"],
+ [0, 1, 2],
+ true);
+ if (!program) {
+ testFailed("Shader compilation/link failed");
+ } else {
+ // Set up buffers
+ wtu.setupUnitQuad(gl, 0, 2);
+
+ // Set up constant color (red)
+ gl.vertexAttrib4f(1, 1, 0, 0, 1);
+
+ var uniformMap = wtu.getUniformMap(gl, program);
+
+ // Use texturing
+ gl.uniform1i(uniformMap["hasTexture"].location, 1);
+
+ // Bind texture
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, greenTexture);
+ gl.uniform1i(uniformMap["canvasTileTexture"].location, 0);
+
+ // Set up (essentially no-op) clamp rectangle
+ gl.uniform4f(uniformMap["uvRect"].location, 0, 0, 0.25, 0.25);
+
+ // Draw
+ wtu.clearAndDrawUnitQuad(gl);
+
+ // Verify output
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 1);
+ }
+};
+
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ var tex = createGreenTexture();
+ test(tex);
+}
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html
new file mode 100644
index 0000000000..d3628862bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/constant-precision-qualifier.html
@@ -0,0 +1,115 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Bug - the precision qualifier of a constant variable should affect the precision of a consuming operation</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader" type="x-shader/x-fragment">
+// It is assumed that uTest is set to 0. It's here to make the expression not constant.
+uniform mediump float uTest;
+
+void main() {
+ // exact representation of 4096.5 requires 13 bits of relative precision.
+ const highp float c = 4096.5;
+ mediump float a = 0.0;
+ // Below, addition should be evaluated at highp, since one of the operands has the highp qualifier.
+ // Thus fract should also be evaluated at highp.
+ // See OpenGL ES Shading Language spec section 4.5.2.
+ // This should make the result 0.5, since highp provides at least 16 bits of relative precision.
+ // (exceptions for operation precision are allowed for a small number of computationally
+ // intensive built-in functions, but it is reasonable to think that fract is not one of those).
+ // However, if fract() is incorrectly evaluated at minimum precision fulfilling mediump criteria,
+ // or at IEEE half float precision, the result is 0.0.
+ a = fract(c + uTest);
+
+ // Multiply by 2.0 to make the color green.
+ gl_FragColor = vec4(0.0, 2.0 * a, 0.0, 1.0);
+}
+</script>
+<script id="fshaderNoConstants" type="x-shader/x-fragment">
+// This shader has the same functionality as the one above, but it doesn't contain
+// operations that can be constant folded at compile-time.
+// It's here to provide a point of comparison.
+uniform mediump float uTest;
+uniform highp float uTestHigh;
+
+void main() {
+ highp float c = 4096.5 + uTestHigh;
+ mediump float a = 0.0;
+ a = fract(c + uTest);
+ gl_FragColor = vec4(0.0, 2.0 * a, 0.0, 1.0);
+}
+</script>
+<script id="fshaderAllHighp" type="x-shader/x-fragment">
+// This shader has the same functionality as the one above, but it only uses highp.
+// It's here to provide a point of comparison.
+uniform highp float uTest;
+
+void main() {
+ highp float c = 4096.5 + uTest;
+ highp float a = 0.0;
+ a = fract(c + uTest);
+ gl_FragColor = vec4(0.0, 2.0 * a, 0.0, 1.0);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description();
+
+function test() {
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext();
+ if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+ return;
+ }
+ if (gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision == 0) {
+ testPassed("highp precision not supported");
+ finishTest();
+ } else {
+ GLSLConformanceTester.runRenderTests([
+ {
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'The precision qualifier of a constant affects built-in function results',
+ uniforms: [{name: "uTest", functionName: "uniform1f", value: 0}]
+ },
+ {
+ fShaderId: 'fshaderNoConstants',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'The precision qualifier of a variable affects built-in function results',
+ uniforms: [{name: "uTest", functionName: "uniform1f", value: 0},
+ {name: "uTestHigh", functionName: "uniform1f", value: 0}]
+ },
+ {
+ fShaderId: 'fshaderAllHighp',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'All variables are qualified as highp',
+ uniforms: [{name: "uTest", functionName: "uniform1f", value: 0}]
+ },
+ ]);
+ }
+};
+
+test();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html
new file mode 100644
index 0000000000..47e58c5c92
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/essl3-shaders-with-webgl1.html
@@ -0,0 +1,138 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Browser bug - WebGL 1 context should not accept OpenGL ES 3 shading language shaders</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="ES1VertexShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+
+void main() {
+ gl_Position = aPosition;
+}
+</script>
+<script id="ES1FragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<!-- Note that the version directive should be on the very first line in ESSL 3, see ESSL 3 section 3.3 -->
+<script id="ES3VertexShader" type="x-shader/x-vertex">#version 300 es
+precision mediump float;
+in vec4 aPosition;
+
+void main() {
+ gl_Position = aPosition;
+}
+</script>
+<script id="ES3FragmentShader" type="x-shader/x-fragment">#version 300 es
+precision mediump float;
+out vec4 my_FragColor;
+
+void main() {
+ my_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script id="emptyES3FragmentShader" type="x-shader/x-fragment">#version 300 es
+precision mediump float;
+void main() {
+}
+</script>
+<script id="vertexShaderWithInQualifier" type="x-shader/x-vertex">
+precision mediump float;
+in vec4 aPosition;
+
+void main() {
+ gl_Position = aPosition;
+}
+</script>
+<script id="fragmentShaderWithOutQualifier" type="x-shader/x-fragment">
+precision mediump float;
+out vec4 my_FragColor;
+
+void main() {
+ my_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description("OpenGL ES 3 shading language shaders should not be accepted by WebGL 1.");
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "ES3VertexShader",
+ vShaderSuccess: false,
+ fShaderId: "ES1FragmentShader",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "OpenGL ES 3 shading language vertex shader with an in variable should not be accepted by WebGL 1."
+ },
+ {
+ vShaderId: "ES1VertexShader",
+ vShaderSuccess: true,
+ fShaderId: "ES3FragmentShader",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "OpenGL ES 3 shading language fragment shader with an out variable should not be accepted by WebGL 1."
+ },
+ {
+ vShaderId: "ES1VertexShader",
+ vShaderSuccess: true,
+ fShaderId: "emptyES3FragmentShader",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "OpenGL ES 3 shading language fragment shader with an empty body should not be accepted by WebGL 1."
+ },
+ {
+ vShaderId: "ES3VertexShader",
+ vShaderSuccess: false,
+ fShaderId: "ES3FragmentShader",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "OpenGL ES 3 shading language shaders should not be linked by WebGL 1."
+ },
+ {
+ vShaderId: "ES3VertexShader",
+ vShaderSuccess: false,
+ fShaderId: "emptyES3FragmentShader",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "OpenGL ES 3 shading language shaders including fragment shader with empty body should not be linked by WebGL 1."
+ },
+ {
+ vShaderId: "vertexShaderWithInQualifier",
+ vShaderSuccess: false,
+ fShaderId: "ES1FragmentShader",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "Vertex shader with an in qualifier on a global variable should not be accepted by WebGL 1."
+ },
+ {
+ vShaderId: "ES1VertexShader",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderWithOutQualifier",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Fragment shader with an out qualifier on a global variable should not be accepted by WebGL 1."
+ }
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html
new file mode 100644
index 0000000000..69a019aa1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floor-div-cos-should-not-truncate.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Floor + divide + cosine should not truncate intermediate results.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="vshader" type="x-shader/x-vertex">
+precision highp float;
+
+attribute vec3 pos;
+
+// This divisor must be greater than the 32-bit floating point
+// representation of 1e6 / (2 * pi) to repro.
+const float magic = 159154.953125;
+
+void main(void) {
+ // This floor must be present to repro.
+ float x = floor(pos.x);
+
+ // This divide and cosine must be present to repro.
+ x = cos(x / magic);
+
+ // If the GPU truncated 'x / magic' to 0, then 'cos(x / magic)' will produce
+ // 1.0, the green square will be moved offscreen, and the red background
+ // will be visible.
+ gl_Position.x = pos.y + x * 2.0;
+ gl_Position.y = pos.z;
+ gl_Position.z = 0.0;
+ gl_Position.w = 1.0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision highp float;
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+</script>
+
+<script type="application/javascript">
+"use strict";
+description("Flooring a number, then dividing by a large number, then computing the cosine of that should not truncate the intermediate values.");
+debug("Regression test for <a href='https://code.google.com/p/angleproject/issues/detail?id=1179'>https://code.google.com/p/angleproject/issues/detail?id=1179</a>");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos'], undefined, true);
+
+gl.clearColor(1, 0, 0, 1);
+gl.clear(gl.COLOR_BUFFER_BIT);
+
+var magic = 159154.953125;
+var x = (Math.PI / 2.0) * magic;
+var data = [
+ x, -1, -1,
+ x, 1, -1,
+ x, 1, 1,
+ x, -1, -1,
+ x, 1, 1,
+ x, -1, 1
+];
+
+gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 12, 0);
+
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+wtu.checkCanvas(gl, [0,255,0,255], "should be 0,255,0,255");
+finishTest();
+</script>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html
new file mode 100644
index 0000000000..6986344d3a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/floored-division-accuracy.html
@@ -0,0 +1,69 @@
+<!--
+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: Bill Baxter (wbaxter at google.com) -->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Floored Division Accuracy Bug</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="shader-vs" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+uniform float divisor;
+varying vec4 vColor;
+void main(void) {
+ gl_Position = vPosition;
+ float index = 9.0;
+ // Floating point operations don't have any guaranteed precision, but they
+ // should at least be accurate to 1 part in 10^5.
+ float value = floor((index / divisor) * 1.00001);
+ vColor = (value == 3.) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+</script>
+
+<script id="shader-fs" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 vColor;
+void main(void) {
+ gl_FragColor = vColor;
+}
+</script>
+<script>
+"use strict";
+description();
+
+debug("");
+// Reproduces bug seen on Mac OS X with AMD Radeon HD 6490 GPU
+debug("If things are working correctly, then the square will be green.");
+debug("If your card thinks floor(9. / 3.) is not 3 to within 1 part in 10^5, ");
+debug("then the square will be red.");
+
+GLSLConformanceTester.runRenderTests([
+{
+ vShaderId: 'shader-vs',
+ vShaderSuccess: true,
+ fShaderId: 'shader-fs',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Test that floor(9. / 3.) is 3 to within 1 part in 10^5',
+ uniforms: [{name: "divisor", functionName: "uniform1f", value: 3}]
+}
+]);
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html
new file mode 100644
index 0000000000..f22632c0a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/fragcoord-linking-bug.html
@@ -0,0 +1,93 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL compiler bug referencing gl_FragCoord</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<!-- These shaders were extracted from Skia's GPU accelerated backend "Ganesh". -->
+<script id="shader-vs" type="x-shader/x-vertex">
+uniform mat3 uViewM;
+uniform mat3 uStageMatrix_Stage1;
+uniform vec4 urtAdjustment;
+attribute vec2 aPosition;
+attribute vec4 aColor;
+varying vec4 vColor;
+varying vec2 vMatrixCoord_Stage1;
+void main() {
+ vec3 pos3 = uViewM * vec3(aPosition, 1);
+ vColor = aColor;
+ { // Stage 0: XferEffect
+ }
+ vMatrixCoord_Stage1 = (uStageMatrix_Stage1 * vec3(aPosition, 1)).xy;
+ { // Stage 1: Texture
+ }
+ gl_Position = vec4(dot(pos3.xz, urtAdjustment.xy), dot(pos3.yz, urtAdjustment.zw), 0, pos3.z);
+}
+</script>
+
+<script id="shader-fs" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D uDstCopySampler;
+uniform vec2 uDstCopyUpperLeft;
+uniform vec2 uDstCopyCoordScale;
+uniform float uRTHeight;
+uniform sampler2D uSampler0_Stage1;
+varying vec4 vColor;
+varying vec2 vMatrixCoord_Stage1;
+void main() {
+ vec4 fragCoordYDown = vec4(gl_FragCoord.x, uRTHeight - gl_FragCoord.y, gl_FragCoord.zw);
+ // Read color from copy of the destination.
+ vec2 _dstTexCoord = (fragCoordYDown.xy - uDstCopyUpperLeft) * uDstCopyCoordScale;
+ _dstTexCoord.y = 1.0 - _dstTexCoord.y;
+ vec4 _dstColor = texture2D(uDstCopySampler, _dstTexCoord);
+
+ vec4 output_Stage0;
+ { // Stage 0: XferEffect
+ // SkXfermode::Mode: Multiply
+ output_Stage0.a = vColor.a + (1.0 - vColor.a) * _dstColor.a;
+ output_Stage0.rgb = (1.0 - vColor.a) * _dstColor.rgb + (1.0 - _dstColor.a) * vColor.rgb + vColor.rgb * _dstColor.rgb;
+ }
+ vec4 output_Stage1;
+ { // Stage 1: Texture
+ output_Stage1 = texture2D(uSampler0_Stage1, vMatrixCoord_Stage1);
+ }
+ gl_FragColor = ((output_Stage0 * output_Stage1) + ((vec4(1) - output_Stage1) * _dstColor));
+}
+</script>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+description();
+debug("");
+debug('Verify shaders using gl_FragCoord z and w components compile and link correctly');
+debug('Regression test for Qualcomm bug ID CR649654');
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ var program = wtu.setupProgram(gl, ["shader-vs", "shader-fs"], null, null, true);
+ if (program) {
+ testPassed("Program compiled and linked successfully");
+ } else {
+ testFailed("Program failed to compile and link");
+ }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html
new file mode 100644
index 0000000000..ef1184d49f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/gl-fragcoord-multisampling-bug.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>gl_FragCoord multisampling bug</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="canvasHolder"></div>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main() {
+ gl_Position = vec4(a_position.xy, 1.0, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ float depth = gl_FragCoord.z / gl_FragCoord.w;
+ gl_FragColor = vec4( 0.0, depth, 0.0, 1.0 );
+}
+</script>
+
+<script type="application/javascript">
+"use strict";
+description("gl_FragCoord multisampling bug");
+debug("Verifies gl_FragCoord z/w values are unaffected by multisampling.");
+debug('Regression test for <a href="https://github.com/mrdoob/three.js/issues/7769">Three.js Issue 7769</a>');
+var wtu = WebGLTestUtils;
+for (var ii = 0; ii < 2; ++ii) {
+ debug("Testing " + (ii > 0 ? "with" : "without") + " multisampling");
+ var canvas = document.createElement('canvas');
+ canvas.width = 256;
+ canvas.height = 256;
+ canvas.style.padding = "2px";
+ document.getElementById('canvasHolder').appendChild(canvas);
+ var options;
+ if (ii > 0) {
+ options = { antialias: true };
+ }
+ var gl = wtu.create3DContext(canvas, options);
+
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var attribBuffers = wtu.setupUnitQuad(gl, 0, 1);
+ var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['a_position'], [0], true);
+ if (!program) {
+ testFailed("Shader compilation/link failed");
+ } else {
+ // Draw
+ wtu.drawUnitQuad(gl);
+ // Verify output
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 3);
+ }
+}
+
+finishTest();
+</script>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html
new file mode 100644
index 0000000000..b02622bb29
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/global-invariant-does-not-leak-across-shaders.html
@@ -0,0 +1,77 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Global invariant does not leak across shaders</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="InvariantVertex" type="x-shader/x-vertex">
+#pragma STDGL invariant(all)
+
+void main()
+{
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script id="Fragment" type="x-shader/x-fragment">
+precision mediump float;
+
+void main()
+{
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+</script>
+<script id="VertexWithVarying" type="x-shader/x-vertex">
+varying vec2 testVarying;
+
+void main() {
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+ testVarying = vec2(0.0, 0.0);
+}
+</script>
+<script id="FragmentWithVarying" type="x-shader/x-fragment">
+precision mediump float;
+varying vec2 testVarying;
+
+void main()
+{
+ gl_FragColor = vec4(testVarying, 0.0, 1.0);
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description("The use of the global invariant pragma in one shader must not affect other shaders.");
+
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "InvariantVertex",
+ vShaderSuccess: true,
+ fShaderId: "Fragment",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Shaders using global invariant pragma should compile and link."
+ },
+ {
+ vShaderId: "VertexWithVarying",
+ vShaderSuccess: true,
+ fShaderId: "FragmentWithVarying",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Shaders not using global invariant pragma should compile and link."
+ },
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/if-return-and-elseif.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/if-return-and-elseif.html
new file mode 100644
index 0000000000..4e88ae83be
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/if-return-and-elseif.html
@@ -0,0 +1,65 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>If with return and else if in fragment shader</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 pos;
+varying vec2 vPos;
+void main()
+{
+ gl_Position = pos;
+ vPos = pos.xy;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+varying vec2 vPos;
+void main()
+{
+ if(vPos.x < 1.0) // This colors the whole canvas green
+ {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ return;
+ }
+ else if(vPos.x < 1.1) // This should have no effect
+ {
+ gl_FragColor = vec4(1, 0, 0, 1);
+ }
+}
+
+</script>
+<script type="text/javascript">
+"use strict";
+description();
+
+// Minimal test case based on report at http://anglebug.com/2325
+
+GLSLConformanceTester.runRenderTests([
+{
+ vShaderId: 'vshader',
+ vShaderSuccess: true,
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "If and else if in fragment shader"
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/in-parameter-passed-as-inout-argument-and-global.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/in-parameter-passed-as-inout-argument-and-global.html
new file mode 100644
index 0000000000..77edd0ec3a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/in-parameter-passed-as-inout-argument-and-global.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Function in parameter passed as an inout argument and a global variable with the same name</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderParameters" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec3 u_zero;
+vec3 p;
+void G(inout vec3 q) {
+ p += q;
+}
+void F(in vec3 p) {
+ G(p);
+}
+void main(){
+ F(u_zero + vec3(0.0, 1.0, 0.0));
+ gl_FragColor = vec4(p, 1.0);
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description();
+
+// This is intended to test an issue seen on NVIDIA OpenGL drivers (at least up to version 388.59).
+// http://crbug.com/792210
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshaderParameters',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Function in parameter passed as an inout argument and a global variable with the same name"
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/init-array-with-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/init-array-with-loop.html
new file mode 100644
index 0000000000..2bd24765bd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/init-array-with-loop.html
@@ -0,0 +1,84 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Initializing an array with a loop 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="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderInitLoop" type="x-shader/x-fragment">
+precision mediump float;
+
+void initGlobals();
+
+uniform vec4 in0;
+vec4 out0;
+
+float func(float a[4]) {
+ a[0] = -1.0;
+ return a[0];
+}
+
+float arr[4];
+
+bool isOk(vec4 a) {
+ vec4 ref = -(in0 + 1.0);
+ if (abs(a.x - ref.x) < 0.05 && abs(a.y - ref.y) < 0.05 && abs(a.z - ref.z) < 0.05 && abs(a.w - ref.w) < 0.05)
+ {
+ return true;
+ }
+ return false;
+}
+
+void main() {
+ initGlobals();
+ arr[0] = in0.x + 1.0;
+ arr[1] = in0.y + 1.0;
+ arr[2] = in0.z + 1.0;
+ arr[3] = in0.w + 1.0;
+ mediump float f = func(arr);
+ out0 = f * vec4(arr[0], arr[1], arr[2], arr[3]);
+ if (isOk(out0))
+ {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ else
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+}
+
+void initGlobals() {
+ out0 = vec4(0.0, 0.0, 0.0, 0.0);
+ for (int i = 0; i < 4; ++i)
+ {
+ arr[i] = 0.0;
+ }
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description();
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshaderInitLoop',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Initialize a global array using a for loop"
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html
new file mode 100644
index 0000000000..d203731012
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html
@@ -0,0 +1,74 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Invariant does not leak across shaders</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="InvariantVertex" type="x-shader/x-vertex">
+varying vec4 v_varying;
+invariant v_varying;
+
+void main()
+{
+ gl_Position = v_varying;
+}
+</script>
+<script id="InvariantFragment" type="x-shader/x-fragment">
+precision mediump float;
+invariant varying vec4 v_varying;
+
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="VertexWithVarying" type="x-shader/x-vertex">
+varying vec4 v_varying;
+
+void main() {
+ gl_Position = v_varying;
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description("The use of the invariant qualifier in one shader must not affect other shaders.");
+
+debug("");
+debug("This is a deliberate subset of conformance/glsl/misc/shaders-with-invariance.html.");
+debug("Compared with the original tests, order of the tests is different.");
+debug("This test covers an ANGLE bug. See crbug.com/634813.");
+
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "InvariantVertex",
+ vShaderSuccess: true,
+ fShaderId: "InvariantFragment",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Shaders using invariant qualifier should compile and link."
+ },
+ {
+ vShaderId: "VertexWithVarying",
+ vShaderSuccess: true,
+ fShaderId: "InvariantFragment",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with variant varying and fragment shader with invariant varying must fail"
+ },
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html
new file mode 100644
index 0000000000..2bbac4dbd0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/logic-inside-block-without-braces.html
@@ -0,0 +1,86 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Short-circuiting logic operator with side effects inside if statement without braces should work</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderIf" type="x-shader/x-fragment">
+precision mediump float;
+uniform bool uFalse;
+
+float wrong = 0.0;
+
+bool foo() {
+ wrong += 1.0;
+ return !uFalse;
+}
+
+bool bar() {
+ return !uFalse;
+}
+
+void main() {
+ // No braces here - that can affect whether the contents of the if get parsed as a block or a statement.
+ if (uFalse)
+ foo() && bar();
+ gl_FragColor = vec4(0.0, 1.0 - wrong, 0.0, 1.0);
+}
+</script>
+<script id="fshaderFor" type="x-shader/x-fragment">
+precision mediump float;
+
+float wrong = 0.0;
+
+bool foo() {
+ wrong += 1.0;
+ return false;
+}
+
+bool bar() {
+ return false;
+}
+
+void main() {
+ // No braces here - that can affect whether the contents of the for get parsed as a block or a statement.
+ for (int i = 0; i < 0; ++i)
+ foo() && bar();
+ gl_FragColor = vec4(0.0, 1.0 - wrong, 0.0, 1.0);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description("Short-circuiting logic operator with side effects inside if/for statement without braces should work.");
+debug("");
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshaderIf',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Short-circuiting operator inside if statement without braces',
+ uniforms: [{name: "uFalse", functionName: "uniform1i", value: 0}]
+},
+{
+ fShaderId: 'fshaderFor',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Short-circuiting operator inside for statement without braces'
+}
+]);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html
new file mode 100644
index 0000000000..eaf0509b23
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/long-expressions-should-not-crash.html
@@ -0,0 +1,136 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Driver Bug - long experssions should not crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<canvas id="example" width="40" height="40"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+void main(){
+ gl_Position = vec4(0, 0, 0, 1);
+}
+</script>
+<script id="vshaderUniformTest" type="x-shader/x-vertex">
+uniform vec4 u_uniform;
+void main(){
+ gl_Position =
+ $(code)
+ vec4(0, 0, 0, 1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(0, 0, 0, 0);
+}
+</script>
+<script id="fshaderUniformTest" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_uniform;
+void main()
+{
+ gl_FragColor =
+ $(code)
+ vec4(0, 0, 0, 0);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+var vUniformTestSource = wtu.getScript("vshaderUniformTest");
+var fUniformTestSource = wtu.getScript("fshaderUniformTest");
+
+var tests = [
+];
+var counts = [
+ { count:10,
+ mustPass: true,
+ },
+ { count:100,
+ mustPass: true,
+ },
+ { count: 1000,
+ mustPass: false,
+ },
+ { count: 10000,
+ mustPass: false,
+ },
+];
+var operatorSets = [
+ ["+", "-", "/", "*"],
+ ["+"],
+ ["-"],
+];
+counts.forEach(function(info) {
+ operatorSets.forEach(function(operators) {
+ var generateCode = function(numVars) {
+ var codes = [];
+ for (var uu = 0; uu < numVars; ++uu) {
+ codes.push("u_uniform " + operators[uu % operators.length]);
+ }
+ return {
+ code: codes.join("\n "),
+ };
+ };
+
+ var subs = generateCode(info.count);
+ tests.push({
+ vShaderId: "vshader",
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fUniformTestSource, subs),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: !info.mustPass,
+ passMsg: "shader with " + info.count + " [" + operators + "] operators in expression in multiple lines",
+ });
+ tests.push({
+ vShaderSource: wtu.replaceParams(vUniformTestSource, subs),
+ vShaderSuccess: true,
+ fShaderId: "fshader",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: !info.mustPass,
+ passMsg: "shader with " + info.count + " [" + operators + "] operators in expression in multiple lines",
+ });
+ subs.code = subs.code.replace(/\n /g, "")
+ tests.push({
+ vShaderId: "vshader",
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fUniformTestSource, subs),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: !info.mustPass,
+ passMsg: "shader with " + info.count + " [" + operators + "] operators in expression in one line",
+ });
+ tests.push({
+ vShaderSource: wtu.replaceParams(vUniformTestSource, subs),
+ vShaderSuccess: true,
+ fShaderId: "fshader",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: !info.mustPass,
+ passMsg: "shader with " + info.count + " [" + operators + "] operators in expression in one line",
+ });
+ });
+});
+GLSLConformanceTester.runTests(tests);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html
new file mode 100644
index 0000000000..914604ad07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/loop-if-loop-gradient.html
@@ -0,0 +1,75 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Gradient loop in if in loop crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script id='vshader' type='x-shader/x-vertex'>
+precision highp float;
+void main() {
+gl_Position = vec4( 1.0, 1.0, 1.0, 1.0 );
+}
+</script>
+<script id='fshader' type='x-shader/x-fragment'>
+precision mediump float;
+uniform lowp sampler2D iChannel0;
+
+void main(){
+ highp float c;
+ for (mediump float i = 0.0; i <= 1.0; i++) {
+ if (gl_FragCoord.x < 0.0) {
+ for (mediump float l = 0.0; l < 2.0; l++) { // with 1 as a bound it works
+ c = texture2D(iChannel0, vec2(l), 0.0).x;
+ }
+ }
+ }
+ gl_FragColor = vec4(c, vec3(1.0));
+}
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test checks an ANGLE regression that was caused by a complex ShaderToy shader. <a href='https://code.google.com/p/chromium/issues/detail?id=524297'>crbug.com/524297</a>");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+gl.canvas.addEventListener("webglcontextlost", function(e) {
+ testFailed("WebGL context lost");
+});
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+ debug("");
+
+ var program = wtu.setupProgram(gl, ['vshader', 'fshader']);
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
+ testFailed("Program failed to link");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+// Cycle through a rAF once to give any webglcontextlost events a chance to propagate
+window.requestAnimationFrame(function() { finishTest(); });
+
+debug("");
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html
new file mode 100644
index 0000000000..6e39f69ab7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/modulo-arithmetic-accuracy.html
@@ -0,0 +1,68 @@
+<!--
+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: Bill Baxter (wbaxter at google.com) -->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Modulo Arithmetic Accuracy Bug</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="shader-vs" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+uniform float divisor;
+varying vec4 vColor;
+void main(void) {
+ gl_Position = vPosition;
+ float index = 9.0;
+ // mod(x, y) is computed as x-y*floor(x/y). There are no guarantees on
+ // the precision of floating point operations in WebGL shaders, but division
+ // should be accurate to at least 1 part in 10^5.
+ float value = mod(index * 1.00001, divisor);
+ vColor = (value < 1.) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+</script>
+
+<script id="shader-fs" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 vColor;
+void main(void) {
+ gl_FragColor = vColor;
+}
+</script>
+<script>
+"use strict";
+
+description();
+debug("");
+// Reproduces bug seen on Mac OS X with AMD Radeon HD 6490 GPU
+debug("If things are working correctly, then the square will be green.");
+debug("If your card thinks mod(9,3) is not 0, then the square will be red.");
+
+GLSLConformanceTester.runRenderTests([
+{
+ vShaderId: 'shader-vs',
+ vShaderSuccess: true,
+ fShaderId: 'shader-fs',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Test that mod(9/3) is 0',
+ uniforms: [{name: "divisor", functionName: "uniform1f", value: 3}]
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html
new file mode 100644
index 0000000000..cb157cdec6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/multiplication-assignment.html
@@ -0,0 +1,50 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Multiplication assignment operator compilation bug</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform mat3 rot;
+float foo(vec3 bar) {
+ bar *= rot;
+ return 0.0;
+}
+
+void main(void){
+ gl_FragColor = vec4(foo(vec3(0)));
+}
+</script>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+description();
+debug("");
+debug('Verify multiplication assignment operator compiles correctly - regression test for <a href="https://code.google.com/p/chromium/issues/detail?id=384847">Chromium bug 384847</a>');
+
+GLSLConformanceTester.runTests([
+{
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vec3 *= mat3 multiplication assignment operator",
+}
+]);
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html
new file mode 100644
index 0000000000..130f0a0e4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-functions-should-not-crash.html
@@ -0,0 +1,89 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Driver Bug - nested functions should not crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<canvas id="example" width="40" height="40"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+void main(){
+ gl_Position = vec4(0, 0, 0, 1);
+}
+</script>
+<script id="fshaderUniformTest" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_uniform;
+
+$(code)
+
+void main()
+{
+ gl_FragColor = function0();
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+var fUniformTestSource = wtu.getScript("fshaderUniformTest");
+
+var tests = [
+];
+var counts = [
+ { count:10,
+ mustPass: true,
+ },
+ { count:100,
+ mustPass: false,
+ },
+ { count: 1000,
+ mustPass: false,
+ },
+ { count: 10000,
+ mustPass: false,
+ },
+];
+var operators = ["+", "-", "/", "*"];
+counts.forEach(function(info) {
+ var generateCode = function(numVars) {
+ var codes = [];
+ codes.push("vec4 function" + numVars + "() { return u_uniform; }");
+ for (var uu = 0; uu < numVars; ++uu) {
+ var id = numVars - uu - 1;
+ codes.push("vec4 function" + id + "() { return function" + (id + 1) + "(); }");
+ }
+ return {
+ code: codes.join("\n\n"),
+ };
+ };
+
+ var subs = generateCode(info.count);
+ tests.push({
+ vShaderId: "vshader",
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fUniformTestSource, subs),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: !info.mustPass,
+ passMsg: "shader with " + info.count + " nested functions",
+ });
+});
+GLSLConformanceTester.runTests(tests);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html
new file mode 100644
index 0000000000..d6a744741a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-loops-with-break-and-continue.html
@@ -0,0 +1,83 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Using nested loops with break and/or continue statements in a fragment shader should work</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform int uCount;
+
+void main() {
+ int a = 0;
+ for (int i = 0; i < 10; ++i) {
+ if (i >= uCount) { break; }
+ for (int j = 0; j < 10; ++j) {
+ if (j >= uCount) { continue; }
+ a += 1;
+ }
+ for (int j = 0; j < 10; ++j) {
+ if (j >= uCount) { break; }
+ a += 1;
+ }
+ for (int j = 0; j < 10; ++j) {
+ if (j >= uCount) { continue; }
+ a += 1;
+ }
+ for (int j = 0; j < 10; ++j) {
+ if (j >= uCount) { break; }
+ a += 1;
+ }
+ for (int j = 0; j < 10; ++j) {
+ if (j >= uCount) { continue; }
+ a += 1;
+ }
+ }
+ float b = (float(a) / 125.0) * (64.0 / 255.0);
+ gl_FragColor = vec4(b, 1.0 - b, 0.0, 1.0);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description("Multiple loops using break and continue statements should work.");
+debug("");
+var wtu = WebGLTestUtils;
+function test() {
+ var gl = wtu.create3DContext("canvas");
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ wtu.setupUnitQuad(gl);
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["aPosition"], undefined, true);
+ var uniformLoc = gl.getUniformLocation(program, 'uCount');
+ gl.uniform1i(uniformLoc, 5);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [64, 191, 0, 255], "should be 64,191,0,255");
+};
+
+test();
+finishTest();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html
new file mode 100644
index 0000000000..b202b854ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/nested-sequence-operator.html
@@ -0,0 +1,47 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Nested sequence operator</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderNestedSequenceOperator" type="x-shader/x-fragment">
+precision mediump float;
+// Note that keep_flop_positive is expected to keep its default value false.
+uniform bool keep_flop_positive;
+float flop;
+void main()
+{
+ flop = -1.0,
+ (flop *= -1.0,
+ keep_flop_positive ? 0.0 : flop *= -1.0),
+ gl_FragColor = vec4(0, -flop, 0, 1);
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description("Test a nested sequence operator with a ternary operator inside. The ternary operator needs to be converted into an if statement on a HLSL based WebGL backend, which makes this case tricky.");
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshaderNestedSequenceOperator',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Nested sequence operator is evaluated in the expected order."
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html
new file mode 100644
index 0000000000..d5fa55b898
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-of-small-constant-in-user-defined-function.html
@@ -0,0 +1,74 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Bug - calculating powers of constants smaller than 1.0e-5 in user-defined functions should work</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision highp float;
+
+float fun(float arg) {
+ // These values are still easily within the highp range.
+ // The minimum range in terms of 10's exponent is around -19 to 19, and IEEE-754 single precision range is higher than that.
+ return 1.0e12 * pow(arg, 2.0);
+}
+
+void main() {
+ // Note that the bug did not reproduce if an uniform was passed to the function instead of a constant,
+ // or if the expression was moved outside the user-defined function.
+ const float a = 1.0e-6;
+ float b = fun(a);
+ if (abs(b - 1.0) < 0.01) {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); // green
+ } else {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); // red
+ }
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description();
+debug("");
+var wtu = WebGLTestUtils;
+function test() {
+ var gl = wtu.create3DContext("canvas");
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ if (gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision == 0) {
+ testPassed("highp precision not supported");
+ } else {
+ wtu.setupUnitQuad(gl);
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["aPosition"], undefined, true);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 0, 0, 256, 256, [0, 255, 0, 255]);
+ }
+};
+
+test();
+finishTest();
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html
new file mode 100644
index 0000000000..8e95842b12
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/pow-with-constant-exponent-should-not-crash.html
@@ -0,0 +1,65 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Bug - pow() with constant vector exponent should not crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderTest" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ // pow() with a constant vector exponent may cause a crash on NVIDIA 331 series OpenGL drivers
+ vec2 v = pow(gl_FragCoord.xy, vec2(2.0));
+ float y = pow(v, vec2(0.45, 0.5)).y;
+ gl_FragColor = vec4(0.0, 1.0 + y - gl_FragCoord.y, 0.0, 1.0);
+}
+</script>
+<script id="fshaderNestedTest" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ // pow() with a constant vector exponent may cause a crash on NVIDIA 331 series OpenGL drivers
+ // workarounds for this should work even if problematic pow() statements are nested within
+ // each other.
+ float y = pow(pow(gl_FragCoord.xy, vec2(2.0)), vec2(0.45, 0.5)).y;
+ gl_FragColor = vec4(0.0, 1.0 + y - gl_FragCoord.y, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+
+// This test has quite a lot of tolerance since pow() doesn't have explicit precision requirements
+// in ESSL1, and in ESSL3 the limits are very loose.
+GLSLConformanceTester.runRenderTests([
+ {
+ fShaderId: "fshaderTest",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ renderTolerance: 20,
+ passMsg: "shader with pow() with a constant vector exponent should not crash",
+ },
+ {
+ fShaderId: "fshaderNestedTest",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ renderTolerance: 20,
+ passMsg: "shader with nested pow() calls with constant vector exponents should not crash",
+ }
+]);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html
new file mode 100644
index 0000000000..f1ef1e47ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-crash.html
@@ -0,0 +1,136 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Qualcomm program link crash Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script id='vshader1' type='x-shader/x-vertex'>
+precision highp float;
+void main() {
+gl_Position = vec4( 1.0, 1.0, 1.0, 1.0 );
+}
+</script>
+<script id='fshader1' type='x-shader/x-fragment'>
+precision highp float;
+uniform int renderType;
+uniform sampler2D texMap;
+void main() {
+ vec2 uv = vec2(0.0, 0.0);
+ if( renderType == 0 ) {
+ gl_FragColor = texture2D( texMap, uv );
+ } else {
+ vec4 texture = texture2D( texMap, uv );
+ gl_FragColor = texture;
+ }
+}
+</script>
+
+<script id='vshader2' type='x-shader/x-vertex'>
+attribute vec3 vertex_position;
+uniform mat4 matrix_model;
+uniform mat4 matrix_viewProjection;
+
+attribute vec4 vertex_boneWeights;
+attribute vec4 vertex_boneIndices;
+
+uniform sampler2D texture_poseMap;
+uniform vec2 texture_poseMapSize;
+
+mat4 getBoneMatrix(const in float i)
+{
+ float j = i * 4.0;
+ float x = mod(j, float(texture_poseMapSize.x));
+ float y = floor(j / float(texture_poseMapSize.x));
+
+ float dx = 1.0 / float(texture_poseMapSize.x);
+ float dy = 1.0 / float(texture_poseMapSize.y);
+
+ y = dy * (y + 0.5);
+
+ vec4 v1 = texture2D(texture_poseMap, vec2(dx * (x + 0.5), y));
+ vec4 v2 = texture2D(texture_poseMap, vec2(dx * (x + 1.5), y));
+ vec4 v3 = texture2D(texture_poseMap, vec2(dx * (x + 2.5), y));
+ vec4 v4 = texture2D(texture_poseMap, vec2(dx * (x + 3.5), y));
+
+ mat4 bone = mat4(v1, v2, v3, v4);
+
+ return bone;
+}
+
+void main(void)
+{
+ mat4 modelMatrix = vertex_boneWeights.x * getBoneMatrix(vertex_boneIndices.x) +
+ vertex_boneWeights.y * getBoneMatrix(vertex_boneIndices.y) +
+ vertex_boneWeights.z * getBoneMatrix(vertex_boneIndices.z) +
+ vertex_boneWeights.w * getBoneMatrix(vertex_boneIndices.w);
+
+ vec4 positionW = modelMatrix * vec4(vertex_position, 1.0);
+ gl_Position = matrix_viewProjection * positionW;
+
+}
+</script>
+<script id='fshader2' type='x-shader/x-fragment'>
+precision highp float;
+void main() {
+ gl_FragColor = vec4( 1.0, 1.0, 1.0, 1.0 );
+}
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test checks a known bug in some Qualcomm drivers which causes crashes when linking certain shaders. <a href='https://code.google.com/p/chromium/issues/detail?id=498947'>crbug.com/498947</a>");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+gl.canvas.addEventListener("webglcontextlost", function(e) {
+ testFailed("WebGL context lost");
+});
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+ debug("");
+
+ if (gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision == 0) {
+ testPassed("highp precision not supported");
+ } else {
+ var program1 = wtu.setupProgram(gl, ['vshader1', 'fshader1']);
+ if (!gl.getProgramParameter(program1, gl.LINK_STATUS)) {
+ testFailed("Program failed to link");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+ debug("");
+
+ var program2 = wtu.setupProgram(gl, ['vshader2', 'fshader2']);
+ if (!gl.getProgramParameter(program2, gl.LINK_STATUS)) {
+ testFailed("Program failed to link");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ }
+}
+
+// Cycle through a rAF once to give any webglcontextlost events a chance to propagate
+window.requestAnimationFrame(function() { finishTest(); });
+
+debug("");
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html
new file mode 100644
index 0000000000..ff94c52268
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/qualcomm-loop-with-continue-crash.html
@@ -0,0 +1,71 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Qualcomm loop with continue crash 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 id='vshader1' type='x-shader/x-vertex'>
+void main ()
+{
+}
+</script>
+<script id='fshader1' type='x-shader/x-fragment'>
+void main ()
+{
+ int count1 = 0, count2 = 0;
+ for(int i=0;i<4;i++)
+ {
+ if(count1 == 2)
+ continue;
+ }
+}
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test exercises a crash on Adreno 300 series GPUs when compiling certain loop constructs. <a href='https://code.google.com/p/chromium/issues/detail?id=527761'>crbug.com/527761</a>");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+gl.canvas.addEventListener("webglcontextlost", function(e) {
+ testFailed("WebGL context lost");
+});
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+ debug("");
+
+ var program1 = wtu.setupProgram(gl, ['vshader1', 'fshader1']);
+ if (!gl.getProgramParameter(program1, gl.LINK_STATUS)) {
+ testFailed("Program failed to link");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+ debug("");
+}
+
+// Cycle through a rAF once to give any webglcontextlost events a chance to propagate
+window.requestAnimationFrame(function() { finishTest(); });
+
+debug("");
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-struct-function-arg.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-struct-function-arg.html
new file mode 100644
index 0000000000..b39179a186
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-struct-function-arg.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL struct containing an array of samplers passed into a user-defined function</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+
+<canvas id="output" style="border: none;" width="64" height="64"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderSampler" type="x-shader/x-fragment">
+precision mediump float;
+
+struct S {
+ sampler2D sam[2];
+};
+
+uniform S uni;
+
+vec4 useSampler(S arg)
+{
+ return texture2D(arg.sam[0], vec2(0.0, 0.0));
+}
+
+void main() {
+ gl_FragColor = vec4(useSampler(uni));
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("output");
+var gl = wtu.create3DContext(canvas);
+
+if (!gl) {
+ testFailed("Could not create a GL context.");
+} else {
+ debug("Drawing with a shader that uses a sampler array in a struct passed into a function.");
+ var program = wtu.setupProgram(
+ gl, [wtu.simpleVertexShader, 'fshaderSampler'], ['a_position'], [0], true);
+ wtu.setupUnitQuad(gl);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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);
+ wtu.fillTexture(gl, tex, 1, 1, [0, 255, 0, 255]);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html
new file mode 100644
index 0000000000..c5707a1f89
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-array-using-loop-index.html
@@ -0,0 +1,81 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Sampler arrays using loop index should compile fine.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D uni[2];
+
+float zero(int x)
+{
+ return float(x) - float(x);
+}
+
+void main()
+{
+ vec4 c = vec4(0,0,0,0);
+ for (int ii = 1; ii < 3; ++ii) {
+ if (c.x > 255.0) {
+ c.x = 255.0 + zero(ii);
+ break;
+ }
+ c += texture2D(uni[ii - 1], vec2(0.5, 0.5));
+ }
+ gl_FragColor = c;
+}
+</script>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+//------------------------------------------------------------------------------
+var program = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition'], undefined, true);
+
+for (var ii = 0; ii < 2; ++ii) {
+ var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
+ gl.activeTexture(gl.TEXTURE0 + ii);
+ var tex = gl.createTexture();
+ wtu.fillTexture(gl, tex, 1, 1, [32, 16, 8, ii * 9], 0);
+ gl.uniform1i(loc, ii);
+}
+
+wtu.clearAndDrawUnitQuad(gl);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.checkCanvas(gl, [64, 32, 16, 9],
+ "Should render correctly", 1);
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html
new file mode 100644
index 0000000000..f2bc755444
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sampler-struct-function-arg.html
@@ -0,0 +1,113 @@
+<!--
+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.
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Passing a struct containing a sampler to a function.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+
+<body>
+<canvas id="output" style="border: none;" width="64" height="64"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="shader-fs" type="x-shader/x-fragment">
+ precision mediump float;
+
+ struct SomeStruct{
+ sampler2D source;
+ };
+
+ vec4 fun(SomeStruct s){
+ return texture2D(s.source, vec2(0.5));
+ }
+
+ uniform SomeStruct green;
+ void main(){
+ gl_FragColor = fun(green);
+ }
+</script>
+
+<script id="shader-fs-array" type="x-shader/x-fragment">
+ precision mediump float;
+
+ struct SomeStruct{
+ sampler2D source;
+ };
+
+ vec4 fun(SomeStruct s[2]){
+ return texture2D(s[0].source, vec2(0.5));
+ }
+
+ uniform SomeStruct green[2];
+ void main(){
+ gl_FragColor = fun(green);
+ }
+</script>
+
+<script>
+"use strict";
+
+description();
+debug("If the test passes correctly the viewport will be green.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("output");
+var gl = wtu.create3DContext(canvas);
+
+var textureGreen;
+
+var createGreenTexture = function() {
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ 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);
+ wtu.fillTexture(gl, texture, 1, 1, [0, 255, 0, 255]);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ return texture;
+};
+
+var test = function(fragShaderId, texUniformName) {
+ var program = wtu.setupProgram(gl, [wtu.simpleVertexShader, fragShaderId], ["a_position"], [0], true);
+
+ if (!program) {
+ testFailed("Shader compilation/link failed");
+ } else {
+ // Bind texture
+ var uniformMap = wtu.getUniformMap(gl, program);
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, textureGreen);
+ gl.uniform1i(uniformMap[texUniformName].location, 0);
+
+ // Draw
+ wtu.clearAndDrawUnitQuad(gl);
+
+ // Verify output
+ wtu.checkCanvasRect(gl, 0, 128, 256, 128, [0, 255,0, 255], "should be green", 1);
+ }
+};
+
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ wtu.setupUnitQuad(gl, 0, 1);
+ textureGreen = createGreenTexture();
+ test("shader-fs", "green.source");
+ test("shader-fs-array", "green[0].source");
+}
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html
new file mode 100644
index 0000000000..7e9af6f1aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sequence-operator-evaluation-order.html
@@ -0,0 +1,116 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL short-circuiting operators should be evaluated after previous operands in a sequence</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="64" height="64"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderSequenceSideEffectsAffectTernary" type="x-shader/x-fragment">
+precision mediump float;
+
+bool correct = true;
+
+uniform float u_zero;
+
+float wrong() {
+ correct = false;
+ return 0.0;
+}
+
+void main() {
+ // ESSL 1.00 section 5.9, about sequence operator:
+ // "All expressions are evaluated, in order, from left to right"
+ // Also use a ternary operator where the third operand has side effects to make sure
+ // only the second operand is evaluated.
+ float a = u_zero - 0.5; // Result should be -0.5.
+ float green = (a++, a > 0.0 ? 1.0 : wrong());
+ gl_FragColor = vec4(0.0, correct ? green : 0.0, 0.0, 1.0);
+}
+</script>
+<script id="fshaderSequenceSideEffectsAffectAnd" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform bool u_false;
+
+bool sideEffectA = false;
+bool funcA() {
+ sideEffectA = true;
+ return true;
+}
+
+bool sideEffectB = false;
+bool funcB() {
+ sideEffectB = true;
+ return true;
+}
+
+void main() {
+ bool b = (funcA(), u_false == sideEffectA && funcB());
+ gl_FragColor = (!b && sideEffectA && !sideEffectB) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+</script>
+<script id="fshaderSequenceSideEffectsAffectOr" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform bool u_false;
+
+bool sideEffectA = false;
+bool funcA() {
+ sideEffectA = true;
+ return false;
+}
+
+bool sideEffectB = false;
+bool funcB() {
+ sideEffectB = true;
+ return false;
+}
+
+void main() {
+ bool b = (funcA(), (u_false == !sideEffectA) || funcB());
+ gl_FragColor = (b && sideEffectA && !sideEffectB) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description();
+debug("");
+debug("This test is targeted to stress syntax tree transformations that might need to be done in shader translation to unfold operators.");
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshaderSequenceSideEffectsAffectTernary',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Expression where first operand of a sequence operator has side effects which affect the second operand that is a ternary operator'
+},
+{
+ fShaderId: 'fshaderSequenceSideEffectsAffectAnd',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Expression where first operand of a sequence operator has side effects which affect the second operand that is an and operator'
+},
+{
+ fShaderId: 'fshaderSequenceSideEffectsAffectOr',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Expression where first operand of a sequence operator has side effects which affect the second operand that is an or operator'
+}
+]);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html
new file mode 100644
index 0000000000..73416d17de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/sketchfab-lighting-shader-crash.html
@@ -0,0 +1,84 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Sketchfab Lighting Shader Crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script id='vshader1' type='x-shader/x-vertex'>
+attribute float testValue; // Can be uniform as well.
+varying mediump float FragVarying; // Necessary to reproduce.
+
+void main() {
+ // Crashes with mat4 as well. Does not crash with vectors.
+ mat2 projectionMatrix = mat2(0.0, 0.0, 0.0, 0.0);
+ if (testValue == 1.0)
+ {
+ // Using the matrix variable appears necessary.
+ projectionMatrix[0][0] = 1.0;
+ }
+
+ FragVarying = 0.0;
+ // Referencing the matrix is necessary though clearly the compiler
+ // doesn't realize the assignment is useless.
+ gl_Position = vec4(projectionMatrix[1][0], 0.0, 0.0, 1.0);
+}
+</script>
+<script id='fshader1' type='x-shader/x-fragment'>
+precision mediump float;
+varying float FragVarying;
+
+void main() {
+ gl_FragColor = vec4(FragVarying, 0.0, 0.0, 1.0);
+}
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test demonstrates a crash on the Nexus 5 (Adreno 330) when compiling Sketchfab's lighting shader. <a href='https://code.google.com/p/chromium/issues/detail?id=551937'>crbug.com/551937</a>");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+gl.canvas.addEventListener("webglcontextlost", function(e) {
+ testFailed("WebGL context lost");
+});
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+ debug("");
+
+ var program1 = wtu.setupProgram(gl, ['vshader1', 'fshader1']);
+ if (!gl.getProgramParameter(program1, gl.LINK_STATUS)) {
+ testFailed("Program failed to link");
+ } else {
+ testPassed("Program linked successfully");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+ debug("");
+}
+
+// Cycle through rAF a few times to give any webglcontextlost events a chance to propagate.
+wtu.waitForComposite(function() { finishTest(); });
+
+debug("");
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html
new file mode 100644
index 0000000000..afb72e1916
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-constructor-highp-bug.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Struct constructor highp bug.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader" type="x-shader/x-fragment">
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+
+struct Test {
+ vec3 color;
+};
+
+void main() {
+ vec3 color = vec3( 0.0, 1.0, 0.0 );
+ Test test = Test( color );
+ gl_FragColor = vec4( test.color, 1.0 );
+}
+</script>
+
+<script type="application/javascript">
+"use strict";
+description("Struct constructors should evaluate properly.");
+debug("Regression test for Three.js bug worked around in <a href='https://github.com/mrdoob/three.js/pull/7556'>https://github.com/mrdoob/three.js/pull/7556</a> that reproduced on Nexus 4 and 5 (Adreno 320 and 330).");
+debug("When high precision is used in the fragment shader on these devices, bugs occur in evaluation of structs' constructors. Thanks to Mr. doob for the reduced test case.");
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Struct contstructor evaluation"
+}
+]);
+
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-with-single-member-constructor.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-with-single-member-constructor.html
new file mode 100644
index 0000000000..8d1008326f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/struct-with-single-member-constructor.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL struct with a single member constructor 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="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader" type="x-shader/x-fragment">
+#version 100
+
+precision mediump float;
+
+struct S {
+ mat2 rotation;
+};
+void main(void)
+{
+ float angle = 1.0;
+ S(mat2(1.0, angle, 1.0, 1.0));
+}
+</script>
+<script>
+"use strict";
+description();
+debug("This is a regression test for <a href='https://bugs.chromium.org/p/swiftshader/issues/detail?id=56'>Swiftshader bug 56</a>.");
+debug("");
+
+GLSLConformanceTester.runTests([
+{
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Construct a struct with a single matrix member"
+}
+]);
+
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html
new file mode 100644
index 0000000000..c28db1daad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/temp-expressions-should-not-crash.html
@@ -0,0 +1,100 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Driver Bug - temp experssions should not crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<canvas id="example" width="40" height="40"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+void main(){
+ gl_Position = vec4(0, 0, 0, 1);
+}
+</script>
+<script id="fshaderUniformTest" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_uniform;
+void main()
+{
+ vec4 temp = vec4(0, 0, 0, 0);
+$(code)
+ gl_FragColor = temp;
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+var fUniformTestSource = wtu.getScript("fshaderUniformTest");
+
+var tests = [
+];
+var counts = [
+ { count:100,
+ mustPass: true,
+ },
+ { count: 1000,
+ mustPass: false,
+ },
+ { count: 10000,
+ mustPass: false,
+ },
+];
+var operators = ["+", "-", "/", "*"];
+counts.forEach(function(info) {
+ var generateCode = function(numVars) {
+ var codes = [];
+ var count = 0;
+ var step = 10;
+ for (var uu = 0; uu < numVars; uu += step) {
+ var subCodes = [""];
+ for (var vv = 0; vv < step; ++vv) {
+ subCodes.push(operators[(count++) % operators.length]);
+ }
+ subCodes.push("");
+ codes.push(" temp += " + subCodes.join("\n u_uniform ") + ";");
+ }
+ return {
+ code: codes.join("\n"),
+ };
+ };
+
+ var subs = generateCode(info.count);
+ tests.push({
+ vShaderId: "vshader",
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fUniformTestSource, subs),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: !info.mustPass,
+ passMsg: "shader with uniform with " + info.count + " operators in temp expressions in multiple lines",
+ });
+ subs.code = subs.code.replace(/\n +/g, " ")
+ tests.push({
+ vShaderId: "vshader",
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fUniformTestSource, subs),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ ignoreResults: !info.mustPass,
+ passMsg: "shader with uniform with " + info.count + " operators in temp expressions in one line",
+ });
+});
+GLSLConformanceTester.runTests(tests);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/unary-minus-operator-float-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/unary-minus-operator-float-bug.html
new file mode 100644
index 0000000000..85f7231444
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/unary-minus-operator-float-bug.html
@@ -0,0 +1,49 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL unary minus operator with float bug Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+void main () {
+ float f = -1.0;
+ // atan(tan(0.5), -f) is in range [1.5707, 1.5708) on Mac OSX 10.11 with Intel GPU.
+ // But it should be 0.5.
+ gl_FragColor = vec4(atan(tan(0.5), -f), 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+description("Test for unary minus operator with float bug on MacOSX 10.11 with Intel GPU");
+debug("This is a regression test for <a href='https://bugs.chromium.org/p/chromium/issues/detail?id=308366'>Chromium Issue 308366</a>");
+debug("");
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Evaluate unary minus operator and atan(x, y)",
+ renderTolerance: 3,
+ renderColor: [127, 0, 0, 255]
+}
+]);
+
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html
new file mode 100644
index 0000000000..0c97c987f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/undefined-index-should-not-crash.html
@@ -0,0 +1,64 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Bug - indexing with 'int()' should not crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<canvas id="example" width="40" height="40"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+void main(){
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script id="fshaderTest" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 uniformVec;
+uniform mat4 uniformMat;
+uniform float uniformArray[4];
+void main()
+{
+ vec4 tempVec = vec4(0.0);
+ mat4 tempMat = mat4(0.0);
+ float tempArray[4];
+ gl_FragColor = vec4($(indexed)[int()]);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+var fTestSource = wtu.getScript("fshaderTest");
+
+var tests = [];
+
+var indexedValues = ['tempVec', 'tempMat[0]', 'tempArray', 'uniformVec', 'uniformMat[0]', 'uniformArray'];
+
+for (var i = 0; i < indexedValues.length; ++i) {
+ var subs = {indexed: indexedValues[i]};
+ tests.push({
+ vShaderId: "vshader",
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fTestSource, subs),
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "shader with invalid index expression int() should not compile",
+ });
+}
+GLSLConformanceTester.runTests(tests);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html
new file mode 100644
index 0000000000..fc99f0f87f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/uniforms-should-not-lose-values.html
@@ -0,0 +1,81 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Driver Bug - Uniforms should no lose values</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="512" height="256"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+uniform float k,u;
+uniform mat4 l;
+attribute vec3 a;
+void main(){
+ gl_Position=l*vec4(a,1.+u+k);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform float w,x,y,z;
+void main() {
+ gl_FragColor=vec4(1.-y,y,w+x+z,1);
+}
+</script>
+<script>
+"use strict";
+// Certain drivers fail this test. Specifically Mac NVidia GT 330 on OSX 10.8.2
+description();
+debug("");
+var wtu = WebGLTestUtils;
+function test() {
+ var gl = wtu.create3DContext("canvas");
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+
+ wtu.setupUnitQuad(gl);
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a"], undefined, true);
+
+ var setUniformf = function(name, val) {
+ var loc = gl.getUniformLocation(program, name);
+ var func = 'uniform' + val.length + 'fv';
+ gl[func](loc, val);
+ };
+
+ var setUniformMat = function(name, val) {
+ var loc = gl.getUniformLocation(program, name);
+ var func = 'uniformMatrix' + Math.sqrt(val.length) + 'fv';
+ gl[func](loc, false, val);
+ };
+
+ setUniformMat('l', [1, 0 ,0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
+ gl.viewport(0, 0, 256, 256);
+ setUniformf('y', [0]);
+ wtu.drawUnitQuad(gl);
+ gl.viewport(256, 0, 256, 256);
+ setUniformf('y', [1]);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 0, 0, 256, 256, [255, 0, 0, 255]);
+ wtu.checkCanvasRect(gl, 256, 0, 256, 256, [0, 255, 0, 255]);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+test();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/varying-arrays-should-not-be-reversed.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/varying-arrays-should-not-be-reversed.html
new file mode 100644
index 0000000000..14cdd9fe09
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/varying-arrays-should-not-be-reversed.html
@@ -0,0 +1,82 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Varying arrays should not be reversed</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="512" height="256"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+varying float colors[3];
+uniform vec3 testData;
+attribute vec3 position;
+void main(){
+ gl_Position = vec4(position, 1.0);
+ colors[0] = testData.x;
+ colors[1] = testData.y;
+ colors[2] = testData.z;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying float colors[3];
+void main() {
+ gl_FragColor = vec4(colors[0], colors[1], colors[2], 1.0);
+}
+</script>
+<script>
+"use strict";
+description("Varying arrays should not be reversed.");
+debug("This issue has been seen in Chrome on Nexus 7 2013 (Adreno 320) and Moto G3 (Adreno 306).");
+debug("");
+debug("If things are working correctly, the vertical stripes should be: red, green, blue, light blue, orange");
+debug("");
+debug("If they are not, the red and blue channels will appear to be swapped and you will see: blue, green, red, orange, light blue");
+var wtu = WebGLTestUtils;
+function test() {
+ var gl = wtu.create3DContext("canvas");
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+
+ wtu.setupUnitQuad(gl);
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["position"], undefined, true);
+ var loc = gl.getUniformLocation(program, 'testData');
+
+ var triples = [
+ [255, 0, 0],
+ [0, 255, 0],
+ [0, 0, 255],
+ [0, 128, 255],
+ [255, 128, 0]
+ ];
+
+ for (var i = 0; i < triples.length; i++) {
+ var triple = triples[i];
+ var x = i * 64;
+ gl.viewport(x, 0, 64, 256);
+ gl.uniform3f(loc, triple[0] / 255, triple[1] / 255, triple[2] / 255);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, x, 0, 64, 256, [triple[0], triple[1], triple[2], 255]);
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+test();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-matrix-constructor-scalarization.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-matrix-constructor-scalarization.html
new file mode 100644
index 0000000000..a6ad3483c3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-matrix-constructor-scalarization.html
@@ -0,0 +1,181 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title></title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<!--
+
+Original Shadertoy:
+https://www.shadertoy.com/view/ttGyzh
+
+ float a = 0.; // bug
+ #define A 0. // ok
+//#define A min(0.,iTime) // bug
+
+
+ #define r(a) mat2( cos( a + vec4(0,-1.5708,1.5708,0) ) ) // bug
+//#define r(a) mat2( cos(a), -sin(a), sin(a), cos(a) ) // no bug
+//#define r(a) cos(a),sin(a)) // no bug ( vec instead of mat )
+//#define r(a) cos(a+vec2(0,-1.5708)) // no bug ( vec instead of mat )
+
+vec2 c;
+#define f(U,a) ( c = (U) * r(a) , sin(10.*c.x) )
+
+void mainImage( out vec4 O, vec2 U )
+{
+ U /= iResolution.xy;
+
+ O = U.y > .5
+ ? vec4( f(U,a) , f(U*4.,a) , 0,0) // top
+ : vec4( f(U,A) , f(U*4.,A) , 0,0); // bottom
+}
+-->
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec2 aPosition;
+attribute vec2 aTexCoord;
+
+varying vec2 vTexCoord;
+
+void main(void) {
+ gl_Position = vec4(aPosition, 0.0, 1.0);
+ vTexCoord = aTexCoord;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+varying vec2 vTexCoord;
+
+float a = 0.;
+#define A 0.
+
+#define r(a) mat2( cos( a + vec4(0,-1.5708,1.5708,0) ) )
+vec2 c;
+#define f(U,a) ( c = (U) * r(a) , sin(10.*c.x) )
+
+void main() {
+ vec2 U = vTexCoord;
+
+ gl_FragColor = U.y > .5
+ ? vec4( f(U,a) , f(U*4.,a) , 0,1.0) // top
+ : vec4( f(U,A) , f(U*4.,A) , 0,1.0); // bottom
+}
+</script>
+
+<script id="compileVShader" type="x-shader/x-vertex">
+varying vec2 v_texcoord;
+
+void main() {
+ v_texcoord = vec2(0.0, 0.0);
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script id="compileFShader" type="x-shader/x-fragment">
+// From http://crbug.com/398694
+precision mediump float;
+uniform sampler2D s_texture;
+uniform vec4 color_weights;
+varying vec2 v_texcoord;
+void main() {
+ gl_FragColor = color_weights * mat4(
+ vec4(texture2D(s_texture, v_texcoord).rgb, 1.0),
+ vec4(texture2D(s_texture, v_texcoord).rgb, 1.0),
+ vec4(texture2D(s_texture, v_texcoord).rgb, 1.0),
+ vec4(texture2D(s_texture, v_texcoord).rgb, 1.0));
+}
+</script>
+
+</head>
+<body>
+<canvas id="example"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+debug("");
+
+description("Vector and matrix constructor scalarization workaround (SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS) caused bugs");
+debug('Regression test for <a href="http://crbug.com/1165751">crbug.com/1165751</a>');
+
+// Note: Firefox reports that without this workaround, there are
+// failures on at least Windows / Intel GPU / OpenGL on:
+// conformance/glsl/constructors/glsl-construct-mat2.html
+// https://searchfox.org/mozilla-central/source/dom/canvas/WebGLShaderValidator.cpp#63
+
+// Chromium reported that
+// conformance/glsl/misc/shader-struct-scope.html failed on macOS and
+// on Linux AMD without this workaround enabled:
+// http://crbug.com/angleproject/701
+
+const wtu = WebGLTestUtils;
+const canvas = document.getElementById("example");
+const sz = canvas.width = canvas.height = 256;
+const gl = wtu.create3DContext(canvas, undefined);
+
+if (!gl) {
+ testFailed("WebGL context creation failed");
+ finishTest();
+} else {
+ testPassed("WebGL context creation succeeded");
+ runDrawTest();
+ runCompileTest();
+ finishTest();
+}
+
+function runDrawTest() {
+ debug("Ensure that shader translation isn't broken by the vector and matrix constructor scalarization workaround");
+ let positionLocation = 0;
+ let texCoordLocation = 1;
+ wtu.setupUnitQuad(gl, positionLocation, texCoordLocation);
+ let program = wtu.setupProgram(gl, ["vshader", "fshader"],
+ ["aPosition", "aTexCoord"],
+ [positionLocation, texCoordLocation], true);
+ if (!program) {
+ testFailed("Error compiling shaders");
+ return;
+ }
+ gl.useProgram(program);
+ // Buffers returned from setupQuad above, and ignored, are already bound.
+ wtu.drawUnitQuad(gl);
+
+ // Top and bottom halves should be roughly equal. Go through one
+ // horizontal scanline in the middle.
+ const compareHeight = sz / 4;
+ let pixelValue = new Uint8Array(4);
+ let allEqual = true;
+ // Empirically found that tolerance between the top and bottom
+ // needs to be up to roughly 8 on some platforms.
+ const tolerance = 8;
+ let tempBuf = new Uint8Array(4);
+ // Step over some pixels to spew slightly fewer comparison messages.
+ for (let x = 0; x < sz; x += 4) {
+ gl.readPixels(x, compareHeight, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixelValue);
+ wtu.checkCanvasRect(gl, x, sz - compareHeight, 1, 1, pixelValue, undefined, tolerance, tempBuf);
+ }
+}
+
+function runCompileTest() {
+ debug("Running compilation test");
+ let program = wtu.setupProgram(gl, ["compileVShader", "compileFShader"], [], [], true);
+ if (program) {
+ testPassed("Shader previously requiring SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS compiled successfully");
+ } else {
+ testFailed("Shader previously requiring SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS failed to compile");
+ }
+}
+
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop-complex.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop-complex.html
new file mode 100644
index 0000000000..3b1277c1be
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop-complex.html
@@ -0,0 +1,80 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL vector/scalar arithmetic inside a for loop (complex cases)</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ for (int i = 0; i < 2; i++)
+ {
+ float x = gl_FragCoord.x;
+ float y = (x *= 2.0);
+ gl_FragColor = gl_FragColor + vec4(y, y, y, y);
+ }
+ if (gl_FragColor.g == gl_FragColor.r &&
+ gl_FragColor.b == gl_FragColor.r &&
+ gl_FragColor.a == gl_FragColor.r)
+ {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ }
+}
+</script>
+<script id="fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop2" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ for (int i = 0; i < 2; i++)
+ {
+ float x = gl_FragCoord.x;
+ float y = (x *= 2.0);
+ gl_FragColor = gl_FragColor + vec4(x, y, x, y);
+ }
+ if (gl_FragColor.g == gl_FragColor.r &&
+ gl_FragColor.b == gl_FragColor.r &&
+ gl_FragColor.a == gl_FragColor.r)
+ {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ }
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description();
+
+// See http://crbug.com/772651
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Adding a vector that's just 4 copies of a scalar to another vector inside for loop should work."
+},
+{
+ fShaderId: 'fShaderVectorCompoundMulAndAddInSeparateStatementsInsideForLoop2',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Adding a vector that's just 4 copies of a scalar stored in two different variables to another vector inside for loop should work."
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop.html
new file mode 100644
index 0000000000..622ea38129
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/bugs/vector-scalar-arithmetic-inside-loop.html
@@ -0,0 +1,99 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL vector/scalar arithmetic inside a for loop</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fShaderVectorMulAndAddInsideForLoop" type="x-shader/x-fragment">
+void main(){
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ for (int i = 0; i < 2; i++)
+ {
+ gl_FragColor += (2.0 * gl_FragCoord.x);
+ }
+ if (gl_FragColor.g == gl_FragColor.r &&
+ gl_FragColor.b == gl_FragColor.r &&
+ gl_FragColor.a == gl_FragColor.r)
+ {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ }
+}
+</script>
+<script id="fShaderVectorCompoundMulAndAddInsideForLoop" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ for (int i = 0; i < 2; i++)
+ {
+ float x = gl_FragCoord.x;
+ gl_FragColor = gl_FragColor + (x *= 2.0);
+ }
+ if (gl_FragColor.g == gl_FragColor.r &&
+ gl_FragColor.b == gl_FragColor.r &&
+ gl_FragColor.a == gl_FragColor.r)
+ {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ }
+}
+</script>
+<script id="fShaderVectorCompoundDivAndAddInsideForLoop" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ for (int i = 0; i < 2; i++)
+ {
+ float x = gl_FragCoord.x;
+ gl_FragColor = gl_FragColor + (x /= 2.0);
+ }
+ if (gl_FragColor.g == gl_FragColor.r &&
+ gl_FragColor.b == gl_FragColor.r &&
+ gl_FragColor.a == gl_FragColor.r)
+ {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ }
+}
+</script>
+<script type="text/javascript">
+"use strict";
+description();
+
+// See http://crbug.com/772651
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fShaderVectorMulAndAddInsideForLoop',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Adding a scalar to a vector inside for loop should work."
+},
+{
+ fShaderId: 'fShaderVectorCompoundMulAndAddInsideForLoop',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Adding a scalar (target of a compound assignment/multiplication operation) to a vector inside for loop should work."
+},
+{
+ fShaderId: 'fShaderVectorCompoundDivAndAddInsideForLoop',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Adding a scalar (target of a compound assignment/division operation) to a vector inside for loop should work."
+}
+]);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt
new file mode 100644
index 0000000000..6758bea8e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/00_test_list.txt
@@ -0,0 +1,14 @@
+glsl-construct-vec2.html
+glsl-construct-vec3.html
+glsl-construct-vec4.html
+glsl-construct-ivec2.html
+glsl-construct-ivec3.html
+glsl-construct-ivec4.html
+glsl-construct-bvec2.html
+glsl-construct-bvec3.html
+glsl-construct-bvec4.html
+glsl-construct-mat2.html
+glsl-construct-mat3.html
+glsl-construct-mat4.html
+--min-version 1.0.3 glsl-construct-vec-mat-corner-cases.html
+--min-version 1.0.3 glsl-construct-vec-mat-index.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html
new file mode 100644
index 0000000000..b1e72160d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec2.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "bvec2";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html
new file mode 100644
index 0000000000..57f51d3902
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec3.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "bvec3";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html
new file mode 100644
index 0000000000..a873c016d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-bvec4.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "bvec4";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html
new file mode 100644
index 0000000000..5524fe3abc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec2.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "ivec2";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html
new file mode 100644
index 0000000000..594f6713f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec3.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "ivec3";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html
new file mode 100644
index 0000000000..8bc59761e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-ivec4.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "ivec4";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html
new file mode 100644
index 0000000000..5a4afb817d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat2.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "mat2";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html
new file mode 100644
index 0000000000..e4a2e9815d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat3.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "mat3";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html
new file mode 100644
index 0000000000..81fd92b2ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-mat4.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "mat4";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html
new file mode 100644
index 0000000000..a2c8f306ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-corner-cases.html
@@ -0,0 +1,195 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="vsVec4Mat2Add" type="text/something-not-javascript">
+void main()
+{
+ mat2 m1 = mat2(1.0, 2.0, 3.0, 4.0);
+ mat2 m2 = mat2(0);
+ vec4 v = vec4(m1 + m2);
+ gl_Position = v;
+}
+</script>
+<script id="fsVec4Mat3Add" type="text/something-not-javascript">
+precision mediump float;
+void main()
+{
+ mat3 m1 = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0);
+ mat3 m2 = mat3(0);
+ vec4 v = vec4(m1 + m2);
+ gl_FragColor = v;
+}
+</script>
+
+<script id="vsMat2Vec4Sub" type="text/something-not-javascript">
+void main()
+{
+ vec4 v1 = vec4(1.0, 2.0, 3.0, 4.0);
+ vec4 v2 = vec4(0);
+ mat2 m = mat2(v1 - v2);
+ gl_Position = vec4(1.0, m);
+}
+</script>
+<script id="fsMat3Vec4AddSub" type="text/something-not-javascript">
+precision mediump float;
+void main()
+{
+ vec4 v1 = vec4(1.0, 2.0, 3.0, 4.0);
+ vec4 v2 = vec4(0);
+ mat3 m = mat3(v1 + v2, 5.0, v1 - v2);
+ gl_FragColor = vec4(m);
+}
+</script>
+
+<script id="vsVec4Mat2Func" type="text/something-not-javascript">
+mat2 f(mat2 a)
+{
+ return a;
+}
+void main()
+{
+ mat2 m = mat2(1.0, 2.0, 3.0, 4.0);
+ vec4 v = vec4(f(m));
+ gl_Position = vec4(1.0, v);
+}
+</script>
+<script id="fsVec4Mat3Func" type="text/something-not-javascript">
+precision mediump float;
+mat3 f(mat3 a)
+{
+ return a;
+}
+void main()
+{
+ mat3 m = mat3(0);
+ vec4 v = vec4(f(m));
+ gl_FragColor = v;
+}
+</script>
+
+<script id="vsMat2Vec4Func" type="text/something-not-javascript">
+vec4 f(vec4 a)
+{
+ return a;
+}
+void main()
+{
+ vec4 v = vec4(1.0, 2.0, 3.0, 4.0);
+ mat2 m = mat2(f(v));
+ gl_Position = vec4(1.0, m);
+}
+</script>
+<script id="fsMat3Vec4Func" type="text/something-not-javascript">
+precision mediump float;
+vec4 f(vec4 a)
+{
+ return a;
+}
+void main()
+{
+ vec4 v1 = vec4(1.0, 2.0, 3.0, 4.0);
+ vec4 v2 = vec4(0);
+ mat3 m = mat3(f(v1), 5.0, f(v2));
+ gl_FragColor = vec4(m);
+}
+</script>
+
+<script id="vsMat4VecMultiple" type="text/something-not-javascript">
+vec4 f(vec4 a)
+{
+ return a;
+}
+void main()
+{
+ vec2 v2 = vec2(1.0, 2.0);
+ vec3 v3 = vec3(1.0, 2.0, 3.0);
+ vec4 v4 = vec4(1.0, 2.0, 3.0, 4.0);
+ mat4 m = mat4(0.0, v2, 1.0, v3 + vec3(1), 2.0, vec4(0), f(v4));
+ gl_Position = vec4(1.0, m);
+}
+</script>
+<script id="fsMat4VecMultiple" type="text/something-not-javascript">
+precision mediump float;
+vec4 f(vec4 a)
+{
+ return a;
+}
+void main()
+{
+ vec2 v2 = vec2(1.0, 2.0);
+ vec3 v3 = vec3(1.0, 2.0, 3.0);
+ vec4 v4 = vec4(1.0, 2.0, 3.0, 4.0);
+ mat4 m = mat4(0.0, v2, 1.0, v3 + vec3(1), 2.0, vec4(0), f(v4));
+ gl_FragColor = vec4(m);
+}
+</script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var tests = [];
+
+tests.push({
+ vShaderSource: wtu.getScript("vsVec4Mat2Add"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fsVec4Mat3Add"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vec(mat +/- mat) works ok",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vsMat2Vec4Sub"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fsMat3Vec4AddSub"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "mat(vec +/- vec) works ok",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vsVec4Mat2Func"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fsVec4Mat3Func"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vec(func(mat)) works ok",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vsMat2Vec4Func"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fsMat3Vec4Func"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "mat(func(vec)) works ok",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vsMat4VecMultiple"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fsMat4VecMultiple"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "mat4(float, vec2, float, vec3+vec3, float, vec4, f(vec4)) works ok",
+});
+
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html
new file mode 100644
index 0000000000..084d532f8a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec-mat-index.html
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// A matrix constructor with two writes and reads to the same variable inside it in different parameters must succeed "mat2(index++, vec4(index++))"
+// ESSL 1.00 spec section 5.4 Constructors: "Arguments are evaluated from left to right."
+precision mediump float;
+bool equal(mat2 m1, mat2 m2)
+{
+ float EPSILON = 0.00001;
+ for (int i = 0; i < 2; i++) {
+ for (int j = 0; j < 2; j++) {
+ if (abs(m1[i][j] - m2[i][j]) > EPSILON)
+ return false;
+ }
+ }
+ return true;
+}
+void main()
+{
+ int i = 0;
+ mat2 m = mat2(i++, vec4(i++));
+ if (equal(m, mat2(0, 1, 1, 1)))
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+GLSLConformanceTester.runRenderTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html
new file mode 100644
index 0000000000..6fa0d2af52
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec2.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "vec2";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html
new file mode 100644
index 0000000000..b5e1a7cd4d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec3.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "vec3";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html
new file mode 100644
index 0000000000..c66fa470a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/constructors/glsl-construct-vec4.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script src="../../../js/glsl-constructor-tests-generator.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var targetType = "vec4";
+description("Test " + targetType + " constructor expressions.");
+
+var testSet = GLSLConstructorTestsGenerator.getDefaultTestSet(targetType);
+
+// Generate tests
+var testCases = GLSLConstructorTestsGenerator.getConstructorTests(targetType, testSet);
+
+// Run the tests
+GLSLConformanceTester.runTests(testCases);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt
new file mode 100644
index 0000000000..dd06ea0520
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/00_test_list.txt
@@ -0,0 +1,36 @@
+glsl-function.html
+glsl-function-abs.html
+glsl-function-acos.html
+glsl-function-asin.html
+glsl-function-atan.html
+glsl-function-atan-xy.html
+glsl-function-ceil.html
+glsl-function-clamp-float.html
+glsl-function-clamp-gentype.html
+glsl-function-cos.html
+glsl-function-cross.html
+glsl-function-distance.html
+glsl-function-dot.html
+glsl-function-faceforward.html
+glsl-function-floor.html
+glsl-function-fract.html
+glsl-function-length.html
+#glsl-function-lessThan.html
+glsl-function-max-float.html
+glsl-function-max-gentype.html
+glsl-function-min-float.html
+glsl-function-min-gentype.html
+glsl-function-mix-float.html
+glsl-function-mix-gentype.html
+glsl-function-mod-float.html
+glsl-function-mod-gentype.html
+glsl-function-normalize.html
+glsl-function-reflect.html
+#glsl-function-refract.html
+glsl-function-sign.html
+glsl-function-sin.html
+glsl-function-step-float.html
+glsl-function-step-gentype.html
+glsl-function-smoothstep-float.html
+glsl-function-smoothstep-gentype.html
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html
new file mode 100644
index 0000000000..e7e3b19207
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-abs.html
@@ -0,0 +1,45 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL abs function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "abs",
+ testFunc: "$(func)($(arg0))",
+ emuFunc: ["float $(func)_base(float value) {",
+ " return value >= 0.0 ? value : -value;",
+ "}"].join("\n"),
+ gridRes: 4,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 2.0 - 1.0),",
+ " 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ "$(output) = vec4(0, $(func)($(input).xy * 2.0 - vec2(1, 1)), 1);",
+ "$(output) = vec4($(func)($(input).xyz * 2.0 - vec3(1, 1, 1)), 1);",
+ "$(output) = $(func)($(input) * 2.0 - vec4(1, 1, 1, 1));"
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html
new file mode 100644
index 0000000000..ba6b9ab33f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-acos.html
@@ -0,0 +1,95 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL acos function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var piConstants = [
+ "const float kPI = 3.14159265358979323846;",
+ "const float kHalfPI = (kPI * 0.5);",
+ "const float k2PI = (kPI * 2.0);"
+].join("\n");
+
+var kPI = Math.PI;
+var kHalfPI = Math.PI * 0.5;
+var k2PI = Math.PI * 2.0;
+var acos = Math.acos; // shorthand
+
+GLSLGenerator.runReferenceImageTest({
+ feature: "acos",
+ args: "$(type) value",
+ testFunc: "$(func)($(type))",
+ gridRes: 8,
+ tolerance: 2,
+ extra: piConstants,
+ tests: [
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).x * 0.8) / kPI,",
+ " $(func)($(input).y * 0.8) / kPI,",
+ " 0,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ acos(x * 0.8) / kPI,
+ acos(y * 0.8) / kPI,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xy * 0.8) / kPI,",
+ " 0, 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ acos(x * 0.8) / kPI,
+ acos(y * 0.8) / kPI,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xyz * 0.8) / kPI,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ acos(x * 0.8) / kPI,
+ acos(y * 0.8) / kPI,
+ acos(z * 0.8) / kPI,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = ",
+ " $(func)($(input) * 0.8) / kPI;",
+ ].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ acos(x * 0.8) / kPI,
+ acos(y * 0.8) / kPI,
+ acos(z * 0.8) / kPI,
+ acos(w * 0.8) / kPI ];
+ },
+ },
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html
new file mode 100644
index 0000000000..051c4f7d81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-asin.html
@@ -0,0 +1,95 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL asin function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var piConstants = [
+ "const float kPI = 3.14159265358979323846;",
+ "const float kHalfPI = (kPI * 0.5);",
+ "const float k2PI = (kPI * 2.0);"
+].join("\n");
+
+var kPI = Math.PI;
+var kHalfPI = Math.PI * 0.5;
+var k2PI = Math.PI * 2.0;
+var asin = Math.asin; // shorthand
+
+GLSLGenerator.runReferenceImageTest({
+ feature: "asin",
+ args: "$(type) value",
+ testFunc: "$(func)($(type))",
+ gridRes: 8,
+ tolerance: 2,
+ extra: piConstants,
+ tests: [
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).x * 0.8) / kPI + 0.5,",
+ " $(func)($(input).y * 0.8) / kPI + 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ asin(x * 0.8) / kPI + 0.5,
+ asin(y * 0.8) / kPI + 0.5,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xy * 0.8) / kPI + 0.5,",
+ " 0, 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ asin(x * 0.8) / kPI + 0.5,
+ asin(y * 0.8) / kPI + 0.5,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xyz * 0.8) / kPI + 0.5,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ asin(x * 0.8) / kPI + 0.5,
+ asin(y * 0.8) / kPI + 0.5,
+ asin(z * 0.8) / kPI + 0.5,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = ",
+ " $(func)($(input) * 0.8) / kPI + 0.5;",
+ ].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ asin(x * 0.8) / kPI + 0.5,
+ asin(y * 0.8) / kPI + 0.5,
+ asin(z * 0.8) / kPI + 0.5,
+ asin(w * 0.8) / kPI + 0.5 ];
+ },
+ },
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html
new file mode 100644
index 0000000000..e20d18d2c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan-xy.html
@@ -0,0 +1,98 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL atan-xy function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var piConstants = [
+ "const float kPI = 3.14159265358979323846;",
+ "const float kHalfPI = (kPI * 0.5);",
+ "const float k2PI = (kPI * 2.0);"
+].join("\n");
+
+var kPI = Math.PI;
+var kHalfPI = Math.PI * 0.5;
+var k2PI = Math.PI * 2.0;
+var atan2 = Math.atan2; // shorthand
+
+GLSLGenerator.runReferenceImageTest({
+ feature: "atan",
+ args: "$(type) y, $(type) x",
+ testFunc: "$(func)($(type), $(type))",
+ gridRes: 8,
+ tolerance: 5,
+ extra: piConstants,
+ tests: [
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).x + 0.1, $(input).y) / k2PI + 0.5,",
+ " 0,",
+ " 0,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan2(x + 0.1, y) / k2PI + 0.5,
+ 0,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xy + vec2(0.1, 0.1), $(input).yx) / ",
+ " k2PI + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan2(x + 0.1, y) / k2PI + 0.5,
+ atan2(y + 0.1, x) / k2PI + 0.5,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xyz + vec3(0.1, 0.1, 0.1), $(input).yzx) / ",
+ " k2PI + vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan2(x + 0.1, y) / k2PI + 0.5,
+ atan2(y + 0.1, z) / k2PI + 0.5,
+ atan2(z + 0.1, x) / k2PI + 0.5,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = ",
+ " $(func)($(input) + vec4(0.1, 0.1, 0.1, 0.1), $(input).wzyx) / ",
+ " k2PI + vec4(0.5, 0.5, 0.5, 0.5);",
+ ].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan2(x + 0.1, w) / k2PI + 0.5,
+ atan2(y + 0.1, z) / k2PI + 0.5,
+ atan2(z + 0.1, y) / k2PI + 0.5,
+ atan2(w + 0.1, x) / k2PI + 0.5 ];
+ },
+ },
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html
new file mode 100644
index 0000000000..20d1366f70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-atan.html
@@ -0,0 +1,95 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL atan function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var piConstants = [
+ "const float kPI = 3.14159265358979323846;",
+ "const float kHalfPI = (kPI * 0.5);",
+ "const float k2PI = (kPI * 2.0);"
+].join("\n");
+
+var kPI = Math.PI;
+var kHalfPI = Math.PI * 0.5;
+var k2PI = Math.PI * 2.0;
+var atan = Math.atan; // shorthand
+
+GLSLGenerator.runReferenceImageTest({
+ feature: "atan",
+ args: "$(type) value",
+ testFunc: "$(func)($(type))",
+ gridRes: 8,
+ tolerance: 4,
+ extra: piConstants,
+ tests: [
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).x * 8.0 - 4.0) / k2PI + 0.5,",
+ " 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan(x * 8.0 - 4.0) / k2PI + 0.5,
+ 0.5,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xy * 8.0 - vec2(4, 4)) / k2PI + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan(x * 8.0 - 4) / k2PI + 0.5,
+ atan(y * 8.0 - 4) / k2PI + 0.5,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xyz * 8.0 - vec3(4, 4, 4)) / k2PI + vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan(x * 8.0 - 4) / k2PI + 0.5,
+ atan(y * 8.0 - 4) / k2PI + 0.5,
+ atan(z * 8.0 - 4) / k2PI + 0.5,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = ",
+ " $(func)($(input) * 8.0 - vec4(4, 4, 4, 4)) / k2PI + vec4(0.5, 0.5, 0.5, 0.5);",
+ ].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ atan(x * 8.0 - 4) / k2PI + 0.5,
+ atan(y * 8.0 - 4) / k2PI + 0.5,
+ atan(z * 8.0 - 4) / k2PI + 0.5,
+ atan(w * 8.0 - 4) / k2PI + 0.5 ];
+ },
+ },
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html
new file mode 100644
index 0000000000..a031b93fa3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-ceil.html
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL ceil function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "ceil",
+ testFunc: "$(func)($(arg0))",
+ emuFunc: ["float $(func)_base(float value) {",
+ " float m = mod(value, 1.0);",
+ " return m != 0.0 ? (value + 1.0 - m) : value;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 8.0 - 4.0) / 8.0 + 0.5,",
+ " $(func)($(input).y * 8.0 - 4.0) / 8.0 + 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + ",
+ " vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + ",
+ " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html
new file mode 100644
index 0000000000..bb74a30961
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-float.html
@@ -0,0 +1,56 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL clamp-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "clamp",
+ args: "$(type) value, float minValue, float maxValue",
+ baseArgs: "value$(field), minValue, maxValue",
+ testFunc: "$(func)($(type), float, float)",
+ emuFunc: ["float $(func)_base(float value, float minValue, float maxValue) {",
+ " return min(max(value, minValue), maxValue);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 6.0 - 3.0, -1.5, 1.5) / 3.0 + 0.5,",
+ " $(func)($(input).y * 10.0 - 5.0, -2.5, 2.5) / 5.0 + 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * vec2(6, 10) - vec2(3, 5), -1.5, 2.0) / ",
+ " vec2(3.0, 5.0) + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * vec3(6, 10, 8) - vec3(3, 5, 4), -1.5, 2.0) / ",
+ " vec3(3, 5, 4) + vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * vec4(6, 10, 8, 4) - vec4(3, 5, 4, 2),",
+ " -1.5, 2.2) / vec4(3, 5, 4, 2) + ",
+ " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html
new file mode 100644
index 0000000000..2967bdc57d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-clamp-gentype.html
@@ -0,0 +1,59 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL clamp-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "clamp",
+ args: "$(type) value, $(type) minValue, $(type) maxValue",
+ baseArgs: "value$(field), minValue$(field), maxValue$(field)",
+ testFunc: "$(func)($(type), $(type), $(type))",
+ emuFunc: ["float $(func)_base(float value, float minValue, float maxValue) {",
+ " return min(max(value, minValue), maxValue);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 6.0 - 3.0, -1.5, 1.5) / 3.0 + 0.5,",
+ " $(func)($(input).y * 10.0 - 5.0, -2.5, 2.5) / 5.0 + 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * vec2(6, 10) - vec2(3, 5), ",
+ " vec2(-1.5, -2.5), vec2(1.5, 2.5)) / ",
+ " vec2(3.0, 5.0) + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * vec3(6, 10, 8) - vec3(3, 5, 4), ",
+ " vec3(-1.5, -2.5, -2), vec3(1.5, 2.5, 2)) / vec3(3, 5, 4) + ",
+ " vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * vec4(6, 10, 8, 4) - vec4(3, 5, 4, 2),",
+ " vec4(-1.5, -2.5, -2, -1), vec4(1.5, 2.5, 2, 1)) / ",
+ " vec4(3, 5, 4, 2) + ",
+ " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html
new file mode 100644
index 0000000000..a62ffc76fc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cos.html
@@ -0,0 +1,99 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL cos function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var piConstants = [
+ "const float kPI = 3.14159265358979323846;",
+ "const float kHalfPI = (kPI * 0.5);",
+ "const float k2PI = (kPI * 2.0);"
+].join("\n");
+
+var kPI = Math.PI;
+var kHalfPI = Math.PI * 0.5;
+var k2PI = Math.PI * 2.0;
+var cos = Math.cos; // shorthand
+
+GLSLGenerator.runReferenceImageTest({
+ feature: "cos",
+ args: "$(type) value",
+ testFunc: "$(func)($(type))",
+ gridRes: 8,
+ tolerance: 3,
+ extra: piConstants,
+ tests: [
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).x * kHalfPI + kHalfPI),",
+ " $(func)($(input).y * kHalfPI),",
+ " 0,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ cos(x * kHalfPI + kHalfPI),
+ cos(y * kHalfPI),
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xy * vec2(kPI, k2PI)) * 0.5 + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ cos(x * kPI) * 0.5 + 0.5,
+ cos(y * k2PI) * 0.5 + 0.5,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ // FIXME: for some reason, this test requires a higher tolerance when run in a vertex shader.
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xyz * vec3(kPI, k2PI, 4.0)) * ",
+ " 0.5 + vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ cos(x * kPI) * 0.5 + 0.5,
+ cos(y * k2PI) * 0.5 + 0.5,
+ cos(z * 4.0) * 0.5 + 0.5,
+ 1 ];
+ },
+ tolerance: 7,
+ },
+ {
+ source: ["$(output) = ",
+ " $(func)($(input) * vec4(k2PI, 4.0, kHalfPI, kPI)) *",
+ " 0.5 + vec4(0.5, 0.5, 0.5, 1);",
+ ].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ cos(x * k2PI) * 0.5 + 0.5,
+ cos(y * 4.0) * 0.5 + 0.5,
+ cos(z * kHalfPI) * 0.5 + 0.5,
+ cos(w * kPI) * 0.5 + 1.0 ];
+ },
+ },
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html
new file mode 100644
index 0000000000..37d17a4eda
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-cross.html
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL cross function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+GLSLGenerator.runFeatureTest({
+ feature: "cross",
+ args: "$(type) x, $(type) y",
+ baseArgs: "value$(field)",
+ testFunc: "$(func)($(type),$(type))",
+ emuFuncs: [
+ { type: "vec3",
+ code: [
+ "vec3 $(func)_emu($(args)) {",
+ " return vec3(",
+ " x[1] * y[2] - y[1] * x[2],",
+ " x[2] * y[0] - y[2] * x[0],",
+ " x[0] * y[1] - y[0] * x[1]);",
+ "}"].join("\n")
+ },
+ ],
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(",
+ " normalize($(input).xyz - 0.5),",
+ " normalize($(input).yzw - 0.5)) * 0.5 + 0.5,",
+ " 1);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html
new file mode 100644
index 0000000000..1efa4f7e4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-distance.html
@@ -0,0 +1,88 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL distance function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+GLSLGenerator.runFeatureTest({
+ feature: "distance",
+ args: "$(type) p1, $(type) p2",
+ baseArgs: "value$(field)",
+ testFunc: "$(func)($(type),$(type))",
+ emuFuncs: [
+ { type: "float",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return abs(p1 - p2);",
+ "}"].join("\n")
+ },
+ { type: "vec2",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return length(p1 - p2);",
+ "}"].join("\n")
+ },
+ { type: "vec3",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return length(p1 - p2);",
+ "}"].join("\n")
+ },
+ { type: "vec4",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return length(p1 - p2);",
+ "}"].join("\n")
+ }
+ ],
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).x * 8.0 - 4.0,",
+ " $(input).y * 8.0 - 4.0) / 8.0,",
+ " 0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " 0,",
+ " $(func)(",
+ " $(input).xy * 8.0 - 4.0,",
+ " $(input).wz * 8.0 - 4.0) / 8.0,",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " 0, 0,",
+ " $(func)(",
+ " $(input).xyz * 8.0 - 4.0,",
+ " $(input).yzw * 8.0 - 4.0) / 8.0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " vec4($(input).xyz, 0) * 8.0 - 4.0,",
+ " vec4(0, $(input).wzy) * 8.0 - 4.0) / 8.0,",
+ " 0, 0, 1);",
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html
new file mode 100644
index 0000000000..c29e43e464
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-dot.html
@@ -0,0 +1,90 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL dot function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+GLSLGenerator.runFeatureTest({
+ feature: "dot",
+ args: "$(type) p1, $(type) p2",
+ baseArgs: "value$(field)",
+ testFunc: "$(func)($(type),$(type))",
+ fragmentTolerance: 1,
+ emuFuncs: [
+ { type: "float",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return p1 * p2;",
+ "}"].join("\n")
+ },
+ { type: "vec2",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return p1.x * p2.x + p1.y * p2.y;",
+ "}"].join("\n")
+ },
+ { type: "vec3",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z;",
+ "}"].join("\n")
+ },
+ { type: "vec4",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z + p1.w * p2.w;",
+ "}"].join("\n")
+ }
+ ],
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).x * 8.0 - 4.0,",
+ " $(input).y * 8.0 - 4.0) / 8.0,",
+ " 0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " 0,",
+ " $(func)(",
+ " $(input).xy * 8.0 - 4.0,",
+ " $(input).wz * 8.0 - 4.0) / 8.0,",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " 0, 0,",
+ " $(func)(",
+ " $(input).xyz * 8.0 - 4.0,",
+ " $(input).yzw * 8.0 - 4.0) / 8.0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " vec4($(input).xyz, 0) * 8.0 - 4.0,",
+ " vec4(0, $(input).wzy) * 8.0 - 4.0) / 8.0,",
+ " 0, 0, 1);",
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html
new file mode 100644
index 0000000000..16a4e72ef7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-faceforward.html
@@ -0,0 +1,66 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL faceforward function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+GLSLGenerator.runFeatureTest({
+ feature: "faceforward",
+ args: "$(type) N, $(type) I, $(type) Nref",
+ baseArgs: "value$(field)",
+ testFunc: "$(func)($(type),$(type),$(type))",
+ simpleEmu: [
+ "$(type) $(func)_emu($(args)) {",
+ " return dot(Nref, I) < 0.0 ? N : -N;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).x * 2.0 - 1.0,",
+ " $(input).y * 2.0 - 1.0,",
+ " $(input).z * 2.0 - 1.0),",
+ " 0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xy * 2.0 - 1.0,",
+ " $(input).yz * 2.0 - 1.0,",
+ " $(input).zw * 2.0 - 1.0),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xyz * 2.0 - 1.0,",
+ " $(input).yzw * 2.0 - 1.0,",
+ " $(input).zwx * 2.0 - 1.0),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(",
+ " $(input).xyzw * 2.0 - 1.0,",
+ " $(input).yzwx * 2.0 - 1.0,",
+ " $(input).zwxy * 2.0 - 1.0);"
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html
new file mode 100644
index 0000000000..371ebd746b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-floor.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL floor function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "floor",
+ testFunc: "$(func)($(arg0))",
+ emuFunc: ["float $(func)_base(float value) {",
+ " return value - mod(value, 1.0);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 8.0 - 4.0) / 8.0 + 0.5,",
+ " $(func)($(input).y * 8.0 - 4.0) / 8.0 + 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * 8.0 - vec2(4, 4)) / 8.0 + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + ",
+ " vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + ",
+ " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html
new file mode 100644
index 0000000000..90e1c0bf13
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-fract.html
@@ -0,0 +1,50 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL fract function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "fract",
+ testFunc: "$(func)($(arg0))",
+ emuFunc: ["float $(func)_base(float value) {",
+ " return value - floor(value);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 4.0 - 2.0),",
+ " $(func)($(input).y * 4.0 - 2.0),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * 4.0 - vec2(2, 2)),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * 4.0 - vec3(2, 2, 2)),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * 4.0 - vec4(2, 2, 2, 2));"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html
new file mode 100644
index 0000000000..f3f04f4543
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-length.html
@@ -0,0 +1,87 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL length function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+GLSLGenerator.runFeatureTest({
+ feature: "length",
+ args: "$(type) value",
+ baseArgs: "value$(field)",
+ testFunc: "$(func)($(type))",
+ fragmentTolerance: 1,
+ emuFuncs: [
+ { type: "float",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return abs($(baseArgs));",
+ "}"].join("\n")
+ },
+ { type: "vec2",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return sqrt(",
+ " $(baseArgsX) * $(baseArgsX) + ",
+ " $(baseArgsY) * $(baseArgsY));",
+ "}"].join("\n")
+ },
+ { type: "vec3",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return sqrt(",
+ " $(baseArgsX) * $(baseArgsX) + ",
+ " $(baseArgsY) * $(baseArgsY) + ",
+ " $(baseArgsZ) * $(baseArgsZ));",
+ "}"].join("\n")
+ },
+ { type: "vec4",
+ code: [
+ "float $(func)_emu($(args)) {",
+ " return sqrt(",
+ " $(baseArgsX) * $(baseArgsX) + ",
+ " $(baseArgsY) * $(baseArgsY) + ",
+ " $(baseArgsZ) * $(baseArgsZ) + ",
+ " $(baseArgsW) * $(baseArgsW));",
+ "}"].join("\n")
+ }
+ ],
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 8.0 - 4.0) / 4.0,",
+ " $(func)($(input).y * 8.0 - 4.0) / 4.0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * 8.0 - 4.0) / 4.0,",
+ " 0, 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * 8.0 - 4.0) / 4.0,",
+ " 0, 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input) * 8.0 - 4.0) / 4.0, 0, 0, 1);",
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html
new file mode 100644
index 0000000000..d461c2ee16
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-lessThan.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL lessThan function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "lessThan",
+ args: "$(type) x, $(type) y",
+ bvecTest: true,
+ baseArgs: "x, y",
+ testFunc: "$(func)($(type), $(type))",
+ emuFunc: ["bool $(func) _base(float x, float y) {",
+ " return x < y;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["bvec2 r = bvec2($(func)($(input).xy, $(input).yw));",
+ "$(output) = vec4(",
+ " r.x ? 0.2: 0.8,",
+ " r.y ? 0.2: 0.8,",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * 8.0 - vec3(4, 4, 4)) / 8.0 + ",
+ " vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * 8.0 - vec4(4, 4, 4, 4)) / 8.0 + ",
+ " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html
new file mode 100644
index 0000000000..880fa24b48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-float.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL max-float function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "max",
+ args: "$(type) value, float maxValue",
+ baseArgs: "value$(field), maxValue",
+ testFunc: "$(func)($(arg0), float)",
+ emuFunc: ["float $(func)_base(float value, float maxValue) {",
+ " return value > maxValue ? value : maxValue;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x, 0.5),",
+ " $(func)($(input).y, 0.5),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy, 0.5),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input), 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html
new file mode 100644
index 0000000000..8d30dacdf9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-max-gentype.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL max-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "max",
+ args: "$(type) value, $(type) maxValue",
+ baseArgs: "value$(field), maxValue$(field)",
+ testFunc: "$(func)($(type), $(type))",
+ emuFunc: ["float $(func)_base(float value, float maxValue) {",
+ " return value > maxValue ? value : maxValue;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x, 0.5),",
+ " $(func)($(input).y, 0.5),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy, vec2(0.5, 0.5)),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz, vec3(0.5, 0.5, 0.5)),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input), vec4(0.5, 0.5, 0.5, 0.5));"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html
new file mode 100644
index 0000000000..1cb140ce45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-float.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL min-float function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "min",
+ args: "$(type) value, float divisor",
+ baseArgs: "value$(field), divisor",
+ testFunc: "$(func)($(arg0), float)",
+ emuFunc: ["float $(func)_base(float value, float divisor) {",
+ " return value < divisor ? value : divisor;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x, 0.5),",
+ " $(func)($(input).y, 0.5),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy, 0.5),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input), 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html
new file mode 100644
index 0000000000..4ff565112a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-min-gentype.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL min-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "min",
+ args: "$(type) value, $(type) minValue",
+ baseArgs: "value$(field), minValue$(field)",
+ testFunc: "$(func)($(type), $(type))",
+ emuFunc: ["float $(func)_base(float value, float minValue) {",
+ " return value < minValue ? value : minValue;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x, 0.5),",
+ " $(func)($(input).y, 0.5),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy, vec2(0.5, 0.5)),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz, vec3(0.5, 0.5, 0.5)),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input), vec4(0.5, 0.5, 0.5, 0.5));"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html
new file mode 100644
index 0000000000..34e70068c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-float.html
@@ -0,0 +1,54 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL mix-float function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "mix",
+ args: "$(type) startValue, $(type) endValue, float mixValue",
+ baseArgs: "startValue$(field), endValue$(field), mixValue",
+ testFunc: "$(func)($(type), $(type), float)",
+ emuFunc: [
+ "float $(func)_base(float startValue, float endValue, float mixValue) {",
+ " return startValue * (1.0 - mixValue) + endValue * mixValue;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(1.0, 0.0, $(input).x),",
+ " ($(func)(-2.0, 3.0, $(input).y) + 2.0) / 5.0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec2(1, -2), vec2(0, 2), $(input).z), ",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec3(1, -2, -1), vec3(0, 2, 3), $(input).y),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(vec4(1, -2, -1, 0.5), vec4(0, 2, 3, 1), $(input).w);"
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html
new file mode 100644
index 0000000000..2fa3330e7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mix-gentype.html
@@ -0,0 +1,54 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL mix-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "mix",
+ args: "$(type) startValue, $(type) endValue, $(type) mixValue",
+ baseArgs: "startValue$(field), endValue$(field), mixValue$(field)",
+ testFunc: "$(func)($(type), $(type), $(type))",
+ emuFunc: [
+ "float $(func)_base(float startValue, float endValue, float mixValue) {",
+ " return startValue * (1.0 - mixValue) + endValue * mixValue;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(1.0, 0.0, $(input).x),",
+ " ($(func)(-2.0, 3.0, $(input).y) + 2.0) / 5.0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec2(1, -2), vec2(0, 2), $(input).xy), ",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec3(1, -2, -1), vec3(0, 2, 3), $(input).xyz),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(vec4(1, -2, -1, 0.5), vec4(0, 2, 3, 1), $(input));"
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html
new file mode 100644
index 0000000000..83bcf76715
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-float.html
@@ -0,0 +1,53 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL mod-float function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "mod",
+ args: "$(type) value, float divisor",
+ baseArgs: "value$(field), divisor",
+ testFunc: "$(func)($(arg0), float)",
+ fragmentTolerance: 1,
+ emuFunc: ["float $(func)_base(float value, float divisor) {",
+ " return value - divisor * floor(value / divisor);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 6.0 - 3.0, 1.5) / 1.5,",
+ " $(func)($(input).y * 6.0 - 3.0, 1.5) / 1.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * 6.0 - vec2(3, 3), 1.5) / 1.5,",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * 6.0 - vec3(3, 3, 3), 1.5) / 1.5,",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * 6.0 - vec4(3, 3, 3, 3), 1.5) / 1.5;"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html
new file mode 100644
index 0000000000..9b562300b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-mod-gentype.html
@@ -0,0 +1,56 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL mod-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "mod",
+ args: "$(type) value, $(type) divisor",
+ baseArgs: "value$(field), divisor$(field)",
+ testFunc: "$(func)($(type), $(type))",
+ emuFunc: ["float $(func)_base(float value, float divisor) {",
+ " return value - divisor * floor(value / divisor);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tolerance: 1,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 6.0 - 3.0, 1.5) / 1.5,",
+ " $(func)($(input).y * 10.0 - 5.0, 2.1) / 2.1,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * vec2(6, 10) - vec2(3, 5), ",
+ " vec2(1.5, 2.1)) / vec2(1.5, 2.1),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * vec3(6, 10, 8) - vec3(3, 5, 4), ",
+ " vec3(1.5, 2.1, 3.2)) / vec3(1.5, 2.1, 3.2),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * vec4(6, 10, 8, 4) - vec4(3, 5, 4, 2),",
+ " vec4(1.5, 2.1, 3.2, 1.1)) / vec4(1.5, 2.1, 3.2, 1.1);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html
new file mode 100644
index 0000000000..bd5f8844d9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-normalize.html
@@ -0,0 +1,59 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL normalize function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "normalize",
+ args: "$(type) value",
+ testFunc: "$(func)($(type))",
+ simpleEmu: [
+ "$(type) $(func)_emu($(args)) {",
+ " return value / length(value);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tolerance: 1,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).x * 8.0 - 4.1) * 0.5 + 0.5,",
+ " 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xy * 8.0 - 4.1) * 0.5 + 0.5,",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xyz * 8.0 - 4.1) * 0.5 + 0.5,",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(",
+ " vec4($(input).xyz, 0) * 8.0 - 4.1) * 0.5 + 0.5 + vec4(0,0,0,0.5);",
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html
new file mode 100644
index 0000000000..70d9e557f7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-reflect.html
@@ -0,0 +1,61 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL reflect function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "reflect",
+ args: "$(type) I, $(type) N",
+ baseArgs: "value$(field)",
+ testFunc: "$(func)($(type),$(type))",
+ simpleEmu: [
+ "$(type) $(func)_emu($(args)) {",
+ " return I - 2.0 * dot(N, I) * N;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).x * 2.0 - 1.0,",
+ " $(input).y * 2.0 - 1.0),",
+ " 0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xy * 2.0 - 1.0,",
+ " $(input).yz * 2.0 - 1.0),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xyz * 2.0 - 1.0,",
+ " $(input).yzw * 2.0 - 1.0),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(",
+ " $(input).xyzw * 2.0 - 1.0,",
+ " $(input).yzwx * 2.0 - 1.0);"
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html
new file mode 100644
index 0000000000..1ee43b2f60
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-refract.html
@@ -0,0 +1,70 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL refract function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "refract",
+ args: "$(type) I, $(type) N, float eta",
+ baseArgs: "value$(field)",
+ testFunc: "$(func)($(type),$(type),float)",
+ simpleEmu: [
+ "$(type) $(func)_emu($(args)) {",
+ " float dotNI = dot(N, I);",
+ " float k = 1.0 - eta * eta * (1.0 - dotNI * dotNI);",
+ " if (k < 0.0) {",
+ " return $(type)(0.0);",
+ " }",
+ " return eta * I - (eta * dotNI * sqrt(k)) * N;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).x * 2.0 - 1.0,",
+ " $(input).y * 2.0 - 1.0,",
+ " $(input).w),",
+ " 0,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xy * 2.0 - 1.0,",
+ " $(input).yz * 2.0 - 1.0,",
+ " $(input).w),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(",
+ " $(input).xyz * 2.0 - 1.0,",
+ " $(input).yzw * 2.0 - 1.0,",
+ " $(input).w),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(",
+ " $(input).xyzw * 2.0 - 1.0,",
+ " $(input).yzwx * 2.0 - 1.0,",
+ " $(input).w);"
+ ].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html
new file mode 100644
index 0000000000..3185c647ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sign.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL sign function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "sign",
+ testFunc: "$(func)($(arg0))",
+ emuFunc: ["float $(func)_base(float value) {",
+ " if (value == 0.0) return 0.0;",
+ " return value > 0.0 ? 1.0 : -1.0;",
+ "}"].join("\n"),
+ gridRes: 4,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)($(input).x * 2.0 - 1.0) * 0.5 + 0.5,",
+ " 0.5,",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xy * 2.0 - vec2(1, 1)) * 0.5 + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)($(input).xyz * 2.0 - vec3(1, 1, 1)) * 0.5 + ",
+ " vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)($(input) * 2.0 - vec4(1, 1, 1, 1)) * 0.5 + ",
+ " vec4(0.5, 0.5, 0.5, 0.5);"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html
new file mode 100644
index 0000000000..b27e6ace1a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-sin.html
@@ -0,0 +1,96 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL sin function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var piConstants = [
+ "const float kPI = 3.14159265358979323846;",
+ "const float kHalfPI = (kPI * 0.5);",
+ "const float k2PI = (kPI * 2.0);"
+].join("\n");
+
+var kPI = Math.PI;
+var kHalfPI = Math.PI * 0.5;
+var k2PI = Math.PI * 2.0;
+var sin = Math.sin; // shorthand
+
+GLSLGenerator.runReferenceImageTest({
+ feature: "sin",
+ args: "$(type) value",
+ testFunc: "$(func)($(type))",
+ gridRes: 8,
+ tolerance: 4,
+ extra: piConstants,
+ tests: [
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).x * kHalfPI + kHalfPI),",
+ " $(func)($(input).y * kHalfPI),",
+ " 0,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ sin(x * kHalfPI + kHalfPI),
+ sin(y * kHalfPI),
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xy * vec2(kPI, k2PI)) * 0.5 + vec2(0.5, 0.5),",
+ " 0, 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ sin(x * kPI) * 0.5 + 0.5,
+ sin(y * k2PI) * 0.5 + 0.5,
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = vec4(",
+ " $(func)($(input).xyz * vec3(kPI, k2PI, 4.0)) * ",
+ " 0.5 + vec3(0.5, 0.5, 0.5),",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ sin(x * kPI) * 0.5 + 0.5,
+ sin(y * k2PI) * 0.5 + 0.5,
+ sin(z * 4.0) * 0.5 + 0.5,
+ 1 ];
+ },
+ },
+ {
+ source: ["$(output) = ",
+ " $(func)($(input) * vec4(k2PI, 4.0, kHalfPI, kPI)) *",
+ " 0.5 + vec4(0.5, 0.5, 0.5, 1);",
+ ].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ sin(x * k2PI) * 0.5 + 0.5,
+ sin(y * 4.0) * 0.5 + 0.5,
+ sin(z * kHalfPI) * 0.5 + 0.5,
+ sin(w * kPI) * 0.5 + 1 ];
+ },
+ },
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html
new file mode 100644
index 0000000000..a963ec0fb7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-float.html
@@ -0,0 +1,97 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL smoothstep-float function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+function clamp(value, min, max) {
+ return Math.max(min, Math.min(value, max));
+}
+
+function smoothstep(edge0, edge1, value) {
+ var t = clamp((value - edge0) / (edge1 - edge0), 0, 1);
+ return t * t * (3 - 2 * t);
+}
+
+GLSLGenerator.runReferenceImageTest({
+ feature: "smoothstep",
+ args: "float edge0, float edge1, $(type) value",
+ testFunc: "$(func)(float, float, $(type))",
+ gridRes: 8,
+ tolerance: 4,
+ tests: [
+ {
+ source: ["$(output) = vec4(",
+ " $(func)(0.3, 0.7, $(input).x),",
+ " $(func)(0.2, 0.8, $(input).y),",
+ " 0,",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ smoothstep(0.3, 0.7, x),
+ smoothstep(0.2, 0.8, y),
+ 0,
+ 1 ];
+ },
+ },
+ {
+ source: [ "$(output) = vec4(",
+ " $(func)(0.4, 0.8, $(input).xy),",
+ " 0, 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ smoothstep(0.4, 0.8, x),
+ smoothstep(0.4, 0.8, y),
+ 0,
+ 1 ];
+ },
+ },
+ {
+ // FIXME: this test seems to need a higher tolerance when run in a vertex shader.
+ source: [ "$(output) = vec4(",
+ " $(func)(0.3, 0.7, $(input).xyz),",
+ " 1);"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ smoothstep(0.3, 0.7, x),
+ smoothstep(0.3, 0.7, y),
+ smoothstep(0.3, 0.7, z),
+ 1 ];
+ },
+ tolerance: 12,
+ fragmentTolerance: 3,
+ },
+ {
+ // FIXME: this test seems to need a higher tolerance when run in a vertex shader.
+ source: ["$(output) = ",
+ " $(func)(0.3, 0.9, $(input));"].join("\n"),
+ generator: function(x, y, z, w) {
+ return [ smoothstep(0.3, 0.9, x),
+ smoothstep(0.3, 0.9, y),
+ smoothstep(0.3, 0.9, z),
+ smoothstep(0.3, 0.9, w) ];
+ },
+ tolerance: 7,
+ fragmentTolerance: 3,
+ },
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html
new file mode 100644
index 0000000000..84c992ed64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-smoothstep-gentype.html
@@ -0,0 +1,56 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL smoothstep-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+GLSLGenerator.runFeatureTest({
+ feature: "smoothstep",
+ args: "$(type) edge0, $(type) edge1, $(type) value",
+ baseArgs: "edge0$(field), edge1$(field), value$(field)",
+ testFunc: "$(func)($(type), $(type), $(type))",
+ emuFunc: ["float $(func)_base(float edge0, float edge1, float value) {",
+ " float t = clamp((value - edge0) / (edge1 - edge0), 0.0, 1.0);",
+ " return t * t * (3.0 - 2.0 * t);",
+ "}"].join("\n"),
+ gridRes: 8,
+ tolerance: 1,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(0.3, 0.7, $(input).x),",
+ " $(func)(0.2, 0.8, $(input).y),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec2(0.4, 0.6), vec2(0.8, 0.9), $(input).xy),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec3(0.3, 0.5, 0.7), vec3(0.7, 0.9, 1.0), $(input).xyz),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(vec4(0.3, 0.4, 0.5, 0.2), ",
+ " vec4(0.7, 0.6, 0.9, 0.8), ",
+ " $(input));"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html
new file mode 100644
index 0000000000..09f6e38612
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-float.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL step-float function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "step",
+ args: "float edge, $(type) value",
+ baseArgs: "edge, value$(field)",
+ testFunc: "$(func)(float, $(type))",
+ emuFunc: ["float $(func)_base(float edge, float value) {",
+ " return value < edge ? 0.0 : 1.0;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(0.3, $(input).x),",
+ " $(func)(0.7, $(input).y),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(0.4, $(input).xy),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(0.4, $(input).xyz),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)(0.4, $(input));"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html
new file mode 100644
index 0000000000..8b267265f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function-step-gentype.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL step-gentype function test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "step",
+ args: "$(type) edge, $(type) value",
+ baseArgs: "edge$(field), value$(field)",
+ testFunc: "$(func)($(type), $(type))",
+ emuFunc: ["float $(func)_base(float edge, float value) {",
+ " return value < edge ? 0.0 : 1.0;",
+ "}"].join("\n"),
+ gridRes: 8,
+ tests: [
+ ["$(output) = vec4(",
+ " $(func)(0.3, $(input).x),",
+ " $(func)(0.7, $(input).y),",
+ " 0,",
+ " 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec2(0.4, 0.6), $(input).xy),",
+ " 0, 1);"].join("\n"),
+ ["$(output) = vec4(",
+ " $(func)(vec3(0.3, 0.5, 0.7), $(input).xyz),",
+ " 1);"].join("\n"),
+ ["$(output) = ",
+ " $(func)( vec4(0.3, 0.4, 0.5, 0.2), $(input));"].join("\n")
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html
new file mode 100644
index 0000000000..51acf0dae2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/functions/glsl-function.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL function test test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+GLSLGenerator.runFeatureTest({
+ feature: "the_GLSL_test_harness",
+ testFunc: "pass through",
+ emuFunc: "float $(func)_base(float value) { return 0.0; }",
+ gridRes: 4,
+ tests: [
+ "$(output) = vec4($(input).x, 0, 0, 1);",
+ "$(output) = vec4(0, $(input).xy, 1);",
+ "$(output) = vec4($(input).xyz, 1);",
+ "$(output) = $(input);"
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt
new file mode 100644
index 0000000000..d700b29a56
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/00_test_list.txt
@@ -0,0 +1,65 @@
+add_int_float.vert.html
+add_int_mat2.vert.html
+add_int_mat3.vert.html
+add_int_mat4.vert.html
+add_int_vec2.vert.html
+add_int_vec3.vert.html
+add_int_vec4.vert.html
+add_ivec2_vec2.vert.html
+add_ivec3_vec3.vert.html
+add_ivec4_vec4.vert.html
+assign_int_to_float.vert.html
+assign_ivec2_to_vec2.vert.html
+assign_ivec3_to_vec3.vert.html
+assign_ivec4_to_vec4.vert.html
+construct_struct.vert.html
+divide_int_float.vert.html
+divide_int_mat2.vert.html
+divide_int_mat3.vert.html
+divide_int_mat4.vert.html
+divide_int_vec2.vert.html
+divide_int_vec3.vert.html
+divide_int_vec4.vert.html
+divide_ivec2_vec2.vert.html
+divide_ivec3_vec3.vert.html
+divide_ivec4_vec4.vert.html
+equal_int_float.vert.html
+equal_ivec2_vec2.vert.html
+equal_ivec3_vec3.vert.html
+equal_ivec4_vec4.vert.html
+function_int_float.vert.html
+function_ivec2_vec2.vert.html
+function_ivec3_vec3.vert.html
+function_ivec4_vec4.vert.html
+greater_than.vert.html
+greater_than_equal.vert.html
+less_than.vert.html
+less_than_equal.vert.html
+multiply_int_float.vert.html
+multiply_int_mat2.vert.html
+multiply_int_mat3.vert.html
+multiply_int_mat4.vert.html
+multiply_int_vec2.vert.html
+multiply_int_vec3.vert.html
+multiply_int_vec4.vert.html
+multiply_ivec2_vec2.vert.html
+multiply_ivec3_vec3.vert.html
+multiply_ivec4_vec4.vert.html
+not_equal_int_float.vert.html
+not_equal_ivec2_vec2.vert.html
+not_equal_ivec3_vec3.vert.html
+not_equal_ivec4_vec4.vert.html
+subtract_int_float.vert.html
+subtract_int_mat2.vert.html
+subtract_int_mat3.vert.html
+subtract_int_mat4.vert.html
+subtract_int_vec2.vert.html
+subtract_int_vec3.vert.html
+subtract_int_vec4.vert.html
+subtract_ivec2_vec2.vert.html
+subtract_ivec3_vec3.vert.html
+subtract_ivec4_vec4.vert.html
+ternary_int_float.vert.html
+ternary_ivec2_vec2.vert.html
+ternary_ivec3_vec3.vert.html
+ternary_ivec4_vec4.vert.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html
new file mode 100644
index 0000000000..6805834dcd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding integer to float should fail
+void main()
+{
+ float f = 1.0 + 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html
new file mode 100644
index 0000000000..89eed34cc1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding integer to mat2 should fail
+void main()
+{
+ mat2 f = mat2(1.0) + 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html
new file mode 100644
index 0000000000..6a921d4012
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding integer to mat3 should fail
+void main()
+{
+ mat3 f = mat3(1.0) + 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html
new file mode 100644
index 0000000000..17c134d096
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_mat4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding integer to mat4 should fail
+void main()
+{
+ mat4 f = mat4(1.0) + 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html
new file mode 100644
index 0000000000..d985b77e74
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding integer to vec2 should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) + 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html
new file mode 100644
index 0000000000..2db9028769
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding integer to vec3 should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) + 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html
new file mode 100644
index 0000000000..6cca2d9887
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_int_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding integer to vec4 should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) + 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..86cd54eb5d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec2_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding ivec2 to vec2 should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) + ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..dfcbe64110
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec3_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding ivec3 to vec3 should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) + ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..54c55be4f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/add_ivec4_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast adding ivec4 to vec4 should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) + ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html
new file mode 100644
index 0000000000..d3f835e218
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_int_to_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast assing int to float should fail
+void main()
+{
+ float f = -123;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html
new file mode 100644
index 0000000000..ccaed7e041
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec2_to_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast assigning ivec2 to vec2 should fail
+void main()
+{
+ vec2 f = ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html
new file mode 100644
index 0000000000..35f0ee4029
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec3_to_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast assigning ivec3 to vec3 should fail
+void main()
+{
+ vec3 f = ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html
new file mode 100644
index 0000000000..8745a50f50
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/assign_ivec4_to_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast assigning ivec4 to vec4 should fail
+void main()
+{
+ vec4 f = ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html
new file mode 100644
index 0000000000..c62dc731f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/construct_struct.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast from int to float in struct initializer should fail
+struct Foo {
+ float bar;
+};
+
+void main() {
+ Foo foo = Foo(1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html
new file mode 100644
index 0000000000..902b2e9669
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of float divided by int should fail
+void main()
+{
+ float f = 1.0 / 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html
new file mode 100644
index 0000000000..ac7a547249
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of mat2 divided by int should fail
+void main()
+{
+ mat2 f = mat2(1.0) / 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html
new file mode 100644
index 0000000000..2ad85937a2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of mat3 divided by int should fail
+void main()
+{
+ mat3 f = mat3(1.0) / 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html
new file mode 100644
index 0000000000..df22909191
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_mat4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of mat4 divided by int should fail
+void main()
+{
+ mat4 f = mat4(1.0) / 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html
new file mode 100644
index 0000000000..545ca3e341
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of vec2 divided by int should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) / 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html
new file mode 100644
index 0000000000..fa80b9836a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of vec3 divided by int should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) / 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html
new file mode 100644
index 0000000000..136de073c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_int_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of vec4 divided by int should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) / 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..de88cd680b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec2_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of vec2 divided by ivec2 should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) / ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..99e8a69a09
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec3_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of vec3 divided by ivec3 should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) / ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..2039ba9e1c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/divide_ivec4_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of vec4 divided by ivec4 should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) / ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html
new file mode 100644
index 0000000000..ebfdb6ae54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_int_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float in comparision should fail
+void main()
+{
+ bool b = 1.0 == 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..8d16edde32
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec2_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec2 to vec2 in comparision should fail
+void main()
+{
+ bool b = vec2(1.0, 2.0) == ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..a6951cb77f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec3_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec3 to vec3 in comparision should fail
+void main()
+{
+ bool b = vec3(1.0, 2.0, 3.0) == ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..39bdbafee2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/equal_ivec4_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec4 to vec4 in comparision should fail
+void main()
+{
+ bool b = vec4(1.0, 2.0, 3.0, 4.0) == ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html
new file mode 100644
index 0000000000..0a20eeab37
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_int_float.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float in function argument should fail
+float foo(float f) {
+ return f;
+}
+
+void main() {
+ float f = foo(1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..d4401c25c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec2_vec2.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec2 to vec2 in function argument should fail
+vec2 foo(vec2 f) {
+ return f;
+}
+
+void main() {
+ vec2 f = foo(ivec2(1, 2));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..1658ac5de8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec3_vec3.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec3 to vec3 in function argument should fail
+vec3 foo(vec3 f) {
+ return f;
+}
+
+void main() {
+ vec3 f = foo(ivec3(1, 2, 3));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..87e49c503d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/function_ivec4_vec4.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec4 to vec4 in function argument should fail
+vec4 foo(vec4 f) {
+ return f;
+}
+
+void main() {
+ vec4 f = foo(ivec4(1, 2, 3, 4));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html
new file mode 100644
index 0000000000..73c2164a08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float with greater than should fail
+void main()
+{
+ bool b = 1.0 > 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html
new file mode 100644
index 0000000000..58dfe5ed77
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/greater_than_equal.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float with greater than or equal to should fail
+void main()
+{
+ bool b = 1.0 >= 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html
new file mode 100644
index 0000000000..c1addc6316
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float with less than should fail
+void main()
+{
+ bool b = 1.0 < 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html
new file mode 100644
index 0000000000..a4a7573e40
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/less_than_equal.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float with less than or equal to should fail
+void main()
+{
+ bool b = 1.0 <= 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html
new file mode 100644
index 0000000000..5e14dba1af
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float in multiply should fail
+void main()
+{
+ float f = 1.0 * 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html
new file mode 100644
index 0000000000..36ec2ae995
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to mat2 in multiply should fail
+void main()
+{
+ mat2 f = mat2(1.0) * 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html
new file mode 100644
index 0000000000..a44379ccd7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to mat3 in multiply should fail
+void main()
+{
+ mat3 f = mat3(1.0) * 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html
new file mode 100644
index 0000000000..f33d147f36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_mat4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to mat4 in multiply should fail
+void main()
+{
+ mat4 f = mat4(1.0) * 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html
new file mode 100644
index 0000000000..ff83c9a657
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to vec2 in multiply should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) * 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html
new file mode 100644
index 0000000000..a39872f21f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to vec3 in multiply should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) * 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html
new file mode 100644
index 0000000000..8543b6d410
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_int_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to vec4 in multiply should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) * 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..03d797a333
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec2_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec2 to vec2 in multiply should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) * ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..92951c42f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec3_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec3 to vec3 in multiply should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) * ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..c5b3ce4741
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/multiply_ivec4_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec4 to vec4 in multiply should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) * ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html
new file mode 100644
index 0000000000..9a87af0ae4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_int_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float in not equal comparison should fail
+void main()
+{
+ bool b = 1.0 != 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..81984c9cca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec2_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec2 to vec2 in not equal comparison should fail
+void main()
+{
+ bool b = vec2(1.0, 2.0) != ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..3b1acc1527
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec3_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec3 to vec3 in not equal comparison should fail
+void main()
+{
+ bool b = vec3(1.0, 2.0, 3.0) != ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..a28210486c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/not_equal_ivec4_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec4 to vec4 in not equal comparison should fail
+void main()
+{
+ bool b = vec4(1.0, 2.0, 3.0, 4.0) != ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html
new file mode 100644
index 0000000000..0a9ee88498
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float in subtraction should fail
+void main()
+{
+ float f = 1.0 - 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html
new file mode 100644
index 0000000000..c6ac5e3fc0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to mat2 in subtraction should fail
+void main()
+{
+ mat2 f = mat2(1.0) - 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html
new file mode 100644
index 0000000000..bb04a9094b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to mat3 in subtraction should fail
+void main()
+{
+ mat3 f = mat3(1.0) - 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html
new file mode 100644
index 0000000000..e1dc2807b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_mat4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to mat4 in subtraction should fail
+void main()
+{
+ mat4 f = mat4(1.0) - 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html
new file mode 100644
index 0000000000..0a89e5f4e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to vec2 in subtraction should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) - 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html
new file mode 100644
index 0000000000..ec0fdc673b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to vec3 in subtraction should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) - 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html
new file mode 100644
index 0000000000..fc53e4ae55
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_int_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to vec4 in subtraction should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) - 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..770384258a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec2_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec2 to vec2 in subtraction should fail
+void main()
+{
+ vec2 f = vec2(1.0, 2.0) - ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..1203b09a3a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec3_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec3 to vec3 in subtraction should fail
+void main()
+{
+ vec3 f = vec3(1.0, 2.0, 3.0) - ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..e440bec91f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/subtract_ivec4_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec4 to vec4 in subtraction should fail
+void main()
+{
+ vec4 f = vec4(1.0, 2.0, 3.0, 4.0) - ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html
new file mode 100644
index 0000000000..7898bb92e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_int_float.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of int to float in ternary expression should fail
+void main()
+{
+ float f = true ? 1.0 : 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html
new file mode 100644
index 0000000000..08dca0cc02
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec2_vec2.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec2 to vec2 in ternary expression should fail
+void main()
+{
+ vec2 f = true ? vec2(1.0, 2.0) : ivec2(1, 2);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html
new file mode 100644
index 0000000000..a281e59296
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec3_vec3.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec3 to vec3 in ternary expression should fail
+void main()
+{
+ vec3 f = true ? vec3(1.0, 2.0, 3.0) : ivec3(1, 2, 3);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html
new file mode 100644
index 0000000000..ba2b669b8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/implicit/ternary_ivec4_vec4.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// implicit cast of ivec4 to vec4 in ternary expression should fail
+void main()
+{
+ vec4 f = true ? vec4(1.0, 2.0, 3.0, 4.0) : ivec4(1, 2, 3, 4);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt
new file mode 100644
index 0000000000..50802bf346
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/00_test_list.txt
@@ -0,0 +1,3 @@
+float_literal.vert.html
+--min-version 1.0.3 literal_precision.html
+overflow_leak.vert.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html
new file mode 100644
index 0000000000..86bbf8a883
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/float_literal.vert.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// parsing floating point literals should succeed
+void main() {
+ float zero = 0.0;
+ float fractionalConstant = 1.0;
+ float fractionalConstantExponent = 1.0e1;
+ float fractionalConstantPosExponent = 1.0e+1;
+ float fractionalConstantNegExponent = 1.0e-1;
+ float digitSequenceExponent = 1e1;
+ float digitSequencePosExponent = 1e+1;
+ float digitSequenceNegExponent = 1e-1;
+ float pointDigit = .1;
+ float digitPoint= 1.;
+ float upperCaseExponent = 1.0E1;
+ highp float posInRange = 4611686018427387903.; // 2^62 - 1
+ highp float posOutRange = 4611686018427387905.; // 2^62 + 1
+ highp float posHuge = 1E100;
+ highp float negInRange = -4611686018427387903.;
+ highp float negOutRange = -4611686018427387905.;
+ highp float negHuge = -1E100;
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html
new file mode 100644
index 0000000000..c2ccbbe1ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/literal_precision.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// parsing floating point literals with precision should fail
+void main() {
+ mediump float zero = mediump 0.0;
+ gl_Position = vec4(zero, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html
new file mode 100644
index 0000000000..b11960dd5f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/literals/overflow_leak.vert.html
@@ -0,0 +1,61 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshader" type="x-shader/x-vertex">
+// float literal overflow should not affect next literal parsing.
+precision mediump float;
+
+varying vec4 v_color;
+attribute vec4 a_position;
+void main() {
+ highp float floatOverflow = 1E100;
+ int i = 10;
+ if (i == 10)
+ v_color = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ v_color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+varying vec4 v_color;
+void main() {
+ gl_FragColor = v_color;
+}
+</script>
+<script>
+"use strict";
+description();
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+wtu.setupUnitQuad(gl);
+var program = wtu.setupProgram(gl, ["vshader", "fshader"]);
+if (!program)
+ testFailed("Fail to setup program");
+wtu.clearAndDrawUnitQuad(gl);
+wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt
new file mode 100644
index 0000000000..74693de0ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/00_test_list.txt
@@ -0,0 +1,3 @@
+glsl-mat4-to-mat3.html
+--min-version 1.0.3 glsl-mat3-construction.html
+--min-version 1.0.4 matrix-compound-multiply.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html
new file mode 100644
index 0000000000..bca1bdb706
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat3-construction.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL mat3 construction test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="shader_emu" type="something-not-js">
+mat3 mat3_emu(vec3 v3_0, vec3 v3_1, vec3 v3_2) {
+ mat3 test;
+ test[0] = v3_0;
+ test[1] = v3_1;
+ test[2] = v3_2;
+ return test;
+}
+</script>
+<script id="shader_test" type="something-not-js">
+ vec3 v3 = vec3($(input).xyz);
+ mat3 m3 = $(conversion)(v3, v3, v3);
+ vec3 c;
+ if ($(input).y < 0.33) {
+ c = m3[0];
+ } else if ($(input).y > 0.66) {
+ c = m3[1];
+ } else {
+ c = m3[2];
+ }
+ $(output) = vec4(c, 1);
+</script>
+<script>
+"use strict";
+// See resources glsl-generator runBasicTest for how this works
+var wtu = WebGLTestUtils;
+GLSLGenerator.runBasicTest({
+ gridRes: 8,
+ tests: [
+ {
+ name: "vec3 to mat3",
+ reference: {
+ shader: wtu.getScript("shader_test"),
+ subs: {
+ emu: wtu.getScript("shader_emu"),
+ conversion: "mat3_emu"
+ }
+ },
+ test: {
+ shader: wtu.getScript("shader_test"),
+ subs: {
+ conversion: "mat3"
+ },
+ }
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html
new file mode 100644
index 0000000000..4716c630cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/glsl-mat4-to-mat3.html
@@ -0,0 +1,70 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL mat4 to mat3 test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-generator.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="shader_emu" type="something-not-js">
+mat3 mat3_emu(mat4 m4) {
+ return mat3(
+ m4[0][0], m4[0][1], m4[0][2],
+ m4[1][0], m4[1][1], m4[1][2],
+ m4[2][0], m4[2][1], m4[2][2]);
+}
+</script>
+<script id="shader_test" type="something-not-js">
+ mat4 m4 = mat4($(input), $(input).yzwx, $(input).zwxy, $(input).wxyz);
+ mat3 m3 = $(conversion)(m4);
+ vec3 c;
+ if ($(input).y < 0.33) {
+ c = m3[0];
+ } else if ($(input).y > 0.66) {
+ c = m3[1];
+ } else {
+ c = m3[2];
+ }
+ $(output) = vec4(c, 1);
+</script>
+<script>
+"use strict";
+// See resources glsl-generator runBasicTest for how this works
+var wtu = WebGLTestUtils;
+GLSLGenerator.runBasicTest({
+ gridRes: 8,
+ tests: [
+ {
+ name: "mat4 to mat3",
+ reference: {
+ shader: wtu.getScript("shader_test"),
+ subs: {
+ emu: wtu.getScript("shader_emu"),
+ conversion: "mat3_emu"
+ }
+ },
+ test: {
+ shader: wtu.getScript("shader_test"),
+ subs: {
+ conversion: "mat3"
+ },
+ }
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html
new file mode 100644
index 0000000000..a485160c56
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/matrices/matrix-compound-multiply.html
@@ -0,0 +1,71 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Matrix compound multiplication 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>
+</head>
+<body>
+<canvas id="canvas" width="256" height="256"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+
+void main() {
+ gl_Position = vec4(aPosition, 1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ $(type) a = $(type)(0.0);
+ $(type) b = $(type)(0.0);
+ a[1][1] = 3.0; // 2nd column, 2nd row
+ b[0][1] = 2.0; // 1st column, 2nd row
+ $(type) c = a * b;
+ a *= b;
+ $(type) diffMat = a - c;
+ float diff = length(diffMat[0]) + length(diffMat[1]);
+ gl_FragColor = vec4(0.0, diff < 0.01 ? 1.0 : 0.0, 0.0, 1.0);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description("Matrix compound multiplication test comparing against normal multiplication.");
+debug("");
+var wtu = WebGLTestUtils;
+function test() {
+ var gl = wtu.create3DContext("canvas");
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ wtu.setupUnitQuad(gl);
+ var fshaderTemplate = wtu.getScript('fshader');
+
+ var types = ['mat2', 'mat3', 'mat4'];
+ for (var i = 0; i < types.length; ++i) {
+ debug('');
+ debug('Testing type ' + types[i]);
+ var fshaderSource = wtu.replaceParams(fshaderTemplate, {type: types[i]});
+ var program = wtu.setupProgram(gl, ['vshader', fshaderSource], ["aPosition"], undefined, true);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], 'should be green');
+ }
+};
+
+test();
+finishTest();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt
new file mode 100644
index 0000000000..c60310df14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/00_test_list.txt
@@ -0,0 +1,126 @@
+--max-version 1.9.9 attrib-location-length-limits.html
+--min-version 1.0.3 boolean_precision.html
+--min-version 1.0.4 const-variable-initialization.html
+embedded-struct-definitions-forbidden.html
+--min-version 1.0.4 empty-declaration.html
+empty_main.vert.html
+--min-version 1.0.3 expression-list-in-declarator-initializer.html
+--min-version 1.0.4 fragcolor-fragdata-invariant.html
+gl_position_unset.vert.html
+--min-version 1.0.4 global-variable-init.html
+# this test is intentionally disabled as it is too strict and to hard to simulate
+# glsl-2types-of-textures-on-same-unit.html
+glsl-function-nodes.html
+--min-version 1.0.2 glsl-vertex-branch.html
+glsl-long-variable-names.html
+--min-version 1.0.4 local-variable-shadowing-outer-function.html
+non-ascii-comments.vert.html
+non-ascii.vert.html
+--min-version 1.0.2 re-compile-re-link.html
+--min-version 1.0.4 sequence-operator-returns-constant.html
+--min-version 1.0.3 shader-precision-format-obeyed.html
+--min-version 1.0.3 shader-struct-scope.html
+--min-version 1.0.2 shader-uniform-packing-restrictions.html
+--min-version 1.0.2 shader-varying-packing-restrictions.html
+--min-version 1.0.2 shader-with-256-character-define.html
+shader-with-256-character-identifier.frag.html
+--min-version 1.0.2 --max-version 1.9.9 shader-with-257-character-define.html
+--max-version 1.9.9 shader-with-257-character-identifier.frag.html
+shader-with-_webgl-identifier.vert.html
+shader-with-arbitrary-indexing.frag.html
+shader-with-arbitrary-indexing.vert.html
+--min-version 1.0.2 shader-with-array-of-structs-containing-arrays.html
+--min-version 1.0.2 shader-with-array-of-structs-uniform.html
+shader-with-attrib-array.vert.html
+shader-with-attrib-struct.vert.html
+shader-with-clipvertex.vert.html
+--min-version 1.0.2 shader-with-conditional-scoping.html
+--min-version 1.0.2 shader-with-conditional-scoping-negative.html
+shader-with-default-precision.frag.html
+shader-with-default-precision.vert.html
+shader-with-dfdx-no-ext.frag.html
+shader-with-dfdx.frag.html
+--min-version 1.0.2 shader-with-do-loop.html
+shader-with-error-directive.html
+shader-with-explicit-int-cast.vert.html
+shader-with-float-return-value.frag.html
+--min-version 1.0.2 shader-with-for-scoping.html
+--min-version 1.0.2 shader-with-for-loop.html
+shader-with-frag-depth.frag.html
+shader-with-function-recursion.frag.html
+--min-version 1.0.2 shader-with-function-scoped-struct.html
+--min-version 1.0.2 shader-with-functional-scoping.html
+--min-version 1.0.2 shader-with-comma-assignment.html
+--min-version 1.0.2 shader-with-comma-conditional-assignment.html
+--min-version 1.0.4 shader-with-comma-separated-variable-declarations.html
+shader-with-glcolor.vert.html
+shader-with-gles-1.frag.html
+shader-with-gles-symbol.frag.html
+shader-with-glprojectionmatrix.vert.html
+shader-with-implicit-vec3-to-vec4-cast.vert.html
+shader-with-include.vert.html
+shader-with-int-return-value.frag.html
+shader-with-invalid-identifier.frag.html
+shader-with-ivec2-return-value.frag.html
+shader-with-ivec3-return-value.frag.html
+shader-with-ivec4-return-value.frag.html
+shader-with-limited-indexing.frag.html
+--min-version 1.0.2 shader-with-hex-int-constant-macro.html
+shader-with-long-line.html
+shader-with-non-ascii-error.frag.html
+--min-version 1.0.2 shader-with-non-reserved-words-1-of-8.html
+--min-version 1.0.2 shader-with-non-reserved-words-2-of-8.html
+--min-version 1.0.2 shader-with-non-reserved-words-3-of-8.html
+--min-version 1.0.2 shader-with-non-reserved-words-4-of-8.html
+--min-version 1.0.2 shader-with-non-reserved-words-5-of-8.html
+--min-version 1.0.2 shader-with-non-reserved-words-6-of-8.html
+--min-version 1.0.2 shader-with-non-reserved-words-7-of-8.html
+--min-version 1.0.2 shader-with-non-reserved-words-8-of-8.html
+shader-with-precision.frag.html
+--min-version 1.0.3 shader-with-preprocessor-whitespace.html
+shader-with-quoted-error.frag.html
+--min-version 1.0.2 shader-with-reserved-words.html
+--min-version 1.0.2 shader-with-similar-uniform-array-names.html
+--min-version 1.0.2 shader-with-too-many-uniforms.html
+--min-version 1.0.4 shader-with-two-initializer-types.html
+shader-with-undefined-preprocessor-symbol.frag.html
+shader-with-uniform-in-loop-condition.vert.html
+shader-with-vec2-return-value.frag.html
+shader-with-vec3-return-value.frag.html
+shader-with-vec4-return-value.frag.html
+--min-version 1.0.2 shader-with-vec4-vec3-vec4-conditional.html
+shader-with-version-100.frag.html
+shader-with-version-100.vert.html
+shader-with-version-120.vert.html
+shader-with-version-130.vert.html
+shader-with-webgl-identifier.vert.html
+--min-version 1.0.2 shader-with-while-loop.html
+shader-without-precision.frag.html
+--min-version 1.0.3 shaders-with-constant-expression-loop-conditions.html
+--min-version 1.0.3 shaders-with-invariance.html
+--min-version 1.0.3 shaders-with-name-conflicts.html
+--min-version 1.0.2 shaders-with-mis-matching-uniforms.html
+--min-version 1.0.2 shaders-with-mis-matching-varyings.html
+--min-version 1.0.2 shaders-with-missing-varyings.html
+--min-version 1.0.3 shaders-with-uniform-structs.html
+--min-version 1.0.2 shaders-with-varyings.html
+shared.html
+--min-version 1.0.4 struct-as-inout-parameter.html
+--min-version 1.0.4 struct-as-out-parameter.html
+struct-nesting-exceeds-maximum.html
+struct-nesting-under-maximum.html
+--max-version 1.9.9 uniform-location-length-limits.html
+--min-version 1.0.2 shader-with-short-circuiting-operators.html
+--min-version 1.0.2 shader-with-global-variable-precision-mismatch.html
+--min-version 1.0.2 large-loop-compile.html
+--min-version 1.0.3 struct-equals.html
+--min-version 1.0.4 struct-assign.html
+--min-version 1.0.3 struct-mixed-array-declarators.html
+--min-version 1.0.3 struct-nesting-of-variable-names.html
+--min-version 1.0.3 struct-specifiers-in-uniforms.html
+--min-version 1.0.3 struct-unary-operators.html
+--min-version 1.0.4 ternary-operator-on-arrays.html
+--min-version 1.0.3 ternary-operators-in-global-initializers.html
+--min-version 1.0.3 ternary-operators-in-initializers.html
+--min-version 1.0.4 uninitialized-local-global-variables.html
+--min-version 1.0.4 sampler-operand.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html
new file mode 100644
index 0000000000..1f18a2309b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/attrib-location-length-limits.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<title>WebGL attrib location length tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description">Verify limits on the lengths of attribute locations per WebGL spec, "Maximum Uniform and Attribute Location Lengths".</div>
+<div id="console"></div>
+<script id="goodVertexShader" type="x-shader/x-vertex">
+// A vertex shader where the needed attrib location is exactly 256 characters.
+attribute vec4 vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+
+void main()
+{
+ gl_Position = vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+}
+</script>
+<script id="badVertexShader" type="x-shader/x-vertex">
+// A vertex shader where the needed attrib location is 257 characters.
+attribute vec4 vPosition01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567;
+
+void main()
+{
+ gl_Position = vPosition01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567;
+}
+</script>
+<script id="fragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+description("test attrib location length limit");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+debug("Test attrib location underneath the length limit");
+var program = wtu.loadProgramFromScript(gl, "goodVertexShader", "fragmentShader");
+shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true');
+var attrib256Name = "vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456";
+gl.bindAttribLocation(program, 0, attrib256Name);
+wtu.glErrorShouldBe(gl, gl.NONE);
+var attribLoc = gl.getAttribLocation(program, attrib256Name);
+if (attribLoc == -1) {
+ testFailed("attrib location was -1, should not be");
+} else {
+ testPassed("attrib location should not be -1");
+}
+wtu.glErrorShouldBe(gl, gl.NONE);
+
+debug("Test attrib location over the length limit");
+var attrib257Name = attrib256Name + "7";
+
+debug("Shader compilation or link should fail");
+shouldBe('wtu.loadProgramFromScriptExpectError(gl, "badVertexShader", "fragmentShader")', 'null');
+wtu.glErrorShouldBe(gl, gl.NONE);
+
+debug("Attempt to bind too-long attrib location should produce error");
+program = gl.createProgram();
+gl.bindAttribLocation(program, 0, attrib257Name);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
+
+debug("Attempt to fetch too-long attrib location should produce error");
+program = wtu.loadStandardProgram(gl);
+shouldBe('gl.getAttribLocation(program, attrib257Name)', '-1');
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html
new file mode 100644
index 0000000000..da0c55a164
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/boolean_precision.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexTest" type="text/something-not-javascript">
+// parsing boolean variables with precision should fail
+void main() {
+ mediump $(type) fail = $(initializer);
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script id="fragmentTest" type="text/something-not-javascript">
+// parsing boolean variables with precision should fail
+void main() {
+ mediump $(type) fail = $(initializer);
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+var types = ['bool', 'bvec2', 'bvec3', 'bvec4'];
+var tests = [];
+var vTestSource = wtu.getScript("vertexTest");
+var fTestSource = wtu.getScript("fragmentTest");
+
+for (var i = 0; i < types.length; ++i) {
+ var initializer = 'true';
+ if (types[i] !== 'bool') {
+ initializer = types[i] + "(true";
+ for (var j = 0; j < i; ++j) {
+ initializer += ", true";
+ }
+ initializer += ")";
+ }
+ var subs = {type: types[i], initializer: initializer};
+ tests.push({
+ vShaderSource: wtu.replaceParams(vTestSource, subs),
+ vShaderSuccess: false,
+ passMsg: "vertex shader with a " + types[i] + " variable with precision should fail."
+ });
+ tests.push({
+ fShaderSource: wtu.replaceParams(fTestSource, subs),
+ fShaderSuccess: false,
+ passMsg: "fragment shader with a " + types[i] + " variable with precision should fail."
+ });
+}
+GLSLConformanceTester.runTests(tests);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html
new file mode 100644
index 0000000000..f9d8be7f70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/const-variable-initialization.html
@@ -0,0 +1,244 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>All valid constant expressions should be allowed in the initialization of const variables</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<script id="VertexTemplate" type="x-shader/x-vertex">
+precision mediump float;
+
+$(init)
+
+void main() {
+ const $(constType) c = $(constantExpression);
+ gl_Position = vec4(float(c$(constTypeToScalar)));
+}
+</script>
+<script id="FragmentTemplate" type="x-shader/x-fragment">
+precision mediump float;
+
+$(init)
+
+void main() {
+ const $(constType) c = $(constantExpression);
+ gl_FragColor = vec4(float(c$(constTypeToScalar)));
+}
+</script>
+</head>
+<body onload="runTest()">
+<div id="description"></div>
+<div id="console"></div>
+<script type="application/javascript">
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+
+// ESSL 1.00 spec section 4.3.2.
+// Initializers for const declarations must be a constant expression.
+
+// ESSL 1.00 spec section 5.10.
+// A constant expression is one of
+// * a literal value (e.g., 5 or true)
+// * a global or local variable qualified as const excluding function parameters
+// * an expression formed by an operator on operands that are constant expressions, including getting
+// an element of a constant vector or a constant matrix, or a field of a constant structure
+// * a constructor whose arguments are all constant expressions
+// * a built-in function call whose arguments are all constant expressions, with the exception of the
+// texture lookup functions.
+
+var binaryOpsGenTypeRValuesToGenType = [
+ '+',
+ '-',
+ '*',
+ '/'
+];
+
+var binaryOpsScalarsToBool = [
+ '<',
+ '>',
+ '<=',
+ '>='
+];
+
+var binaryOpsRValuesToBool = [
+ '==',
+ '!='
+];
+
+var binaryOpsBoolsToBool = [
+ '&&',
+ '^^',
+ '||'
+];
+
+var builtInsGenTypeToGenType = [
+ 'radians',
+ 'degrees',
+ 'sin',
+ 'cos',
+ 'tan',
+ 'asin',
+ 'acos',
+ 'atan',
+ 'exp',
+ 'log',
+ 'exp2',
+ 'log2',
+ 'sqrt',
+ 'inversesqrt',
+ 'abs',
+ 'sign',
+ 'floor',
+ 'ceil',
+ 'fract'
+];
+
+var builtIns2VecToBvec = [
+ 'lessThan',
+ 'lessThanEqual',
+ 'greaterThan',
+ 'greaterThanEqual',
+ 'equal',
+ 'notEqual'
+];
+
+var builtIns2GenTypeToGenType = [
+ 'atan',
+ 'pow',
+ 'mod',
+ 'min',
+ 'max',
+ 'step'
+];
+
+var runTest = function() {
+ var vsTemplate = document.getElementById('VertexTemplate').text;
+ var fsTemplate = document.getElementById('FragmentTemplate').text;
+
+ var tests = [];
+ var i;
+ var op;
+ var builtIn;
+
+ var pushTest = function(constType, constantExpression, expectSuccess, opt_init) {
+ if (opt_init === undefined) {
+ opt_init = '';
+ }
+ var constTypeToScalar = '';
+ if (constType.substring(0, 3) == 'vec' || constType.substring(1, 4) == 'vec') {
+ constTypeToScalar = '.x';
+ } else if (constType.substring(0, 3) == 'mat') {
+ constTypeToScalar = '[0].x';
+ } else if (constType == 'my_struct') {
+ constTypeToScalar = '.field';
+ }
+ var vs = wtu.replaceParams(vsTemplate, {constType: constType, constantExpression: constantExpression, constTypeToScalar: constTypeToScalar, init: opt_init});
+ var fs = wtu.replaceParams(fsTemplate, {constType: constType, constantExpression: constantExpression, constTypeToScalar: constTypeToScalar, init: opt_init});
+ tests.push({
+ vShaderSource: vs,
+ vShaderSuccess: expectSuccess,
+ linkSuccess: expectSuccess,
+ passMsg: "Assigning " + constantExpression + " to a const in a vertex shader should " + (expectSuccess ? "compile." : "fail compilation.")
+ });
+ tests.push({
+ fShaderSource: fs,
+ fShaderSuccess: expectSuccess,
+ linkSuccess: expectSuccess,
+ passMsg: "Assigning " + constantExpression + " to a const in a fragment shader should " + (expectSuccess ? "compile." : "fail compilation.")
+ });
+ }
+
+ // Handle some one of a kind cases first
+ pushTest('float', 'vec4(0.5).x', true);
+ pushTest('float', 'vec4(0.5)[0]', true);
+ pushTest('float', 'true ? 0.5 : 0.2', true);
+ pushTest('my_struct', 'my_struct(0.5, 0.2)', true, 'struct my_struct { float field; float field2; };');
+ pushTest('float', '(0.2, 0.5)', true);
+
+ pushTest('float', 'clamp(0.2, 0.3, 0.4)', true);
+ pushTest('float', 'mix(0.2, 0.3, 0.4)', true);
+ pushTest('float', 'smoothstep(0.2, 0.3, 0.4)', true);
+ pushTest('float', 'length(vec4(0.5))', true);
+ pushTest('float', 'distance(vec4(0.5), vec4(0.2))', true);
+ pushTest('float', 'dot(vec4(0.5), vec4(0.2))', true);
+ pushTest('vec3', 'cross(vec3(0.5), vec3(0.2))', true);
+ pushTest('vec4', 'normalize(vec4(0.5))', true);
+ pushTest('vec4', 'faceforward(vec4(0.2), vec4(0.3), vec4(0.4))', true);
+ pushTest('vec4', 'reflect(vec4(0.2), vec4(0.5))', true);
+ pushTest('vec4', 'refract(vec4(0.2), vec4(0.3), 0.4)', true);
+ pushTest('mat4', 'matrixCompMult(mat4(0.2), mat4(0.5))', true);
+
+ // Handle built-in constructors
+ for (i = 2; i <= 4; ++i) {
+ var vecType = 'vec' + i;
+ pushTest(vecType, vecType + '(0.5)', true);
+ pushTest('i' + vecType, 'i' + vecType + '(1)', true);
+ pushTest('b' + vecType, 'b' + vecType + '(true)', true);
+ pushTest('mat' + i, 'mat' + i + '(0.5)', true);
+ }
+
+ // Handle ops
+ for (i = 0; i < binaryOpsGenTypeRValuesToGenType.length; ++i) {
+ var op = binaryOpsGenTypeRValuesToGenType[i];
+ pushTest('float', '0.2 ' + op + ' 0.5', true);
+ pushTest('vec4', 'vec4(0.2) ' + op + ' vec4(0.5)', true);
+ pushTest('mat4', 'mat4(0.2) ' + op + ' mat4(0.5)', true);
+ }
+
+ for (i = 0; i < binaryOpsScalarsToBool.length; ++i) {
+ var op = binaryOpsScalarsToBool[i];
+ pushTest('bool', '0.2 ' + op + ' 0.5', true);
+ }
+
+ for (i = 0; i < binaryOpsRValuesToBool.length; ++i) {
+ var op = binaryOpsRValuesToBool[i];
+ pushTest('bool', '0.2 ' + op + ' 0.5', true);
+ pushTest('bool', 'vec4(0.2) ' + op + ' vec4(0.5)', true);
+ }
+
+ for (i = 0; i < binaryOpsBoolsToBool.length; ++i) {
+ var op = binaryOpsBoolsToBool[i];
+ pushTest('bool', 'false ' + op + ' true', true);
+ }
+
+ // Handle allowed built-ins
+ for (i = 0; i < builtInsGenTypeToGenType.length; ++i) {
+ builtIn = builtInsGenTypeToGenType[i];
+ pushTest('float', builtIn + '(0.5)', true);
+ pushTest('vec4', builtIn + '(vec4(0.5))', true);
+ }
+
+ for (i = 0; i < builtIns2VecToBvec.length; ++i) {
+ builtIn = builtIns2VecToBvec[i];
+ pushTest('bvec4', builtIn + '(vec4(0.2), vec4(0.5))', true);
+ }
+
+ for (i = 0; i < builtIns2GenTypeToGenType.length; ++i) {
+ builtIn = builtIns2GenTypeToGenType[i];
+ pushTest('float', builtIn + '(0.2, 0.5)', true);
+ pushTest('vec4', builtIn + '(vec4(0.2), vec4(0.5))', true);
+ }
+
+ // Include some expressions with a constant variable reference
+ pushTest('float', 'cc', true, 'const float cc = 0.5;');
+ pushTest('float', 'cc + cc2', true, 'const float cc = 0.5; const float cc2 = 0.2;');
+ pushTest('float', 'sqrt(cc)', true, 'const float cc = 0.5;');
+
+ GLSLConformanceTester.runTests(tests);
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html
new file mode 100644
index 0000000000..dc945fe2c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/embedded-struct-definitions-forbidden.html
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// embedded structure definitions are forbidden per GLSL ES section 4.1.8, "Structures", and should fail
+struct nesting1 {
+ struct nesting2 {
+ vec4 vector;
+ } field2;
+};
+
+uniform nesting1 uniform1;
+void main()
+{
+ gl_Position = uniform1.field2.vector;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html
new file mode 100644
index 0000000000..785180f7e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty-declaration.html
@@ -0,0 +1,111 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - empty declarations</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexEmptyDeclaration" type="text/something-not-javascript">
+// Vertex shader with an empty declaration should succeed.
+// See shading language grammar rules init_declarator_list and single_declaration
+// in ESSL specs.
+// Empty declarations are a side effect of how grammar for structs is defined.
+void main() {
+ float;
+ gl_Position = vec4(0.0);
+}
+</script>
+<script id="vertexEmptyDeclarationPlus" type="text/something-not-javascript">
+// Vertex shader with an empty declaration followed by declarator should succeed.
+// See shading language grammar rules init_declarator_list and single_declaration
+// in ESSL specs.
+void main() {
+ float, a = 0.0;
+ gl_Position = vec4(a);
+}
+</script>
+<script id="vertexEmptyStructDeclarationPlus" type="text/something-not-javascript">
+// Vertex shader with an empty declaration followed by declarator should succeed.
+// See shading language grammar rules init_declarator_list and single_declaration
+// in ESSL specs.
+
+struct S {
+ float member;
+}, a;
+
+void main() {
+ a.member = 0.0;
+ gl_Position = vec4(a.member);
+}
+</script>
+<script id="vertexEmptyDeclarationInStruct" type="text/something-not-javascript">
+// Vertex shader with an empty declaration inside struct should fail.
+// In-struct declarations have different grammar from declarations outside structs.
+struct S {
+ float;
+ float a;
+};
+
+void main() {
+ gl_Position = vec4(0.0);
+}
+</script>
+<script id="vertexEmptyDeclarationPlusInStruct" type="text/something-not-javascript">
+// Vertex shader with an empty declaration inside struct should fail.
+// In-struct declarations have different grammar from declarations outside structs.
+struct S {
+ float, a;
+ float b;
+};
+
+void main() {
+ gl_Position = vec4(0.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTests([
+ { vShaderId: 'vertexEmptyDeclaration',
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Vertex shader with an empty declaration should succeed'
+ },
+ { vShaderId: 'vertexEmptyDeclarationPlus',
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Vertex shader with an empty declaration followed by declarator should succeed'
+ },
+ { vShaderId: 'vertexEmptyStructDeclarationPlus',
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Vertex shader with an empty struct declaration followed by declarator should succeed'
+ },
+ { vShaderId: 'vertexEmptyDeclarationInStruct',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'Vertex shader with an empty declaration in a struct should fail'
+ },
+ { vShaderId: 'vertexEmptyDeclarationPlusInStruct',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'Vertex shader with an empty declaration followed by declarator in a struct should fail'
+ }
+]);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html
new file mode 100644
index 0000000000..b8c308d2d9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/empty_main.vert.html
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader with an empty main() should succeed
+void main() { }
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html
new file mode 100644
index 0000000000..3db79d94e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/expression-list-in-declarator-initializer.html
@@ -0,0 +1,68 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<title></title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+precision mediump float;
+void main() {
+ $(type) a, b;
+ $(type) c = (b = $(initializer), a = b);
+ gl_FragColor = $(asVec4);
+}
+</script>
+<script>
+"use strict";
+description("Verifies expression lists in declarator initializers work correctly.");
+var tests = [];
+var wtu = WebGLTestUtils;
+var typeInfos = [
+ { type: 'float', initializer: '1.0', asVec4: 'vec4(0.0,$(var),0.0,1.0)' },
+ { type: 'vec2', initializer: 'vec2(0.0, 1.0)', asVec4: 'vec4($(var),0.0,1.0)' },
+ { type: 'vec3', initializer: 'vec3(0.0, 1.0, 0.0)', asVec4: 'vec4($(var),1.0)' },
+ { type: 'vec4', initializer: 'vec4(0.0, 1.0, 0.0, 1.0)', asVec4: '$(var)' },
+ { type: 'int', initializer: '1', asVec4: 'vec4(0.0,$(var),0.0,1.0)' },
+ { type: 'ivec2', initializer: 'ivec2(0, 1)', asVec4: 'vec4($(var),0.0,1.0)' },
+ { type: 'ivec3', initializer: 'ivec3(0, 1, 0)', asVec4: 'vec4($(var),1.0)' },
+ { type: 'ivec4', initializer: 'ivec4(0, 1, 0, 1)', asVec4: 'vec4($(var))' },
+ { type: 'bool', initializer: 'true', asVec4: 'vec4(0.0,$(var),0.0,1.0)' },
+ { type: 'bvec2', initializer: 'bvec2(false, true)', asVec4: 'vec4($(var),0.0,1.0)' },
+ { type: 'bvec3', initializer: 'bvec3(false, true, false)', asVec4: 'vec4($(var),1.0)' },
+ { type: 'bvec4', initializer: 'bvec4(false,true,false,true)',asVec4: 'vec4($(var))' },
+];
+// Ensure that each variable is properly initialized to green, not just c.
+['a', 'b', 'c'].forEach(function(varName) {
+ typeInfos.forEach(function (typeInfo) {
+ var replaceParams = {
+ type: typeInfo.type,
+ initializer: typeInfo.initializer,
+ asVec4: wtu.replaceParams(typeInfo.asVec4, {var: varName}),
+ };
+ tests.push({
+ fShaderSource: wtu.replaceParams(wtu.getScript('fragmentShader'), replaceParams),
+ passMsg: typeInfo.type + ' with contents of ' + varName + ' rendered',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render:true
+ });
+ });
+});
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/fragcolor-fragdata-invariant.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/fragcolor-fragdata-invariant.html
new file mode 100644
index 0000000000..d936872514
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/fragcolor-fragdata-invariant.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - gl_FragColor and gl_FragData both declared as invariant</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Declaring both gl_FragColor and gl_FragData invariant should succeed.
+precision mediump float;
+
+// Static write of both gl_FragColor and gl_FragData is disallowed. However, simply declaring a variable invariant is not really accessing the variable, so it should be ok.
+invariant gl_FragColor;
+invariant gl_FragData;
+
+void main()
+{
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html
new file mode 100644
index 0000000000..6e462c123a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/gl_position_unset.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader without gl_Position being written should succeed
+void main() {
+ vec4 a = vec4(0.0, 0.0, 0.0, 1.0);
+ float f = a.x;
+ a.y = f;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html
new file mode 100644
index 0000000000..99e7417f69
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/global-variable-init.html
@@ -0,0 +1,323 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Global variable initializer restrictions</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="constGlobalShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+const float c = 1.0;
+float f = c;
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="globalShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+float c = 1.0;
+float f = c;
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="uniformShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+uniform float u;
+float f = u;
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="builtinFunctionShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+float c = 1.0;
+float f = sin(c);
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="builtinTextureFunctionShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+uniform sampler2D s;
+float f = texture2DLod(s, vec2(0.5, 0.5), 0.0).x;
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="attributeShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+float f = aPosition.x;
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="userDefinedFunctionShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+float foo() {
+ return 1.0;
+}
+float f = foo();
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="varyingShader" type="x-shader/x-fragment">
+precision mediump float;
+varying float v;
+float f = v;
+
+void main() {
+ gl_FragColor = vec4(f);
+}
+</script>
+<script id="globalLValueShader" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+float c = 1.0;
+float f = (c = 0.0);
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="globalLValueShader2" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 aPosition;
+varying float v;
+
+float c = 1.0;
+float f = (c++);
+
+void main() {
+ v = f;
+ gl_Position = aPosition;
+}
+</script>
+<script id="globalNonConstTernary" type="x-shader/x-fragment">
+precision mediump float;
+float green = 1.0;
+float black = 0.0;
+float f = true ? green : black;
+
+void main() {
+ gl_FragColor = vec4(0.0, f, 0.0, 1.0);
+}
+</script>
+<script id="globalUniformTernary" type="x-shader/x-fragment">
+precision mediump float;
+uniform float u_zero;
+float green = 1.0 + u_zero;
+float f = true ? green : u_zero;
+
+void main() {
+ gl_FragColor = vec4(0.0, f, 0.0, 1.0);
+}
+</script>
+<script id="globalUniformTernary2" type="x-shader/x-fragment">
+precision mediump float;
+uniform float u_zero;
+float green = 1.0;
+float f = (u_zero < 0.1) ? green : 0.0;
+
+void main() {
+ gl_FragColor = vec4(0.0, f, 0.0, 1.0);
+}
+</script>
+<script id="globalUniformStruct" type="x-shader/x-fragment">
+precision mediump float;
+struct S {
+ float zero;
+ int one;
+};
+uniform S us;
+S s = us;
+
+void main() {
+ float green = (s.one == 1) ? 1.0 : 0.0;
+ gl_FragColor = vec4(0.0, green, 0.0, 1.0);
+}
+</script>
+<script id="builtInConstant" type="x-shader/x-fragment">
+precision mediump float;
+int i = gl_MaxFragmentUniformVectors;
+
+void main() {
+ float green = (i > 0) ? 1.0 : 0.0;
+ gl_FragColor = vec4(0.0, green, 0.0, 1.0);
+}
+</script>
+<script id="builtInNonConstant" type="x-shader/x-fragment">
+precision mediump float;
+vec4 v = gl_FragCoord;
+
+void main() {
+ gl_FragColor = v;
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description();
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "constGlobalShader",
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "A const global in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ vShaderId: "globalShader",
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Another global in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ vShaderId: "uniformShader",
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "A uniform in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ vShaderId: "builtinFunctionShader",
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "A built-in math function in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ vShaderId: "builtinTextureFunctionShader",
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "A texture lookup function in a global variable initializer should not be accepted by WebGL."
+ },
+ {
+ vShaderId: "attributeShader",
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "An attribute in a global variable initializer should not be accepted by WebGL."
+ },
+ {
+ vShaderId: "userDefinedFunctionShader",
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "A user-defined function call in a global variable initializer should not be accepted by WebGL."
+ },
+ {
+ vShaderId: "constGlobalShader",
+ vShaderSuccess: true,
+ fShaderId: "varyingShader",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "A varying in a global variable initializer should not be accepted by WebGL."
+ },
+ {
+ vShaderId: "globalLValueShader",
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Another global as an l-value in a global variable initializer should not be accepted by WebGL."
+ },
+ {
+ vShaderId: "globalLValueShader2",
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Another global as an l-value (parameter of ++) in a global variable initializer should not be accepted by WebGL."
+ },
+ {
+ fShaderId: "globalNonConstTernary",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Non-const global variables as operands for a ternary operator in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ fShaderId: "globalUniformTernary",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "A uniform as the second operand for a ternary operator in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ fShaderId: "globalUniformTernary2",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Referencing a uniform inside the first operand for a ternary operator in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ fShaderId: "globalUniformStruct",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ uniforms: [
+ { name: 'us.one', functionName: 'uniform1i', value: 1 }
+ ],
+ passMsg: "A global struct initialized with a uniform struct should be accepted by WebGL."
+ },
+ {
+ fShaderId: "builtInConstant",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Referencing a built-in constant in a global variable initializer should be accepted by WebGL."
+ },
+ {
+ fShaderId: "builtInNonConstant",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Referencing a built-in non-constant in a global variable initializer should not be accepted by WebGL."
+ }
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html
new file mode 100644
index 0000000000..1e8aebde39
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-2types-of-textures-on-same-unit.html
@@ -0,0 +1,132 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+<meta charset="utf-8">
+ <title>WebGL GLSL 2 types of textures on same unit conformance 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>
+</head>
+<body>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<canvas id="canvas2d" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform sampler2D tex2d;
+uniform samplerCube texCube;
+varying vec2 texCoord;
+void main()
+{
+ gl_FragColor = texture2D(tex2d, texCoord) +
+ textureCube(texCube, vec3(0,1,0));
+}
+</script>
+
+ <script>
+ "use strict";
+function init()
+{
+ description(
+ "Tests that using 2 types of textures on the same texture unit" +
+ "and referencing them both in the same program fails as per" +
+ "OpenGL ES 2.0.24 spec section 2.10.4, Samplers subsection.");
+
+ var canvas2d = document.getElementById("canvas2d");
+ var ctx2d = canvas2d.getContext("2d");
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition", "texCoord0"]);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([
+ -1, 1,0, 1,1,0, -1,-1,0,
+ -1,-1,0, 1,1,0, 1,-1,0]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([
+ 0,0, 1,0, 0,1,
+ 0,1, 1,0, 1,1]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+
+ // Make texture unit 1 active.
+ gl.activeTexture(gl.TEXTURE1);
+
+ // Make a 2d texture
+ var tex2d = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex2d);
+ ctx2d.fillStyle = "rgba(0, 0, 255, 255)";
+ ctx2d.fillRect(0, 0, 1, 1);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+
+ // make a cube texture
+ var texCube = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube);
+ ctx2d.fillStyle = "rgba(0, 255, 0, 64)";
+ ctx2d.fillRect(0, 0, 1, 1);
+ var targets = [
+ 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 ii = 0; ii < targets.length; ++ii) {
+ gl.texImage2D(targets[ii], 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+ }
+
+ var tex2dLoc = gl.getUniformLocation(program, "tex2d");
+ var texCubeLoc = gl.getUniformLocation(program, "texCube");
+ gl.uniform1i(tex2dLoc, 1);
+ gl.uniform1i(texCubeLoc, 1);
+
+ gl.clearColor(1,0,0,1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ for (var ii = 0; ii < 4; ++ii) {
+ var x = ii % 2;
+ var y = Math.floor(ii / 2);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "drawing with 2 different targets on the same texture unit should generate INVALID_VALUE");
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html
new file mode 100644
index 0000000000..566356fc43
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-function-nodes.html
@@ -0,0 +1,134 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL function nodes Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+
+<script id="vshaderFunction" type="x-shader/x-vertex">
+attribute vec4 aPosition;
+varying vec4 vColor;
+
+float sign_emu(float value) {
+ if (value == 0.0) return 0.0;
+ return value > 0.0 ? 1.0 : -1.0;
+}
+
+void main()
+{
+ gl_Position = aPosition;
+ vec2 texcoord = vec2(aPosition.xy * 0.5 + vec2(0.5, 0.5));
+ vec4 color = vec4(
+ texcoord,
+ texcoord.x * texcoord.y,
+ (1.0 - texcoord.x) * texcoord.y * 0.5 + 0.5);
+ vColor = vec4(
+ sign_emu(color.x * 2.0 - 1.0) * 0.5 + 0.5,
+ sign_emu(color.y * 2.0 - 1.0) * 0.5 + 0.5,
+ 0,
+ 1);
+}
+</script>
+
+<script id="vshaderMacro" type="x-shader/x-vertex">
+attribute vec4 aPosition;
+varying vec4 vColor;
+
+#define sign_emu(value) ((value) == 0.0 ? 0.0 : ((value) > 0.0 ? 1.0 : -1.0))
+
+void main()
+{
+ gl_Position = aPosition;
+ vec2 texcoord = vec2(aPosition.xy * 0.5 + vec2(0.5, 0.5));
+ vec4 color = vec4(
+ texcoord,
+ texcoord.x * texcoord.y,
+ (1.0 - texcoord.x) * texcoord.y * 0.5 + 0.5);
+ vColor = vec4(
+ sign_emu(color.x * 2.0 - 1.0) * 0.5 + 0.5,
+ sign_emu(color.y * 2.0 - 1.0) * 0.5 + 0.5,
+ 0,
+ 1);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 vColor;
+void main()
+{
+ gl_FragColor = vColor;
+}
+</script>
+</head>
+<body>
+<canvas id="canvasFunction" width="50" height="50"></canvas>
+<canvas id="canvasMacro" width="50" height="50"></canvas>
+<div id="description">This tests against a Mac driver bug related to function calls.</div>
+<div id="console"></div>
+<script>
+"use strict";
+var width = 50;
+var height = 50;
+var wtu = WebGLTestUtils;
+
+function drawAndRead(canvasID, vshaderID, buffer)
+{
+ var gl = wtu.create3DContext(canvasID);
+ var program = wtu.setupProgram(gl, [vshaderID, "fshader"], ["aPosition"]);
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buffer);
+ if (gl.getError() != gl.NO_ERROR)
+ return false;
+ return true;
+}
+
+function compareRendering(buffer1, buffer2, tol)
+{
+ for (var i = 0; i < width * height * 4; ++i) {
+ if (Math.abs(buffer1[i] - buffer2[i]) > tol)
+ return false;
+ }
+ return true;
+}
+
+function init()
+{
+ description("tests function nodes");
+
+ var bufFunction = new Uint8Array(width * height * 4);
+ var bufMacro = new Uint8Array(width * height * 4);
+
+ if (drawAndRead("canvasFunction", "vshaderFunction", bufFunction) == false ||
+ drawAndRead("canvasMacro", "vshaderMacro", bufMacro) == false) {
+ testFailed("Setup failed");
+ } else {
+ if (compareRendering(bufFunction, bufMacro, 4) == false)
+ testFailed("Rendering results are different");
+ else
+ testPassed("Rendering results are the same");
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html
new file mode 100644
index 0000000000..31e88027a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-long-variable-names.html
@@ -0,0 +1,227 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>glsl long variable name mapping tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader_shared_uniform" type="x-shader/x-vertex">
+attribute vec3 vPosition;
+uniform mediump float value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+void main()
+{
+ gl_Position = vec4(vPosition, value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890);
+}
+</script>
+
+<script id="fshader_shared_uniform" type="x-shader/x-fragment">
+precision mediump float;
+uniform float value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+void main()
+{
+ gl_FragColor = vec4(1.0, 0.0, value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, 1.0);
+}
+</script>
+
+<script id="vshader_uniform_array" type="x-shader/x-vertex">
+attribute vec3 vPosition;
+void main()
+{
+ gl_Position = vec4(vPosition, 1.0);
+}
+</script>
+
+<script id="fshader_uniform_array" type="x-shader/x-fragment">
+precision mediump float;
+uniform float color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[2];
+void main()
+{
+ gl_FragColor = vec4(color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0], color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1], 1.0, 1.0);
+}
+</script>
+
+<script id="vshader_varying" type="x-shader/x-vertex">
+attribute vec3 vPosition;
+varying float value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+void main()
+{
+ value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 = 1.0;
+ gl_Position = vec4(vPosition, 1.0);
+}
+</script>
+
+<script id="fshader_varying" type="x-shader/x-fragment">
+precision mediump float;
+varying float value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
+void main()
+{
+ gl_FragColor = vec4(value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890, 0.0, 1.0, 1.0);
+}
+</script>
+
+<script id="vshader_local" type="x-shader/x-vertex">
+attribute vec3 vPosition;
+void main()
+{
+ for (int i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 = 0; i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 < 1; ++i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234)
+ {
+ gl_Position = vec4(vPosition, 1.0);
+ }
+}
+</script>
+
+<script id="fshader_local" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ for (int i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 = 0; i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234 < 1; ++i012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234)
+ {
+ gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);
+ }
+}
+</script>
+
+<script id="vshader_attrib" type="x-shader/x-vertex">
+attribute vec3 vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+void main()
+{
+ gl_Position = vec4(vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456, 1.0);
+}
+</script>
+
+<script id="fshader_attrib" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+description("Verify that shader long variable names works fine if they are within 256 characters.");
+
+debug("Test same long uniform name in both vertex shader and fragment shader");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader_shared_uniform", "fshader_shared_uniform"], ["vPosition"]);
+shouldBeNonNull("gl");
+shouldBe("gl.getError()", "gl.NO_ERROR");
+var prog = gl.getParameter(gl.CURRENT_PROGRAM);
+shouldBeNonNull("prog");
+var valueLoc = gl.getUniformLocation(prog, "value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
+shouldBeNonNull("valueLoc");
+shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_UNIFORMS)", "1");
+var activeUniform = gl.getActiveUniform(prog, 0);
+shouldBeNonNull("activeUniform");
+shouldBe("activeUniform.type", "gl.FLOAT");
+shouldBe("activeUniform.size", "1");
+shouldBe("activeUniform.name", "'value01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'");
+gl.uniform1f(valueLoc, 1.0);
+drawAndCheckPixels(gl);
+shouldBe("gl.getError()", "gl.NO_ERROR");
+debug("");
+
+debug("Test long uniform array name");
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader_uniform_array", "fshader_uniform_array"], ["vPosition"]);
+shouldBeNonNull("gl");
+shouldBe("gl.getError()", "gl.NO_ERROR");
+var prog = gl.getParameter(gl.CURRENT_PROGRAM);
+shouldBeNonNull("prog");
+var redLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]");
+shouldBeNonNull("redLoc");
+var greenLoc = gl.getUniformLocation(prog, "color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[1]");
+shouldBeNonNull("greenLoc");
+shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_UNIFORMS)", "1");
+var activeUniform = gl.getActiveUniform(prog, 0);
+shouldBeNonNull("activeUniform");
+shouldBe("activeUniform.type", "gl.FLOAT");
+shouldBe("activeUniform.size", "2");
+shouldBe("activeUniform.name", "'color01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567[0]'");
+gl.uniform1f(redLoc, 1.0);
+gl.uniform1f(greenLoc, 0.0);
+drawAndCheckPixels(gl);
+shouldBe("gl.getError()", "gl.NO_ERROR");
+debug("");
+
+debug("Test long varying name");
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader_varying", "fshader_varying"], ["vPosition"]);
+shouldBeNonNull("gl");
+shouldBe("gl.getError()", "gl.NO_ERROR");
+var prog = gl.getParameter(gl.CURRENT_PROGRAM);
+shouldBeNonNull("prog");
+drawAndCheckPixels(gl);
+shouldBe("gl.getError()", "gl.NO_ERROR");
+debug("");
+
+debug("Test long local variable name");
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader_varying", "fshader_varying"], ["vPosition"]);
+shouldBeNonNull("gl");
+shouldBe("gl.getError()", "gl.NO_ERROR");
+var prog = gl.getParameter(gl.CURRENT_PROGRAM);
+shouldBeNonNull("prog");
+drawAndCheckPixels(gl);
+shouldBe("gl.getError()", "gl.NO_ERROR");
+debug("");
+
+debug("Test long attribute name");
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader_attrib", "fshader_attrib"], ["vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456"]);
+shouldBeNonNull("gl");
+shouldBe("gl.getError()", "gl.NO_ERROR");
+var prog = gl.getParameter(gl.CURRENT_PROGRAM);
+shouldBeNonNull("prog");
+shouldBe("gl.getProgramParameter(prog, gl.ACTIVE_ATTRIBUTES)", "1");
+var activeAttrib = gl.getActiveAttrib(prog, 0);
+shouldBeNonNull("activeAttrib");
+shouldBe("activeAttrib.size", "1");
+shouldBe("activeAttrib.type", "gl.FLOAT_VEC3");
+shouldBe("activeAttrib.name", "'vPosition0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456'");
+drawAndCheckPixels(gl);
+shouldBe("gl.getError()", "gl.NO_ERROR");
+debug("");
+
+function drawAndCheckPixels(gl)
+{
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ // Test several locations
+ // First line should be all black
+ wtu.checkCanvasRect(gl, 0, 0, 50, 1, [0, 0, 0, 0]);
+
+ // Line 15 should be magenta for at least 10 pixels starting 20 pixels in
+ wtu.checkCanvasRect(gl, 20, 15, 10, 1, [255, 0, 255, 255]);
+
+ // Last line should be all black
+ wtu.checkCanvasRect(gl, 0, 49, 50, 1, [0, 0, 0, 0]);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html
new file mode 100644
index 0000000000..dee3597546
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/glsl-vertex-branch.html
@@ -0,0 +1,128 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL function nodes Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+
+<script id="vshaderNoBranch" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+uniform float redIntensity;
+
+varying vec4 vColor;
+
+float MADBug(float paramValue) {
+ float localVar = 1.0;
+ return 0.25 * ceil(localVar) + paramValue;
+}
+
+void main(void) {
+ gl_Position = vec4(aPosition, 1.0);
+ vColor = vec4(MADBug(redIntensity), 0., 0., 1.);
+}
+</script>
+
+<script id="vshaderBranch" type="x-shader/x-vertex">
+attribute vec3 aPosition;
+uniform float redIntensity;
+
+varying vec4 vColor;
+
+float MADBug(float paramValue) {
+ float localVar = 1.0;
+ return 0.25 * ceil(localVar) + paramValue;
+}
+
+void main(void) {
+ float condition = 42.;
+ if (condition == 0.) {}
+ gl_Position = vec4(aPosition, 1.0);
+ vColor = vec4(MADBug(redIntensity), 0., 0., 1.);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+varying vec4 vColor;
+void main()
+{
+ gl_FragColor = vColor;
+}
+</script>
+</head>
+<body>
+<canvas id="canvasNoBranch" width="50" height="50"></canvas>
+<canvas id="canvasBranch" width="50" height="50"></canvas>
+<div id="description">This tests against a Mac driver bug related to branches
+ inside of Vertex Shaders.</div>
+<div id="console"></div>
+<script>
+"use strict";
+var width = 50;
+var height = 50;
+var wtu = WebGLTestUtils;
+
+function drawAndRead(canvasID, vshaderID, buffer)
+{
+ var gl = wtu.create3DContext(canvasID);
+ var program = wtu.setupProgram(gl, [vshaderID, "fshader"], ["aPosition"]);
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -1,-1,0, 1,-1,0 ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ var loc = gl.getUniformLocation(program, "redIntensity");
+ gl.uniform1f(loc, 0.75);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buffer);
+ if (gl.getError() != gl.NO_ERROR)
+ return false;
+ return true;
+}
+
+function compareRendering(buffer1, buffer2, tol)
+{
+ for (var i = 0; i < width * height * 4; ++i) {
+ if (Math.abs(buffer1[i] - buffer2[i]) > tol)
+ return false;
+ }
+ return true;
+}
+
+function init()
+{
+ description("tests vertex shader with branch");
+
+ var bufBranch = new Uint8Array(width * height * 4);
+ var bufNoBranch = new Uint8Array(width * height * 4);
+
+ if (drawAndRead("canvasBranch", "vshaderBranch", bufBranch) == false ||
+ drawAndRead("canvasNoBranch", "vshaderNoBranch", bufNoBranch) == false) {
+ testFailed("Setup failed");
+ } else {
+ if (compareRendering(bufBranch, bufNoBranch, 4) == false)
+ testFailed("Rendering results are different");
+ else
+ testPassed("Rendering results are the same");
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs
new file mode 100644
index 0000000000..50970e6ccf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/include.vs
@@ -0,0 +1,4 @@
+// Do not delete!
+// Needed to help glsl-conformance tests.
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html
new file mode 100644
index 0000000000..1f096ec30f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/large-loop-compile.html
@@ -0,0 +1,172 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+attribute vec2 position;
+
+void main(){
+ gl_Position = vec4(position, 0.0, 1.0);
+}
+</script>
+<script id="fragmentShader" type="text/something-not-javascript">
+precision mediump float;
+uniform sampler2D source;
+
+mat3 front = mat3(
+ 1.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 0.0, 0.0, 1.0
+);
+
+mat3 back = mat3(
+ -1.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 0.0, 0.0, -1.0
+);
+
+mat3 left = mat3(
+ 0.0, 0.0, -1.0,
+ 0.0, 1.0, 0.0,
+ 1.0, 0.0, 0.0
+);
+
+mat3 right = mat3(
+ 0.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0,
+ -1.0, 0.0, 0.0
+);
+
+mat3 up = mat3(
+ 1.0, 0.0, 0.0,
+ 0.0, 0.0, 1.0,
+ 0.0, -1.0, 0.0
+);
+
+mat3 down = mat3(
+ 1.0, 0.0, 0.0,
+ 0.0, 0.0, -1.0,
+ 0.0, 1.0, 0.0
+);
+
+float coefficient(vec3 normal){
+ int index = int(gl_FragCoord.x);
+ float x = normal.x;
+ float y = normal.y;
+ float z = normal.z;
+
+ if(index==0){
+ return 1.0;
+ }
+ else if(index==1){
+ return y;
+ }
+ else if(index==2){
+ return z;
+ }
+ else if(index==3){
+ return x;
+ }
+ else if(index==4){
+ return x*y;
+ }
+ else if(index==5){
+ return y*z;
+ }
+ else if(index==6){
+ return 3.0*z*z - 1.0;
+ }
+ else if(index==7){
+ return x*z;
+ }
+ else{
+ return x*x - y*y;
+ }
+}
+
+vec3 sample(float cidx, mat3 side){
+ vec3 result = vec3(0.0);
+ float divider = 0.0;
+
+ for(int i=0; i<256; i++){
+ float x = mod(float(i), 16.0);
+ float y = float(i/16);
+ vec2 texcoord = (vec2(x+cidx*16.0, y+floor(gl_FragCoord.y)*16.0)+0.5)/6.0;
+ vec2 sidecoord = ((vec2(x,y)+vec2(0.5, 0.5))/vec2(16.0))*2.0-1.0;
+ vec3 normal = normalize(vec3(sidecoord, -1.0));
+ vec3 texel = texture2D(source, texcoord).rgb;
+ result += coefficient(side*normal) * texel * -normal.z;
+ divider += -normal.z;
+ }
+ return result/divider;
+}
+
+void main(){
+ vec3 result = (
+ //sample(0.0, front) +
+ //sample(1.0, back) +
+ sample(2.0, left) +
+ sample(3.0, right) +
+ sample(4.0, up) +
+ sample(5.0, down)
+ )/6.0;
+ gl_FragColor = vec4(result, 1.0);
+}
+</script>
+<script>
+"use strict";
+var receivedContextLost = false;
+description("Ensures that compilation of a large loop completes in a reasonable period of time and does not cause the WebGL context to be lost");
+var wtu = WebGLTestUtils;
+var canvas = document.createElement('canvas');
+canvas.width = 32;
+canvas.height = 32;
+canvas.addEventListener("webglcontextlost", function(e) {
+ testFailed("context was lost during shader compilation or linking");
+ receivedContextLost = true;
+});
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+} else {
+ var startTime = Date.now();
+ wtu.setupProgram(gl, ["vertexShader", "fragmentShader"], undefined, undefined, true);
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0);
+ var endTime = Date.now();
+
+ // Delay for some period to increase chances that context lost event will be delivered.
+ setTimeout(function() {
+ if (!receivedContextLost) {
+ testPassed("Large loop compiled and linked without terminating the WebGL context");
+ const timeString = `${endTime - startTime} ms`;
+ if (endTime - startTime < 7500) {
+ testPassed("Shader compilation completed in a reasonable amount of time: " + timeString);
+ } else {
+ testFailed("Shader compilation took an unreasonably long time: " + timeString);
+ }
+ }
+ finishTest();
+ }, 500);
+}
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/local-variable-shadowing-outer-function.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/local-variable-shadowing-outer-function.html
new file mode 100644
index 0000000000..4fb814c0d9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/local-variable-shadowing-outer-function.html
@@ -0,0 +1,59 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Test - Local Variable Shadowing Outer Function</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader must succeed
+attribute vec3 vertex;
+varying float interp;
+void main() {
+ interp = vertex.x;
+ gl_Position = vec4(vertex, 1.0);
+}
+</script>
+<script id="fragmentShader" type="text/something-not-javascript">
+// local variable shadowing outer function definition must succeed
+precision mediump float;
+
+varying float interp;
+
+float rsquared(float radius)
+{
+ return radius * radius;
+}
+
+void some_computation(float radius, out float bsdf) {
+ bsdf = 0.0;
+ float rsquared = rsquared(radius);
+ bsdf += rsquared;
+}
+
+void main() {
+ float comp;
+ some_computation(interp, comp);
+ gl_FragColor = vec4(comp, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html
new file mode 100644
index 0000000000..14d807ed71
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii-comments.vert.html
@@ -0,0 +1,54 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/plain">
+Loading...
+</script>
+<script>
+"use strict";
+
+// Via `[].map.call(str, x => x.codePointAt(0));`
+let a = [12371,12428,12399,65313,65331,65315,65321,65321,12391,12399,12394,12356,12391,12377,12290];
+let b = [65332,65352,65353,65363,12288,65321,65363,12288,65326,65359,65364,12288,65313,65331,65315,65321,65321];
+a = String.fromCodePoint(...a);
+b = String.fromCodePoint(...b);
+
+// -
+
+vertexShader.textContent = `
+// Non ascii comments in source should succeed
+// ${a}
+// ${b}
+/*
+ * ${b}
+ */
+#define TEST 1 // ${b}
+void main() {
+ gl_Position = vec4(1,1,1,1); // ${b}
+} // ${b}
+`;
+
+// -
+
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html
new file mode 100644
index 0000000000..7cc05b9354
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/non-ascii.vert.html
@@ -0,0 +1,54 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/plain">
+Loading...
+</script>
+<script>
+"use strict";
+
+// Via `[].map.call(str, x => x.codePointAt(0));`
+let a = [12371,12428,12399,65313,65331,65315,65321,65321,12391,12399,12394,12356,12391,12377,12290];
+let b = [65332,65352,65353,65363,12288,65321,65363,12288,65326,65359,65364,12288,65313,65331,65315,65321,65321];
+let c = [65326,65359,65364,65313,65331,65315,65321,65321];
+a = String.fromCodePoint(...a);
+b = String.fromCodePoint(...b);
+c = String.fromCodePoint(...c);
+
+// -
+
+vertexShader.textContent = `
+// Non ascii data in source should fail
+// See GLSL ES Spec 1.0.17 section 3.1 and 3.2
+// ${a}
+// ${b}
+uniform mat4 ${c};
+void main() {
+ gl_Position = vec4(1,1,1,1);
+}
+`;
+
+// -
+
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html
new file mode 100644
index 0000000000..caed432120
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/re-compile-re-link.html
@@ -0,0 +1,150 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Re-Compile and Re-link Shader conformance 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>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute float column;
+attribute float height;
+uniform float position;
+void main() {
+ gl_Position = vec4(mod(column - position, 1.0) * 2.0 - 1.0, height, 0, 1);
+}
+</script>
+
+<script id="fshader1" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ gl_FragColor = vec4(1,0,0,1);
+}
+</script>
+<script id="fshader2" type="x-shader/x-fragment">
+precision mediump float;
+uniform float foobar;
+void main() {
+ gl_FragColor = vec4(1,0,foobar,1);
+}
+</script>
+<script id="vshaderB" type="not-js">
+attribute vec2 position;
+varying vec2 v_texCoord;
+void main() {
+ gl_Position = vec4(position, 0, 1);
+ v_texCoord = vec2(position * 0.5 + 0.5);
+}
+</script>
+<script id="fshaderB" type="not-js">
+precision mediump float;
+varying vec2 v_texCoord;
+uniform sampler2D tex;
+void main() {
+ gl_FragColor = texture2D(tex, v_texCoord);
+}
+</script>
+
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var vsSource = document.getElementById("vshader").text;
+var fs1Source = document.getElementById("fshader1").text;
+var fs2Source = document.getElementById("fshader2").text;
+
+var vsSourceB = document.getElementById("vshaderB").text;
+var fsSourceB = document.getElementById("fshaderB").text;
+
+var vShader = gl.createShader(gl.VERTEX_SHADER);
+var fShader = gl.createShader(gl.FRAGMENT_SHADER);
+
+var vShaderB = gl.createShader(gl.VERTEX_SHADER);
+var fShaderB = gl.createShader(gl.FRAGMENT_SHADER);
+
+var program = gl.createProgram();
+var programB = gl.createProgram();
+
+gl.attachShader(program, vShader);
+gl.attachShader(program, fShader);
+
+gl.attachShader(programB, vShaderB);
+gl.attachShader(programB, fShaderB);
+
+var success;
+var shader;
+
+function checkShaderStatus(s) {
+ shader = s;
+ shouldBeTrue("success = gl.getShaderParameter(shader, gl.COMPILE_STATUS)");
+ if (!success) {
+ debug("error: " + gl.getShaderInfoLog(shader));
+ }
+}
+
+var prg;
+function checkProgramStatus(p) {
+ prg = p;
+ shouldBeTrue("success = gl.getProgramParameter(prg, gl.LINK_STATUS)");
+ if (!success) {
+ debug("error: " + gl.getProgramInfoLog(prg));
+ }
+}
+
+for (var i = 0; i < 10; ++i) {
+ gl.shaderSource(vShader, vsSource);
+ gl.compileShader(vShader);
+ checkShaderStatus(vShader)
+ gl.shaderSource(fShader, fs1Source);
+ gl.compileShader(fShader);
+ checkShaderStatus(fShader)
+
+ gl.linkProgram(program);
+ checkProgramStatus(program)
+ gl.useProgram(program);
+
+ gl.shaderSource(vShaderB, vsSourceB);
+ gl.compileShader(vShaderB);
+ checkShaderStatus(vShaderB)
+ gl.shaderSource(fShaderB, fsSourceB);
+ gl.compileShader(fShaderB);
+ checkShaderStatus(fShaderB)
+
+ gl.linkProgram(programB);
+ checkProgramStatus(programB)
+
+ gl.useProgram(programB);
+}
+
+for (var i = 0; i < 10; ++i) {
+ // Now change the fragment shader
+ gl.shaderSource(fShader, fs2Source);
+ gl.compileShader(fShader);
+ checkShaderStatus(fShader)
+
+ // And re-link
+ gl.linkProgram(program);
+ checkProgramStatus(program)
+}
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sampler-operand.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sampler-operand.html
new file mode 100644
index 0000000000..4b6d6c0bad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sampler-operand.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - sampler operands</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+// ESSL(1.00, 3.00, 3.10) section 4.1.7
+// Except for array indexing, structure field selection, and
+// parentheses, samplers are not allowed to be operands in expressions.
+</script>
+
+<script id="samplerAdding" type="x-shader/x-fragment">
+// This covers an ANGLE bug.
+// See https://bugs.chromium.org/p/angleproject/issues/detail?id=2028.
+uniform sampler2D s1;
+uniform sampler2D s2;
+void main() {
+ s1 + s2;
+}
+</script>
+
+<script>
+"use strict";
+GLSLConformanceTester.runTests([
+ { fShaderId: 'samplerAdding',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'Adding on samplers should fail'
+ },
+]);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html
new file mode 100644
index 0000000000..8ea601f719
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/sequence-operator-returns-constant.html
@@ -0,0 +1,60 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Sequence operator returns constant test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader-const-expression" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ // RHS should be a constant expression (a compile-time constants) stated in section 4.3.2 from GLESSL 1.0.17
+ const float a = (0.0, 1.0);
+}
+</script>
+<script id="fshader-non-const-expression" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ float a[(2, 3)];
+}
+</script>
+<script>
+"use strict";
+description("Checks sequence operators returning constants and can be used as an array size.");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+GLSLConformanceTester.runTests([
+{ fShaderId: 'fshader-const-expression',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Sequence operator can return a constant expression",
+},
+{ fShaderId: 'fshader-non-const-expression',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Sequence operator return value can be used as array size",
+},
+]);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html
new file mode 100644
index 0000000000..4574846469
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-precision-format-obeyed.html
@@ -0,0 +1,83 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderWithHighPrecision" type="text/something-not-javascript">
+precision highp float;
+uniform vec4 constantColor;
+
+void main()
+{
+ gl_FragColor = constantColor;
+}
+</script>
+<script id="fshaderWhichCompilesWithHighp" type="text/something-not-javascript">
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+// Something which compiles
+#else
+somethingWhichDoesNotCompile();
+#endif
+
+void main()
+{
+ gl_FragColor = vec4(0, 0, 0, 1);
+}
+</script>
+<script id="fshaderWhichCompilesWithoutHighp" type="text/something-not-javascript">
+#ifndef GL_FRAGMENT_PRECISION_HIGH
+// Something which compiles
+#else
+somethingWhichDoesNotCompile();
+#endif
+
+void main()
+{
+ gl_FragColor = vec4(0, 0, 0, 1);
+}
+</script>
+<script>
+"use strict";
+description("Checks that getShaderPrecisionFormat's return value matches whether highp is supported in fragment shaders.");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var precision = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);
+var highpSupported = (precision.rangeMin >= 62 && precision.rangeMax >= 62 && precision.precision >= 16);
+debug("highp is" + (highpSupported ? "" : " not") + " supported in fragment shaders");
+
+GLSLConformanceTester.runTests([
+{
+ fShaderId: 'fshaderWithHighPrecision',
+ fShaderSuccess: highpSupported,
+ linkSuccess: highpSupported,
+ passMsg: "getShaderPrecisionFormat's results agree with highp support in fragment shaders",
+},
+{
+ fShaderId: highpSupported ? 'fshaderWhichCompilesWithHighp' : 'fshaderWhichCompilesWithoutHighp',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "getShaderPrecisionFormat's results agree with definition of GL_FRAGMENT_PRECISION_HIGH",
+},
+]);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html
new file mode 100644
index 0000000000..a04faf03b1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-struct-scope.html
@@ -0,0 +1,231 @@
+<!--
+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: Jamie Madill (jmadill at chromium) -->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Struct Scope Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="shader-vs-1" type="x-shader/x-vertex">
+void main(void) {
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+
+ {
+ struct T {
+ int v1;
+ };
+
+ T x;
+ gl_Position.x += float(x.v1);
+ }
+
+ {
+ struct T {
+ float v2;
+ };
+
+ T x;
+ gl_Position.x += x.v2;
+ }
+
+}
+</script>
+
+<script id="shader-vs-2" type="x-shader/x-vertex">
+void main(void) {
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+
+ struct T {
+ int v1;
+ };
+
+ T x;
+ gl_Position.x += float(x.v1);
+
+ {
+ struct T {
+ float v2;
+ };
+
+ T x;
+ gl_Position.x += x.v2;
+ }
+
+}
+</script>
+
+<script id="shader-vs-3" type="x-shader/x-vertex">
+void main(void) {
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+
+ {
+ struct T {
+ int v1;
+ };
+
+ T x;
+ gl_Position.x += float(x.v1);
+ }
+
+ struct T {
+ float v2;
+ };
+
+ T x;
+ gl_Position.x += x.v2;
+}
+</script>
+
+<script id="shader-vs-bad" type="x-shader/x-vertex">
+void main(void) {
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+
+ struct T {
+ int v1;
+ };
+
+ T x;
+ gl_Position.x += float(x.v1);
+
+ struct T {
+ float v2;
+ };
+
+ T y;
+ gl_Position.x += y.v2;
+}
+</script>
+
+<script id="shader-vs-anglebug" type="x-shader/x-vertex">
+
+struct T_0 {
+ int v1;
+};
+
+void main(void) {
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+
+ struct T {
+ float v2;
+ };
+
+ T_0 x;
+ gl_Position.x += float(x.v1);
+
+ T y;
+ gl_Position.x += y.v2;
+}
+</script>
+
+<script id="shader-vs-masked-struct-variable" type="x-shader/x-vertex">
+
+struct T {
+ float f;
+};
+
+void main(void) {
+
+ T a;
+
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+
+ struct T {
+ float q;
+ };
+
+ gl_Position.x += a.f;
+
+ T b;
+ gl_Position.x += b.q;
+}
+</script>
+
+<script id="shader-fs" type="x-shader/x-fragment">
+precision mediump float;
+void main(void) {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+description("Testing struct definition scope");
+
+var wtu = WebGLTestUtils;
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "shader-vs-1",
+ vShaderSuccess: true,
+ fShaderId: "shader-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Two structs defined within non-overlapping scopes should be able to use the same name",
+ },
+ {
+ vShaderId: "shader-vs-2",
+ vShaderSuccess: true,
+ fShaderId: "shader-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "A struct defined inside a scope overrides a struct defined in a outer scope with the same name",
+ },
+ {
+ vShaderId: "shader-vs-3",
+ vShaderSuccess: true,
+ fShaderId: "shader-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "A struct can use the same name of another out-of-scope struct",
+ },
+ {
+ vShaderId: "shader-vs-bad",
+ vShaderSuccess: false,
+ fShaderId: "shader-fs",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "A struct can't be defined with the same name as another struct defined in the same scope",
+ },
+ {
+ vShaderId: "shader-vs-anglebug",
+ vShaderSuccess: true,
+ fShaderId: "shader-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Structs with appended underscored numbers don't cause link errors (ANGLE bug)",
+ },
+ {
+ vShaderId: "shader-vs-masked-struct-variable",
+ vShaderSuccess: true,
+ fShaderId: "shader-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Variables of masked outer scope struct work with inner scope struct",
+ },
+]);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html
new file mode 100644
index 0000000000..22a968470f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-uniform-packing-restrictions.html
@@ -0,0 +1,251 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform packing restrctions Conformance Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main()
+{
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader" type="x-shader/x-vertex">
+precision mediump float;
+varying vec4 v_varying;
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="vshaderArrayTest" type="x-shader/x-vertex">
+attribute vec4 a_position;
+varying vec4 v_varying;
+uniform $(type) u_uniform[$(numTestType)];
+void main()
+{
+ v_varying = $(result);
+ gl_Position = a_position;
+}
+</script>
+<script id="fshaderArrayTest" type="x-shader/x-fragment">
+precision mediump float;
+uniform $(type) u_uniform[$(numTestType)];
+void main()
+{
+ gl_FragColor = $(result);
+}
+</script>
+<script id="vshaderUniformTest" type="x-shader/x-fragment">
+attribute vec4 a_position;
+varying vec4 v_varying;
+$(uniforms)
+void main()
+{
+ $(code)
+ v_varying = $(result);
+ gl_Position = a_position;
+}
+</script>
+<script id="fshaderUniformTest" type="x-shader/x-fragment">
+precision mediump float;
+$(uniforms)
+void main()
+{
+ $(code)
+ gl_FragColor = $(result);
+}
+</script>
+<script>
+"use strict";
+description();
+debug("");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var uniformTypes = [
+ { type: "bool", componentsPerRow: 1, rows: 1, fType: "float", uniToF: "float(u_uniform$(id)$(index))", fToVec4: "vec4($(f), 0, 0, 0)"},
+ { type: "float", componentsPerRow: 1, rows: 1, fType: "float", uniToF: "u_uniform$(id)$(index)", fToVec4: "vec4($(f), 0, 0, 0)"},
+ { type: "int", componentsPerRow: 1, rows: 1, fType: "float", uniToF: "float(u_uniform$(id)$(index))", fToVec4: "vec4($(f), 0, 0, 0)"},
+ { type: "vec2", componentsPerRow: 2, rows: 1, fType: "vec2", uniToF: "u_uniform$(id)$(index)", fToVec4: "vec4($(f), 0, 0)"},
+ { type: "ivec2", componentsPerRow: 2, rows: 1, fType: "vec2", uniToF: "vec2(u_uniform$(id)$(index))", fToVec4: "vec4($(f), 0, 0)"},
+ { type: "bvec2", componentsPerRow: 2, rows: 1, fType: "vec2", uniToF: "vec2(u_uniform$(id)$(index))", fToVec4: "vec4($(f), 0, 0)"},
+ { type: "vec3", componentsPerRow: 3, rows: 1, fType: "vec3", uniToF: "u_uniform$(id)$(index)", fToVec4: "vec4($(f), 0)"},
+ { type: "ivec3", componentsPerRow: 3, rows: 1, fType: "vec3", uniToF: "vec3(u_uniform$(id)$(index))", fToVec4: "vec4($(f), 0)"},
+ { type: "bvec3", componentsPerRow: 3, rows: 1, fType: "vec3", uniToF: "vec3(u_uniform$(id)$(index))", fToVec4: "vec4($(f), 0)"},
+ { type: "vec4", componentsPerRow: 4, rows: 1, fType: "vec4", uniToF: "u_uniform$(id)$(index)", fToVec4: "$(f)"},
+ { type: "ivec4", componentsPerRow: 4, rows: 1, fType: "vec4", uniToF: "vec4(u_uniform$(id)$(index))", fToVec4: "$(f)"},
+ { type: "bvec4", componentsPerRow: 4, rows: 1, fType: "vec4", uniToF: "vec4(u_uniform$(id)$(index))", fToVec4: "$(f)"},
+// Yes, the spec says mat2 takes 4 columns, 2 rows.
+ { type: "mat2", componentsPerRow: 4, rows: 2, fType: "vec2", uniToF: "vec2(u_uniform$(id)$(index)[0])", fToVec4: "vec4($(f), 0, 0)"},
+ { type: "mat3", componentsPerRow: 3, rows: 3, fType: "vec3", uniToF: "vec3(u_uniform$(id)$(index)[0])", fToVec4: "vec4($(f), 0)"},
+ { type: "mat4", componentsPerRow: 4, rows: 4, fType: "vec4", uniToF: "vec4(u_uniform$(id)$(index)[0])", fToVec4: "$(f)"},
+// Samplers generally have more restrictive limits.
+// { type: "sampler2D", componentsPerRow: 1, rows: 1, code: "vec4(texture2D(u_uniform[$(index)], vec2(0, 0)))", },
+// { type: "samplerCube", componentsPerRow: 1, rows: 1, code: "vec4(textureCube(u_uniform[$(index)], vec3(0, 0, 0)))", },
+];
+
+var vBaseSource = wtu.getScript("vshader");
+var fBaseSource = wtu.getScript("fshader");
+var vArrayTestSource = wtu.getScript("vshaderArrayTest");
+var fArrayTestSource = wtu.getScript("fshaderArrayTest");
+var vUniformTestSource = wtu.getScript("vshaderUniformTest");
+var fUniformTestSource = wtu.getScript("fshaderUniformTest");
+
+var tests = [];
+var shaderTypes = [
+ { type: "vertex",
+ // For tests that expect failure which shader might fail.
+ vertExpectation: false,
+ fragExpectation: true,
+ vertArrayTest: vArrayTestSource,
+ fragArrayTest: fBaseSource,
+ vertUniformTest: vUniformTestSource,
+ fragUniformTest: fBaseSource,
+ maxVectors: gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS),
+ minVectors: 127, // GLSL ES 1.0.17 Appendix A.7 and A.8. Reserve one row for constants in the code, hence 128 - 1.
+ },
+ { type: "fragment",
+ // For tests that expect failure which shader might fail.
+ vertExpectation: true,
+ fragExpectation: false,
+ vertArrayTest: vBaseSource,
+ fragArrayTest: fArrayTestSource,
+ vertUniformTest: vBaseSource,
+ fragUniformTest: fUniformTestSource,
+ maxVectors: gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS),
+ minVectors: 15, // GLSL ES 1.0.17 Appendix A.8 - minimum value of gl_maxFragmentUniformVectors is 16. Again, reserve a row for constants.
+ },
+];
+for (var ss = 0; ss < shaderTypes.length; ++ss) {
+ var shaderType = shaderTypes[ss];
+ debug("max " + shaderType.type + ": " + shaderType.maxVectors);
+ for (var ii = 0; ii < uniformTypes.length; ++ii) {
+ var info = uniformTypes[ii];
+ wtu.log("checking: " + info.type);
+ // Compute the maximum amount of this type allowed in a single array.
+ var maxInArray = Math.floor(shaderType.maxVectors / info.rows);
+ // Compute the minimum required to work in a single array.
+ var minVars = Math.floor(shaderType.minVectors / info.rows);
+ // Compute the maximum allowed as single elements
+ var maxPerRow = Math.floor(4 / info.componentsPerRow);
+ var maxPacked = Math.floor(shaderType.maxVectors * maxPerRow / info.rows);
+
+ // Test array[1] of the type
+ var uniToF = wtu.replaceParams(info.uniToF, {id: "", index: "[0]"});
+ var vec4 = wtu.replaceParams(info.fToVec4, {f: uniToF});
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: 1, result: vec4}, info),
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: 1, result: vec4}, info),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with 1 element should succeed",
+ });
+
+ // Note: We can't test an array filling all uniform space as actual GL drivers are
+ // only required to be able to do the minimum number. After that it can fail for
+ // multiple reasons, including uniform registers being reserved for the implementation's
+ // own use. Constants also take up uniform registers.
+
+ // Test required number of uniforms
+ var uniToF = wtu.replaceParams(info.uniToF, {id: "", index: "[" + (minVars - 1) + "]"});
+ var vec4 = wtu.replaceParams(info.fToVec4, {f: uniToF});
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: minVars, result: vec4}, info),
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: minVars, result: vec4}, info),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + minVars + " elements (the minimum required) should succeed",
+ });
+
+ // Test array[max + 1] accessing last element. WebGL requires this to fail.
+ var uniToF = wtu.replaceParams(info.uniToF, {id: "", index: "[" + maxInArray + "]"});
+ var vec4 = wtu.replaceParams(info.fToVec4, {f: uniToF});
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: maxInArray + 1, result: vec4}, info),
+ vShaderSuccess: shaderType.vertExpectation,
+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: maxInArray + 1, result: vec4}, info),
+ fShaderSuccess: shaderType.fragExpectation,
+ linkSuccess: false,
+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + (maxInArray + 1) + " elements (one past maximum) accessing last element should fail",
+ });
+
+ // Test array[max + 1] accessing first element. WebGL requires this to fail but ES allows truncating array.
+ var uniToF = wtu.replaceParams(info.uniToF, {id: "", index: "[0]"});
+ var vec4 = wtu.replaceParams(info.fToVec4, {f: uniToF});
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertArrayTest, {numTestType: maxInArray + 1, result: vec4}, info),
+ vShaderSuccess: shaderType.vertExpectation,
+ fShaderSource: wtu.replaceParams(shaderType.fragArrayTest, {numTestType: maxInArray + 1, result: vec4}, info),
+ fShaderSuccess: shaderType.fragExpectation,
+ linkSuccess: false,
+ passMsg: shaderType.type + " shader with uniform array of " + info.type + " with " + (maxInArray + 1) + " elements (one past maximum) accessing first element should fail",
+ });
+
+ // Note: We can't test max uniforms as actual GL drivers are only required to be able
+ // to do the minimum number. After that it can fail for multiple reasons, including
+ // uniform registers being reserved for the implementation's own use or also instruction
+ // space limitations. Strictly speaking, guaranteed supported length of a shader
+ // executable is defined by the GLES2 conformance tests according to GLSL ES 1.0.17
+ // Appendix A.2. This does not give us an exact limit: this test only aims to fit within
+ // instruction space limits imposed by existing GLES2 compliant hardware.
+
+ var generateCode = function(numVars) {
+ var uniforms = [];
+ var sumTerms = [];
+ for (var uu = 0; uu < numVars; ++uu) {
+ uniforms.push(" uniform " + info.type + " u_uniform" + uu + ";");
+ sumTerms.push(wtu.replaceParams(info.uniToF, {id: uu, index: ""}));
+ }
+ return {
+ uniforms: uniforms.join("\n"),
+ code: info.fType + " sum = " + sumTerms.join(" + \n ") + ";",
+ result: wtu.replaceParams(info.fToVec4, {f: 'sum'})
+ };
+ };
+
+ // Test max+1 uniforms of type.
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertUniformTest, generateCode(maxPacked + 1), info),
+ vShaderSuccess: shaderType.vertExpectation,
+ fShaderSource: wtu.replaceParams(shaderType.fragUniformTest, generateCode(maxPacked + 1), info),
+ fShaderSuccess: shaderType.fragExpectation,
+ linkSuccess: false,
+ passMsg: shaderType.type + " shader with " + (maxPacked + 1) + " uniforms of " + info.type + " (one past maximum) should fail",
+ });
+
+ // Test required uniforms of type.
+ tests.push({
+ vShaderSource: wtu.replaceParams(shaderType.vertUniformTest, generateCode(minVars), info),
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(shaderType.fragUniformTest, generateCode(minVars), info),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: shaderType.type + " shader with " + minVars + " uniforms of " + info.type + " (the minimum required) should succeed",
+ });
+ }
+}
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html
new file mode 100644
index 0000000000..741ad7b63f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-varying-packing-restrictions.html
@@ -0,0 +1,188 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL varying packing restrictions Conformance Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshaderArrayTest" type="x-shader/x-vertex">
+attribute vec4 a_position;
+varying $(type) v_varying[$(numTestType)];
+void main()
+{
+ gl_Position = a_position;
+ $(vcode)
+}
+</script>
+<script id="fshaderArrayTest" type="x-shader/x-fragment">
+precision mediump float;
+varying $(type) v_varying[$(numTestType)];
+void main()
+{
+ gl_FragColor = $(fcode);
+}
+</script>
+<script id="vshaderVaryingTest" type="x-shader/x-fragment">
+attribute vec4 a_position;
+$(varyings)
+void main()
+{
+ gl_Position = a_position;
+ $(vcode)
+}
+</script>
+<script id="fshaderVaryingTest" type="x-shader/x-fragment">
+precision mediump float;
+$(varyings)
+void main()
+{
+ gl_FragColor = $(fcode);
+}
+</script>
+<script>
+"use strict";
+description();
+debug("");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var varyingTypes = [
+ { type: "float", componentsPerRow: 1, rows: 1, vcode: "v_varying$(id)$(index) = 1.0;", fcode: "vec4(v_varying$(id)$(index), 0, 0, 0)", },
+ { type: "vec2", componentsPerRow: 2, rows: 1, vcode: "v_varying$(id)$(index) = vec2(0, 0);", fcode: "vec4(v_varying$(id)$(index), 0, 0)", },
+ { type: "vec3", componentsPerRow: 3, rows: 1, vcode: "v_varying$(id)$(index) = vec3(0, 0, 0);", fcode: "vec4(v_varying$(id)$(index), 0)", },
+ { type: "vec4", componentsPerRow: 4, rows: 1, vcode: "v_varying$(id)$(index) = vec4(0, 0, 0, 0);", fcode: "vec4(v_varying$(id)$(index))", },
+// Yes, the spec says mat2 takes 4 columns, 2 rows.
+ { type: "mat2", componentsPerRow: 4, rows: 2, vcode: "v_varying$(id)$(index) = mat2(1.0);", fcode: "vec4(v_varying$(id)$(index)[0], 0, 0)", },
+ { type: "mat3", componentsPerRow: 3, rows: 3, vcode: "v_varying$(id)$(index) = mat3(1.0);", fcode: "vec4(v_varying$(id)$(index)[0], 0)", },
+ { type: "mat4", componentsPerRow: 4, rows: 4, vcode: "v_varying$(id)$(index) = mat4(1.0);", fcode: "vec4(v_varying$(id)$(index)[0])", },
+];
+
+var vArrayTestSource = wtu.getScript("vshaderArrayTest");
+var fArrayTestSource = wtu.getScript("fshaderArrayTest");
+var vVaryingTestSource = wtu.getScript("vshaderVaryingTest");
+var fVaryingTestSource = wtu.getScript("fshaderVaryingTest");
+
+var minVaryingVectors = 8;
+var maxVaryingVectors = gl.getParameter(gl.MAX_VARYING_VECTORS);
+var tests = [];
+
+for (var ii = 0; ii < varyingTypes.length; ++ii) {
+ var info = varyingTypes[ii];
+ wtu.log("checking: " + info.type);
+ // Compute the maximum amount of this type allowed in a single array.
+ var numVars = Math.floor(maxVaryingVectors / info.rows);
+ // Compute the minimum required to work in a single array.
+ var minVars = Math.floor(minVaryingVectors / info.rows);
+ // Compute the maximum allowed as single elements
+ var numPerRow = Math.floor(4 / info.componentsPerRow);
+ var numMax = Math.floor(maxVaryingVectors * numPerRow / info.rows);
+
+ // Test array[1] of the type
+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[0]"});
+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[0]"});
+ tests.push({
+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: 1, vcode: vcode}, info),
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: 1, fcode: fcode}, info),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "shaders with varying array of " + info.type + " with 1 element should succeed",
+ });
+
+ // Test required number of varyings
+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[" + (minVars - 1) + "]"});
+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[" + (minVars - 1) + "]"});
+ tests.push({
+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: minVars, vcode: vcode}, info),
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: minVars, fcode: fcode}, info),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "shaders with varying array of " + info.type + " with " + minVars + " elements (the minimum required) should succeed",
+ });
+
+ // Test array[max + 1] accessing last element. WebGL requires this to fail.
+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[" + numVars + "]"});
+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[" + numVars + "]"});
+ tests.push({
+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: numVars + 1, vcode: vcode}, info),
+ vShaderSuccess: false,
+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: numVars + 1, fcode: fcode}, info),
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "shaders with varying array of " + info.type + " with " + (numVars + 1) + " elements (one past maximum) accessing last element should fail",
+ });
+
+ // Test array[max + 1] accessing first element. WebGL requires this to fail but ES allows truncating array.
+ var vcode = wtu.replaceParams(info.vcode, {id: "", index: "[0]"});
+ var fcode = wtu.replaceParams(info.fcode, {id: "", index: "[0]"});
+ tests.push({
+ vShaderSource: wtu.replaceParams(vArrayTestSource, {numTestType: numVars + 1, vcode: vcode}, info),
+ vShaderSuccess: false,
+ fShaderSource: wtu.replaceParams(fArrayTestSource, {numTestType: numVars + 1, fcode: fcode}, info),
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "shaders with varying array of " + info.type + " with " + (numVars + 1) + " elements (one past maximum) accessing first element should fail",
+ });
+
+ // Note: We can't test max varyings as actual GL drivers are only required to be able to
+ // do the minimum number. After that it can fail for any reason, for example running out of
+ // instruction space.
+
+ var generateCode = function(numVars) {
+ var varyings = [];
+ var vcodes = [];
+ var fcodes = [];
+ for (var uu = 0; uu < numVars; ++uu) {
+ varyings.push(" varying " + info.type + " v_varying" + uu + ";");
+ vcodes.push(wtu.replaceParams(info.vcode, {id: uu, index: ""}));
+ fcodes.push(wtu.replaceParams(info.fcode, {id: uu, index: ""}));
+ }
+ return {
+ varyings: varyings.join("\n"),
+ vcode: vcodes.join("\n "),
+ fcode: fcodes.join(" + \n "),
+ };
+ };
+
+ // Test max+1 varyings of type.
+ tests.push({
+ vShaderSource: wtu.replaceParams(vVaryingTestSource, generateCode(numMax + 1), info),
+ vShaderSuccess: false,
+ fShaderSource: wtu.replaceParams(fVaryingTestSource, generateCode(numMax + 1), info),
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "shaders with " + (numMax + 1) + " varyings of " + info.type + " (one past maximum) should fail",
+ });
+
+ // Test required varyings of type.
+ tests.push({
+ vShaderSource: wtu.replaceParams(vVaryingTestSource, generateCode(minVars), info),
+ vShaderSuccess: true,
+ fShaderSource: wtu.replaceParams(fVaryingTestSource, generateCode(minVars), info),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "shaders with " + minVars + " varyings of " + info.type + " (the minimum required) should succeed",
+ });
+}
+
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html
new file mode 100644
index 0000000000..9ed15009b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-define.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses 256 character token in #define should succeed
+#define LEN_256_OK XxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX
+
+void main()
+{
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html
new file mode 100644
index 0000000000..66112ded1d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-256-character-identifier.frag.html
@@ -0,0 +1,105 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader256" type="text/something-not-javascript">
+// shader that uses 256 character identifier should succeed
+precision mediump float;
+uniform float a123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345;
+void main()
+{
+ gl_FragColor = vec4(a123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345,0.0,0.0,1.0);
+}
+</script>
+<script id="fragmentShader_before" type="text/something-not-javascript">
+// shader that uses 256 character identifier that starts with underscore should succeed
+precision mediump float;
+uniform float _a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234;
+void main()
+{
+ gl_FragColor = vec4(_a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234,0.0,0.0,1.0);
+}
+</script>
+<script id="fragmentShader_after" type="text/something-not-javascript">
+// shader that uses 256 character identifier that ends with underscore should succeed
+precision mediump float;
+uniform float a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234_;
+void main()
+{
+ gl_FragColor = vec4(a12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234_,0.0,0.0,1.0);
+}
+</script>
+<script id="fragmentShader256_odd" type="text/something-not-javascript">
+// shader that uses 256 character identifier with odd characters as underscores should succeed
+precision mediump float;
+uniform float a_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_;
+void main()
+{
+ gl_FragColor = vec4(a_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_6_8_0_2_4_,0.0,0.0,1.0);
+}
+</script>
+<script id="fragmentShader256_even" type="text/something-not-javascript">
+// shader that uses 256 character identifier with even characters as underscores should succeed
+precision mediump float;
+uniform float a1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5;
+void main()
+{
+ gl_FragColor = vec4(a1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5_7_9_1_3_5,0.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTests([
+ {
+ fShaderId: 'fragmentShader256',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'shader with 256 character identifier should succeed'
+ },
+ {
+ fShaderId: 'fragmentShader_before',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'shader with 256 character identifier that starts with underscore should succeed'
+ },
+ {
+ fShaderId: 'fragmentShader_after',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'shader with 256 character identifier that ends with underscore should succeed'
+ },
+ {
+ fShaderId: 'fragmentShader256_odd',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'shader with 256 character identifier with odd characters as underscores should succeed'
+ },
+ {
+ fShaderId: 'fragmentShader256_even',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'shader with 256 character identifier with even characters as underscores should succeed'
+ }
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html
new file mode 100644
index 0000000000..0d43c280e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-define.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses 257 character token in #define should fail
+#define LEN_257_BAD XxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX
+
+void main()
+{
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html
new file mode 100644
index 0000000000..e3b70e99e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-257-character-identifier.frag.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// shader that uses 257 character identifier should fail
+precision mediump float;
+uniform float a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456;
+void main()
+{
+ gl_FragColor = vec4(a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456,0.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html
new file mode 100644
index 0000000000..cbd2191902
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-_webgl-identifier.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses _webgl identifier should fail
+attribute vec4 _webgl_vPosition;
+void main()
+{
+ gl_Position = _webgl_vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html
new file mode 100644
index 0000000000..778375dc01
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.frag.html
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with arbitrary indexing expression should fail
+// http://www.khronos.org/registry/webgl/specs/latest/#SUPPORTED_GLSL_CONSTRUCTS
+precision mediump float;
+
+uniform vec4 u_colors[8];
+varying float a_index;
+
+void main()
+{
+ int index = int(floor(a_index));
+ gl_FragColor = u_colors[index];
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html
new file mode 100644
index 0000000000..eedbf67244
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-arbitrary-indexing.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader with arbitrary indexing expression should succeed
+// http://www.khronos.org/registry/webgl/specs/latest/#SUPPORTED_GLSL_CONSTRUCTS
+uniform mat4 u_matrices[8];
+attribute vec4 a_vertex;
+attribute float a_index;
+
+void main()
+{
+ int index = int(floor(a_index));
+ gl_Position = u_matrices[index] * a_vertex;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html
new file mode 100644
index 0000000000..e4acce11fc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html
@@ -0,0 +1,133 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL Array of Structs Containing Arrays</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main(void) {
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader0" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec4 color[2];
+};
+uniform my_struct u_colors[2];
+void main(void) {
+ gl_FragColor = u_colors[0].color[0];
+}
+</script>
+<script id="fshader1" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec4 color[2];
+};
+uniform my_struct u_colors[2];
+void main(void) {
+ gl_FragColor = u_colors[0].color[1];
+}
+</script>
+<script id="fshader-with-one-element-arrays" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec4 color[1];
+};
+uniform my_struct u_colors[1];
+void main(void) {
+ gl_FragColor = u_colors[0].color[0];
+}
+</script>
+<script id="fshader3" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec4 color1[2];
+ vec4 color2[2];
+};
+uniform my_struct u_colors[2];
+void main(void) {
+ gl_FragColor = u_colors[0].color1[0] + u_colors[0].color2[0] + u_colors[1].color1[1] +u_colors[1].color2[1];
+}
+</script>
+</head>
+<body>
+<canvas id="canvas" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+wtu.setupUnitQuad(gl);
+
+for (var ii = 0; ii < 2; ++ii) {
+ var program = wtu.setupProgram(gl, ["vshader", "fshader" + ii], ["a_position"]);
+ var red_loc = gl.getUniformLocation(program, "u_colors[0].color[" + ii + "]");
+ var green_loc = gl.getUniformLocation(program, "u_colors[0].color[" + (1 - ii) + "]");
+ gl.uniform4fv(red_loc, [1, 0, 0, 1]);
+ gl.uniform4fv(green_loc, [0, 1, 0, 1]);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "Should be red");
+}
+
+var program = wtu.setupProgram(gl, ["vshader", "fshader-with-one-element-arrays"], ["a_position"]);
+var green_loc = gl.getUniformLocation(program, "u_colors[0].color[0]");
+gl.uniform4fv(green_loc, [0, 1, 0, 1]);
+wtu.clearAndDrawUnitQuad(gl);
+wtu.checkCanvas(gl, [0, 255, 0, 255], "Should be green");
+
+var program = wtu.setupProgram(gl, ["vshader", "fshader3"], ["a_position"]);
+var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+shouldBe("numUniforms", "4");
+var uniforms = []
+for (var ii = 0; ii < numUniforms; ++ii) {
+ uniforms.push(gl.getActiveUniform(program, ii).name);
+}
+uniforms.sort();
+shouldBe("uniforms[0]", '"u_colors[0].color1[0]"');
+shouldBe("uniforms[1]", '"u_colors[0].color2[0]"');
+shouldBe("uniforms[2]", '"u_colors[1].color1[0]"');
+shouldBe("uniforms[3]", '"u_colors[1].color2[0]"');
+var loc00 = gl.getUniformLocation(program, "u_colors[0].color1");
+var loc01 = gl.getUniformLocation(program, "u_colors[0].color2");
+var loc10 = gl.getUniformLocation(program, "u_colors[1].color1");
+var loc11 = gl.getUniformLocation(program, "u_colors[1].color2");
+shouldBeTrue("loc00 != undefined");
+shouldBeTrue("loc01 != undefined");
+shouldBeTrue("loc10 != undefined");
+shouldBeTrue("loc11 != undefined");
+gl.uniform4fv(loc00, [1, 0, 0, 0]);
+gl.uniform4fv(loc01, [0, 1, 0, 0]);
+gl.uniform4fv(loc10, [0, 0, 0, 0, 0, 0, 1, 0]);
+gl.uniform4fv(loc11, [0, 0, 0, 0, 0, 0, 0, 1]);
+var loc101 = gl.getUniformLocation(program, "u_colors[1].color1[1]");
+var loc111 = gl.getUniformLocation(program, "u_colors[1].color2[1]");
+shouldBeTrue("loc101 != undefined");
+shouldBeTrue("loc111 != undefined");
+wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 0]);
+gl.uniform4fv(loc101, [0, 0, 0, 0]);
+gl.uniform4fv(loc111, [0, 0, 0, 0]);
+wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 0]);
+wtu.checkCanvas(gl, [255, 255, 0, 0], "Should be yellow");
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html
new file mode 100644
index 0000000000..87560e3e70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-array-of-structs-uniform.html
@@ -0,0 +1,145 @@
+
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL Array of Structs Uniform</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main(void) {
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader0" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec4 color;
+};
+uniform my_struct u_colors[2];
+void main(void) {
+ gl_FragColor = u_colors[0].color;
+}
+</script>
+<script id="fshader1" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec4 color;
+};
+uniform my_struct u_colors[2];
+void main(void) {
+ gl_FragColor = u_colors[1].color;
+}
+</script>
+<script id="fshader2" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec4 color1;
+ vec4 color2;
+};
+uniform my_struct u_colors[2];
+void main(void) {
+ gl_FragColor = u_colors[0].color1 + u_colors[0].color2 + u_colors[1].color1 +u_colors[1].color2;
+}
+</script>
+<script id="fshader3" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ float r;
+ float g;
+ float b;
+ float a;
+};
+uniform my_struct u_colors[2];
+void main(void) {
+ gl_FragColor = vec4(u_colors[0].r, u_colors[0].g, u_colors[1].b, u_colors[1].a);
+}
+</script>
+</head>
+<body>
+<canvas id="canvas" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+wtu.setupUnitQuad(gl);
+
+for (var ii = 0; ii < 2; ++ii) {
+ var program = wtu.setupProgram(gl, ["vshader", "fshader" + ii], ["a_position"]);
+ var red_loc = gl.getUniformLocation(program, "u_colors[" + ii + "].color");
+ var green_loc = gl.getUniformLocation(program, "u_colors[" + (1 - ii) + "].color");
+ gl.uniform4fv(red_loc, [1, 0, 0, 1]);
+ gl.uniform4fv(green_loc, [0, 1, 0, 1]);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "Should be red");
+}
+
+var program = wtu.setupProgram(gl, ["vshader", "fshader2"], ["a_position"]);
+var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+shouldBe("numUniforms", "4");
+var uniforms = []
+for (var ii = 0; ii < numUniforms; ++ii) {
+ uniforms.push(gl.getActiveUniform(program, ii).name);
+}
+uniforms.sort();
+shouldBe("uniforms[0]", '"u_colors[0].color1"');
+shouldBe("uniforms[1]", '"u_colors[0].color2"');
+shouldBe("uniforms[2]", '"u_colors[1].color1"');
+shouldBe("uniforms[3]", '"u_colors[1].color2"');
+var loc00 = gl.getUniformLocation(program, "u_colors[0].color1");
+var loc01 = gl.getUniformLocation(program, "u_colors[0].color2");
+var loc10 = gl.getUniformLocation(program, "u_colors[1].color1");
+var loc11 = gl.getUniformLocation(program, "u_colors[1].color2");
+shouldBeTrue("loc00 != undefined");
+shouldBeTrue("loc01 != undefined");
+shouldBeTrue("loc10 != undefined");
+shouldBeTrue("loc11 != undefined");
+gl.uniform4fv(loc00, [1, 0, 0, 0]);
+gl.uniform4fv(loc01, [0, 1, 0, 0]);
+gl.uniform4fv(loc10, [0, 0, 1, 0]);
+gl.uniform4fv(loc11, [0, 0, 0, 1]);
+wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 0]);
+wtu.checkCanvas(gl, [255, 255, 255, 255], "Should be white");
+
+program = wtu.setupProgram(gl, ["vshader", "fshader3"], ["a_position"]);
+var loc0r = gl.getUniformLocation(program, "u_colors[0].r");
+var loc0g = gl.getUniformLocation(program, "u_colors[0].g");
+var loc0b = gl.getUniformLocation(program, "u_colors[0].b");
+var loc0a = gl.getUniformLocation(program, "u_colors[0].a");
+var loc1r = gl.getUniformLocation(program, "u_colors[1].r");
+var loc1g = gl.getUniformLocation(program, "u_colors[1].g");
+var loc1b = gl.getUniformLocation(program, "u_colors[1].b");
+var loc1a = gl.getUniformLocation(program, "u_colors[1].a");
+shouldBeTrue("loc0r != undefined");
+shouldBeTrue("loc0g != undefined");
+shouldBeTrue("loc1b != undefined");
+shouldBeTrue("loc1a != undefined");
+gl.uniform1f(loc0r, 1);
+gl.uniform1f(loc0g, 1);
+gl.uniform1f(loc1b, 1);
+gl.uniform1f(loc1a, 1);
+wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 0]);
+wtu.checkCanvas(gl, [255, 255, 255, 255], "Should be white");
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html
new file mode 100644
index 0000000000..14b1ffb189
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-array.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses attribute array should fail as per GLSL page 110, appendix A, section 5
+attribute vec4 vPosition[2];
+void main()
+{
+ gl_Position = vPosition[0] + vPosition[1];
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html
new file mode 100644
index 0000000000..f8069d11b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-attrib-struct.vert.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses attribute struct should fail per GLSL ES section 4.4.3, "Attribute", p. 30
+struct UserType {
+ attribute vec4 position;
+};
+
+attribute UserType userAttr;
+void main()
+{
+ gl_Position = userAttr.position;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html
new file mode 100644
index 0000000000..3c9d302854
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-clipvertex.vert.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses gl_ClipVertex should fail
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+ gl_ClipVertex = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html
new file mode 100644
index 0000000000..70816d4173
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-assignment.html
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with comma assignment should succeed
+precision mediump float;
+void main() {
+ float a = 0.0;
+ float b = 0.0;
+ float c = 0.0;
+ float d = 0.0;
+ a = 1.1, b = 3.1;
+ c = 2.1, d = 4.1;
+ // Output green if successful, red if not.
+ gl_FragColor = ((a + b + c + d > 10.0) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runRenderTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html
new file mode 100644
index 0000000000..ec672d569e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-conditional-assignment.html
@@ -0,0 +1,192 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShaderAGreaterThanBCheckR" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 3.0;
+ float b = 2.0;
+ float r = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (r = r0, a) : (r = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((r == r0) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script id="fragmentShaderAGreaterThanBCheckAB" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 3.0;
+ float b = 2.0;
+ float r = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (r = r0, a) : (r = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((ab == a) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script id="fragmentShaderAGreaterThanBCheckT0" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 3.0;
+ float b = 2.0;
+ float t0 = 0.0;
+ float t1 = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (t0 = r0, a) : (t1 = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((t0 == r0) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script id="fragmentShaderAGreaterThanBCheckT1" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 3.0;
+ float b = 2.0;
+ float t0 = 0.0;
+ float t1 = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (t0 = r0, a) : (t1 = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((t1 == 0.0) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script id="fragmentShaderBGreaterThanACheckR" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 2.0;
+ float b = 3.0;
+ float r = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (r = r0, a) : (r = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((r == r1) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script id="fragmentShaderBGreaterThanACheckAB" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 2.0;
+ float b = 3.0;
+ float r = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (r = r0, a) : (r = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((ab == b) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script id="fragmentShaderBGreaterThanACheckT0" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 2.0;
+ float b = 3.0;
+ float t0 = 0.0;
+ float t1 = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (t0 = r0, a) : (t1 = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((t0 == 0.0) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script id="fragmentShaderBGreaterThanACheckT1" type="text/something-not-javascript">
+// fragment shader with for scoping should succeed
+precision mediump float;
+void main() {
+ float a = 2.0;
+ float b = 3.0;
+ float t0 = 0.0;
+ float t1 = 0.0;
+ float r0 = 0.5;
+ float r1 = 1.0;
+ float ab = a > b ? (t0 = r0, a) : (t1 = r1, b);
+ // Output green if successful, red if not.
+ gl_FragColor = ((t1 == r1) ? vec4(0,1,0,1) : vec4(1,0,0,1));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fragmentShaderAGreaterThanBCheckR',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+},
+{
+ fShaderId: 'fragmentShaderAGreaterThanBCheckAB',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+},
+{
+ fShaderId: 'fragmentShaderAGreaterThanBCheckT0',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+},
+{
+ fShaderId: 'fragmentShaderAGreaterThanBCheckT1',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+},
+{
+ fShaderId: 'fragmentShaderBGreaterThanACheckR',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+},
+{
+ fShaderId: 'fragmentShaderBGreaterThanACheckAB',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+},
+{
+ fShaderId: 'fragmentShaderBGreaterThanACheckT0',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+},
+{
+ fShaderId: 'fragmentShaderBGreaterThanACheckT1',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "comma based conditional assignment works",
+}
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html
new file mode 100644
index 0000000000..b63a10ae5d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-comma-separated-variable-declarations.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// shader with comma separated uniform variable declarations should succeed
+precision mediump float;
+
+uniform float x, y;
+
+void main() {
+ gl_FragColor = vec4(x, y, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html
new file mode 100644
index 0000000000..7d5826cf9c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping-negative.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with illegal references to conditionally scoped variables should fail
+precision mediump float;
+void main() {
+ int k = 3;
+
+ if (true) int g = k = 4;
+ else int q = k = 5;
+
+ g = 3; // should error
+ q = 4; // should error
+
+ gl_FragColor = vec4(1.);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html
new file mode 100644
index 0000000000..31b705dfea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-conditional-scoping.html
@@ -0,0 +1,45 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with conditional scoping should succeed
+precision mediump float;
+void main() {
+ int k = 3;
+
+ if (true) int g = k = 4;
+ else int q = k = 5;
+
+ if (true) int g = 4;
+ else int k = 10;
+
+ if (true) { int g = 10; }
+ else { int k = 20; }
+
+ gl_FragColor = vec4(1.);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html
new file mode 100644
index 0000000000..b03af46f4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.frag.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with default precision should succeed
+precision mediump float;
+precision mediump int;
+precision lowp sampler2D;
+precision lowp samplerCube;
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html
new file mode 100644
index 0000000000..a8f43ec6f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-default-precision.vert.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader with default precision should succeed
+precision mediump float;
+precision mediump int;
+precision lowp sampler2D;
+precision lowp samplerCube;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html
new file mode 100644
index 0000000000..50803c92ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx-no-ext.frag.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader that uses dFdx without #extension should fail
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(dFdx(0.5),0.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html
new file mode 100644
index 0000000000..0636867932
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-dfdx.frag.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader that uses dFdx should fail
+#extension GL_OES_standard_derivatives:enable
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(dFdx(0.5),0.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html
new file mode 100644
index 0000000000..76643dd3c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-do-loop.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with do loop should fail
+precision mediump float;
+void main() {
+ int k = 0;
+ do {
+ k++;
+ } while (k < 5);
+ gl_FragColor = vec4(float(k));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html
new file mode 100644
index 0000000000..fec151fc81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-error-directive.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderWithErrorDirective" type="text/something-not-javascript">
+#error testing123 testing123
+void main()
+{
+ gl_FragColor = vec4(0,0,0,0);
+}
+</script>
+<script>
+"use strict";
+description("Checks shader with error directive");
+
+var wtu = WebGLTestUtils;
+GLSLConformanceTester.runTests([
+{ vShaderId: undefined,
+ vShaderSuccess: true,
+ fShaderId: 'fshaderWithErrorDirective',
+ fShaderSuccess: false,
+ // We can't test for the actual error message as
+ // GLSL 1.0.17 11 says the messages are implementation dependant.
+ //fShaderTest: (function() {
+ // return wtu.getLastError().indexOf("testing123 testing123") >= 0; }),
+ linkSuccess: false,
+ passMsg: "error directive causes error",
+},
+]);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html
new file mode 100644
index 0000000000..908dc9fb03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-explicit-int-cast.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that explicit int to float cast should succeed
+attribute vec4 vPosition;
+void main()
+{
+ int k = 123;
+ gl_Position = vec4(vPosition.x, vPosition.y, vPosition.z, float(k));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html
new file mode 100644
index 0000000000..04362b86c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-float-return-value.frag.html
@@ -0,0 +1,46 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with float return value from function call should succeed
+precision mediump float;
+
+float functionResult();
+
+void main()
+{
+ float r = functionResult();
+ gl_FragColor = vec4(r, r, r, r);
+}
+
+float functionResult()
+{
+ return 1.0;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html
new file mode 100644
index 0000000000..cf11a88d9f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-loop.html
@@ -0,0 +1,83 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with for loop should succeed
+
+// TODO(gman): trim to min size to test bug.
+precision mediump float;
+uniform float time;
+uniform vec2 resolution;
+
+// Saw-tooth function that is synced with the demo music (128bpm)
+float gBeat;
+
+// Calculate the surface color
+vec3 surfColor(vec2 p)
+{
+ vec2 q=vec2(sin(.08*p.x),4.*p.y);
+ vec3 c=vec3(0);
+ for(float i=0.;i<15.;i++)
+ c+=(1.+sin(i*sin(time)+vec3(0.,1.3,2.2)))*.2/length(q-vec2(sin(i),12.*sin(.3*time+i)));
+ return c+vec3(mix(mod(floor(p.x*.2)+floor(p.y*2.2),2.),.2,gBeat));
+}
+
+// Ray trace (cylinder)
+vec3 trace(vec3 o,vec3 d)
+{
+ d.y*=.65+.1*sin(.5*time);
+ float D=1./(d.y*d.y+d.z*d.z),
+ a=(o.y*d.y+o.z*d.z)*D,
+ b=(o.y*o.y+o.z*o.z-36.)*D,
+ t=-a-sqrt(a*a-b);
+ o+=t*d;
+ return surfColor(vec2(o.x,atan(o.y,o.z)))*(1.+.01*t);
+}
+
+void main()
+{
+ gBeat=fract(time*3.2/3.);
+ // Screen setup
+ vec2 p=(2.*gl_FragCoord.xy-resolution)/resolution.y,
+ q=2.*gl_FragCoord.xy/resolution-1.;
+
+ // Camera setup
+ vec3 cp=vec3(-time*20.+1.,1.6*sin(time*1.2),2.+2.*cos(time*.3)),
+ ct=cp+vec3(1.,.3*cos(time),-.2),
+ cd=normalize(ct-cp),
+ cr=normalize(cross(cd,vec3(.5*cos(.3*time),0.,1.))),
+ cu=cross(cr,cd),
+ rd=normalize(2.*cd+cr*p.x+cu*p.y);
+
+ // Trace! (+some funky lens/raster effects)
+ vec3 c=trace(cp,rd)*
+ min(1.,1.8-dot(q,q))*
+ (.9+.1*sin(3.*sin(gBeat)*gl_FragCoord.y));
+
+ gl_FragColor=vec4(c,1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html
new file mode 100644
index 0000000000..c4d9620fd5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-for-scoping.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with illegal for scoping should fail
+precision mediump float;
+void main() {
+ int k = 0;
+ for (int i = 0; i < 10; i++) { int i = k+i; } // not a nested scope, in i's scope, nesting already happened
+ gl_FragColor = vec4(float(k));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html
new file mode 100644
index 0000000000..48454492c4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-frag-depth.frag.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader that uses gl_FragDepth should fail
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(0.0,0.0,0.0,1.0);
+ gl_FragDepth = 1.0;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html
new file mode 100644
index 0000000000..dfa12e471a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-recursion.frag.html
@@ -0,0 +1,45 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// shader with recursive function calls should fail
+void a();
+void b();
+void main()
+{
+ a();
+ gl_FragColor = vec4(0,0,0,0);
+}
+void a()
+{
+ b();
+}
+void b()
+{
+ a();
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html
new file mode 100644
index 0000000000..be694ae5ee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-function-scoped-struct.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with private function scoped struct should fail.
+precision mediump float;
+int fun2(struct s { int m; } g) { return g.m; }
+
+s a;
+
+void main() {
+ int e = fun2(s(3));
+
+ gl_FragColor = vec4(1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html
new file mode 100644
index 0000000000..c18f3cc495
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-functional-scoping.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with invalid functional scoping should fail
+precision mediump float;
+int f(int k) {
+ int k = k + 3;
+ return k;
+}
+
+void main() {
+ gl_FragColor = vec4(f(100));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html
new file mode 100644
index 0000000000..52cd783902
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glcolor.vert.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses gl_Color should fail
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = gl_Color;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html
new file mode 100644
index 0000000000..bc8a7b3a8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-1.frag.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader that expects GL_ES == 1 should succeed
+#if GL_ES == 1
+ precision mediump float;
+ void main()
+ {
+ gl_FragColor = vec4(0.0,0.0,0.0,1.0);
+ }
+#else
+ foo
+#endif
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html
new file mode 100644
index 0000000000..b569958f5a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-gles-symbol.frag.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader that uses GL_ES preprocessor symbol should succeed
+#if defined(GL_ES)
+ precision mediump float;
+ void main()
+ {
+ gl_FragColor = vec4(0.0,0.0,0.0,1.0);
+ }
+#else
+ foo
+#endif
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html
new file mode 100644
index 0000000000..6303915f30
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-global-variable-precision-mismatch.html
@@ -0,0 +1,128 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderWithMediumpGlobal" type="text/something-not-javascript">
+// There is no default float precision in fragment shaders, so specify mediump.
+precision mediump float;
+
+uniform vec4 foo;
+
+void main()
+{
+ gl_FragColor = foo;
+}
+</script>
+<script id="fshaderWithMediumpGlobalInt" type="text/something-not-javascript">
+// Default precision for int in fragment shaders is mediump.
+uniform int foo;
+
+void main()
+{
+ gl_FragColor = vec4(foo, 0, 0, 1);
+}
+</script>
+<script id="fshaderWithMediumpGlobalStruct" type="text/something-not-javascript">
+// There is no default float precision in fragment shaders, so specify mediump.
+precision mediump float;
+
+struct foo
+{
+ vec4 bar;
+};
+
+uniform foo baz;
+
+void main()
+{
+ gl_FragColor = baz.bar;
+}
+</script>
+<script id="vshaderWithHighpGlobal" type="x-shader/x-vertex">
+// Default precision for vertex shaders is highp.
+uniform vec4 foo;
+
+void main() {
+ gl_Position = foo;
+}
+</script>
+<script id="vshaderWithHighpGlobalInt" type="x-shader/x-vertex">
+// Default precision for int in vertex shaders is highp.
+uniform int foo;
+
+void main() {
+ gl_Position = vec4(foo, 0, 0, 1);
+}
+</script>
+<script id="vshaderWithHighpGlobalStruct" type="x-shader/x-vertex">
+// Default precision for vertex shaders is highp.
+struct foo
+{
+ vec4 bar;
+};
+
+uniform foo baz;
+
+void main()
+{
+ gl_Position = baz.bar;
+}
+</script>
+<script>
+"use strict";
+description("Checks shaders with global variables and precision qualifier mismatch.");
+
+var wtu = WebGLTestUtils;
+
+var glslTests = [];
+
+glslTests.push({
+ vShaderId: 'vshaderWithHighpGlobal',
+ vShaderSuccess: true,
+ fShaderId: 'fshaderWithMediumpGlobal',
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "mismatching precision for uniforms causes link error (as expected)",
+});
+
+glslTests.push({
+ vShaderId: 'vshaderWithHighpGlobalInt',
+ vShaderSuccess: true,
+ fShaderId: 'fshaderWithMediumpGlobalInt',
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "mismatching precision for int uniforms with default precision causes link error (as expected)",
+});
+
+glslTests.push({
+ vShaderId: 'vshaderWithHighpGlobalStruct',
+ vShaderSuccess: true,
+ fShaderId: 'fshaderWithMediumpGlobalStruct',
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "mismatching precision for structure uniforms causes link error (as expected)",
+});
+
+GLSLConformanceTester.runTests(glslTests);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html
new file mode 100644
index 0000000000..9387918f1a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-glprojectionmatrix.vert.html
@@ -0,0 +1,35 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses gl_ProjectionMatrix should fail
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition * gl_ProjectionMatrix;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html
new file mode 100644
index 0000000000..7a9ed875b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-hex-int-constant-macro.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader uses the long integer constant should succeed
+attribute vec4 vPosition;
+void main()
+{
+ #define TEST 0x1F
+ int a = TEST;
+
+ gl_Position = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html
new file mode 100644
index 0000000000..04902c50db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.frag.html
@@ -0,0 +1,238 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShaderVoid" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump void;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderBool" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump bool;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderVec2" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump vec2;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderVec3" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump vec3;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderVec4" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump vec4;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderBvec2" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump bvec2;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderBvec3" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump bvec3;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderBvec4" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump bvec4;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderIvec2" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump ivec2;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderIvec3" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump ivec3;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderIvec4" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump ivec4;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderMat2" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump mat2;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderMat3" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump mat3;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script id="fragmentShaderMat4" type="text/something-not-javascript">
+// fragment shader with default precision for illegal type should fail
+precision mediump mat4;
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTests([
+ {
+ fShaderId: 'fragmentShaderVoid',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for void should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderBool',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bool should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderVec2',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for vec2 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderVec3',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for vec3 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderVec4',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for vec4 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderBvec2',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bvec2 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderBvec3',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bvec3 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderBvec4',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bvec4 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderIvec2',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for ivec2 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderIvec3',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for ivec3 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderIvec4',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for ivec4 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderMat2',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for mat2 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderMat3',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for mat3 should fail'
+ },
+ {
+ fShaderId: 'fragmentShaderMat4',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for mat4 should fail'
+ }
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html
new file mode 100644
index 0000000000..5710fddfd5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-illegal-default-precision.vert.html
@@ -0,0 +1,224 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShaderVoid" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump void;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderBool" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump bool;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderVec2" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump vec2;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderVec3" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump vec3;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderVec4" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump vec4;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderBvec2" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump bvec2;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderBvec3" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump bvec3;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderBvec4" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump bvec4;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderIvec2" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump ivec2;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderIvec3" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump ivec3;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderIvec4" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump ivec4;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderMat2" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump mat2;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderMat3" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump mat3;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="vertexShaderMat4" type="text/something-not-javascript">
+// vertex shader with default precision for illegal type should fail
+precision mediump mat4;
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTests([
+ { vShaderId: 'vertexShaderVoid',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for void should fail'
+ },
+ { vShaderId: 'vertexShaderBool',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bool should fail'
+ },
+ { vShaderId: 'vertexShaderVec2',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for vec2 should fail'
+ },
+ { vShaderId: 'vertexShaderVec3',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for vec3 should fail'
+ },
+ { vShaderId: 'vertexShaderVec4',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for vec4 should fail'
+ },
+ { vShaderId: 'vertexShaderBvec2',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bvec2 should fail'
+ },
+ { vShaderId: 'vertexShaderBvec3',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bvec3 should fail'
+ },
+ { vShaderId: 'vertexShaderBvec4',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for bvec4 should fail'
+ },
+ { vShaderId: 'vertexShaderIvec2',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for ivec2 should fail'
+ },
+ { vShaderId: 'vertexShaderIvec3',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for ivec3 should fail'
+ },
+ { vShaderId: 'vertexShaderIvec4',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for ivec4 should fail'
+ },
+ { vShaderId: 'vertexShaderMat2',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for mat2 should fail'
+ },
+ { vShaderId: 'vertexShaderMat3',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for mat3 should fail'
+ },
+ { vShaderId: 'vertexShaderMat4',
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'shader with default precision for mat4 should fail'
+ }
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html
new file mode 100644
index 0000000000..c77a3e1915
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-implicit-vec3-to-vec4-cast.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that implicit vec3 to vec4 cast should fail
+attribute vec4 vPosition;
+void main()
+{
+ mediump vec3 k = vec3(1, 2, 3);
+ gl_Position = k;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html
new file mode 100644
index 0000000000..bc0cf93cc2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-include.vert.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader uses #include should fail
+
+// Sadly I can not force the current path so this could fail beacuse include.vs
+// does not exist, not because #include is disallowed.
+#include "include.vs"
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html
new file mode 100644
index 0000000000..7b4430c0f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-int-return-value.frag.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with int return value from function call should succeed
+int functionResult();
+
+void main()
+{
+ int r = functionResult();
+ gl_FragColor = vec4(r, r, r, r);
+}
+
+int functionResult()
+{
+ return 1;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html
new file mode 100644
index 0000000000..af918519c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-invalid-identifier.frag.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with gl_ identifier should fail
+precision mediump float;
+uniform float gl_foo;
+void main()
+{
+ gl_FragColor = vec4(gl_foo,0.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html
new file mode 100644
index 0000000000..2445e7d3c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec2-return-value.frag.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with ivec2 return value from function call should succeed
+ivec2 functionResult();
+
+void main()
+{
+ ivec2 r = functionResult();
+ gl_FragColor = vec4(r.x, r.y, r.x, r.y);
+}
+
+ivec2 functionResult()
+{
+ return ivec2(1, 1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html
new file mode 100644
index 0000000000..c765ef9259
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec3-return-value.frag.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with ivec3 return value from function call should succeed
+ivec3 functionResult();
+
+void main()
+{
+ ivec3 r = functionResult();
+ gl_FragColor = vec4(r.x, r.y, r.z, r.x);
+}
+
+ivec3 functionResult()
+{
+ return ivec3(1, 1, 1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html
new file mode 100644
index 0000000000..77317d22e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-ivec4-return-value.frag.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with ivec4 return value from function call should succeed
+ivec4 functionResult();
+
+void main()
+{
+ ivec4 r = functionResult();
+ gl_FragColor = vec4(r.x, r.y, r.z, r.w);
+}
+
+ivec4 functionResult()
+{
+ return ivec4(1, 1, 1, 1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html
new file mode 100644
index 0000000000..df7401ef3c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-limited-indexing.frag.html
@@ -0,0 +1,54 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader should succeed
+attribute vec4 a_weights;
+varying vec4 v_weights;
+
+void main() {
+ v_weights = a_weights;
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with appropriately limited indexing expression should succeed
+// http://www.khronos.org/registry/webgl/specs/latest/#SUPPORTED_GLSL_CONSTRUCTS
+precision mediump float;
+
+uniform vec4 u_colors[8];
+varying vec4 v_weights;
+
+void main()
+{
+ vec4 color = vec4(0.0, 0.0, 0.0, 0.0);
+ for (int i = 0; i < 4; i++) {
+ color += u_colors[i] * v_weights[i];
+ }
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html
new file mode 100644
index 0000000000..4f22beb027
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-long-line.html
@@ -0,0 +1,67 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderWithLongLine" type="text/something-not-javascript">
+precision mediump float;
+uniform float fooo;
+#if defined(someSymbolNotDefined)
+#error long
+#endif
+void main()
+{
+ gl_FragColor = vec4(fooo+fooo+fooo+fooo, fooo+fooo+fooo+fooo, fooo+fooo+fooo+fooo, 1.0);
+}
+</script>
+<script>
+"use strict";
+description("checks shader with long line succeeds");
+
+var wtu = WebGLTestUtils;
+GLSLConformanceTester.runTests([
+ {
+ fShaderId: 'fshaderWithLongLine',
+ fShaderSuccess: true,
+ fShaderPrep: function(str) {
+ function expand(str, re, replacement, count) {
+ for (var ii = 0; ii < count; ++ii) {
+ str = str.replace(re, replacement);
+ }
+ return str;
+ }
+ str = expand(str, new RegExp(" ", 'g'), " ", 12);
+ var manyZeros = expand("0", new RegExp("0", 'g'), "00", 8).substring(2);
+ str = expand(str, new RegExp("0", 'g'), manyZeros, 1);
+ str = expand(str, new RegExp("fooo", 'g'), "fooofooo", 6);
+ str = expand(str, new RegExp("long", 'g'), "longlong", 6);
+ //debug("len:" + str.length);
+ //debug(str);
+ return str;
+ },
+ linkSuccess: true,
+ passMsg: 'shader that uses long lines should succeed',
+ }
+ ]);
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html
new file mode 100644
index 0000000000..b80cf3a995
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-ascii-error.frag.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// shader with error directive using characters outside of allowed set fails
+#error // will return INVALID_VALUE. See WebGL 6.18
+void main()
+{
+ gl_FragColor = vec4(0,0,0,0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-1-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-1-of-8.html
new file mode 100644
index 0000000000..f2f8bc674e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-1-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 1 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 1;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-2-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-2-of-8.html
new file mode 100644
index 0000000000..4be404a5d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-2-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 2 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 2;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-3-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-3-of-8.html
new file mode 100644
index 0000000000..58b8ab21d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-3-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 3 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 3;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-4-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-4-of-8.html
new file mode 100644
index 0000000000..4c2162970a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-4-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 4 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 4;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-5-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-5-of-8.html
new file mode 100644
index 0000000000..546cc04d84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-5-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 5 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 5;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-6-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-6-of-8.html
new file mode 100644
index 0000000000..7fad96cedc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-6-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 6 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 6;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-7-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-7-of-8.html
new file mode 100644
index 0000000000..b45abfe2bb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-7-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 7 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 7;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-8-of-8.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-8-of-8.html
new file mode 100644
index 0000000000..f901cacc58
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-non-reserved-words-8-of-8.html
@@ -0,0 +1,31 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Non Reserved Words 8 of 8</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/shader-with-non-reserved-words.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const numParts = 8;
+const part = 8;
+testNonReservedWords(part, numParts);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html
new file mode 100644
index 0000000000..536b66ec0b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-precision.frag.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with precision should succeed
+void main()
+{
+ mediump vec4 color = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html
new file mode 100644
index 0000000000..c8e31d5927
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-preprocessor-whitespace.html
@@ -0,0 +1,62 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexWhitespace" type="text/something-not-javascript">
+// GLSL ES spec section 3.4
+ # ifdef GL_ES
+attribute vec4 v_Position;
+void main()
+{
+ gl_Position = v_Position;
+}
+#endif
+</script>
+<script id="fragmentWhitespace" type="text/something-not-javascript">
+// GLSL ES spec section 3.4
+ # ifdef GL_ES
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(0.0,0.0,0.0,1.0);
+}
+#endif
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: 'vertexWhitespace',
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Vertex shader using space and tab characters around # should succeed'
+ },
+ {
+ fShaderId: 'fragmentWhitespace',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Fragment shader using space and tab characters around # should succeed'
+ }
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html
new file mode 100644
index 0000000000..c79315d3f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-quoted-error.frag.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// shader with error directive using quotes will fail
+#error "testing123 testing123" // will return INVALID_VALUE. See WebGL 6.18
+void main()
+{
+ gl_FragColor = vec4(0,0,0,0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html
new file mode 100644
index 0000000000..fd6953e0fe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-reserved-words.html
@@ -0,0 +1,263 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Reserved Words</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader0" type="text/something-not-javascript">
+struct $replaceMe {
+ vec4 $replaceMe;
+};
+struct Foo {
+ $replaceMe $replaceMe;
+};
+attribute vec4 position;
+void main()
+{
+ Foo f;
+ f.$replaceMe.$replaceMe = position;
+ gl_Position = f.$replaceMe.$replaceMe;
+}
+</script>
+<script id="fragmentShader0" type="text/something-not-javascript">
+precision mediump float;
+vec4 $replaceMe() {
+ return vec4(0,1,0,1);
+}
+void main()
+{
+ gl_FragColor = $replaceMe();
+}
+</script>
+<script id="vertexShader1" type="text/something-not-javascript">
+attribute vec4 $replaceMe;
+void main()
+{
+ gl_Position = $replaceMe;
+}
+</script>
+<script id="fragmentShader1" type="text/something-not-javascript">
+precision mediump float;
+vec4 foo(vec4 $replaceMe) {
+ return $replaceMe;
+}
+void main()
+{
+ gl_FragColor = foo(vec4(1,0,1,1));
+}
+</script>
+<script id="vertexShader2" type="text/something-not-javascript">
+varying vec4 $replaceMe;
+attribute vec4 position;
+void main()
+{
+ gl_Position = position;
+ $replaceMe = position;
+}
+</script>
+<script id="fragmentShader2" type="text/something-not-javascript">
+precision mediump float;
+varying vec4 $replaceMe;
+void main()
+{
+ gl_FragColor = $replaceMe;
+}
+</script>
+<script id="vertexShader3" type="text/something-not-javascript">
+attribute vec4 position;
+void main()
+{
+ gl_Position = position;
+}
+</script>
+<script id="fragmentShader3" type="text/something-not-javascript">
+precision mediump float;
+uniform vec4 $replaceMe;
+void main()
+{
+ gl_FragColor = $replaceMe;
+}
+</script>
+<script>
+"use strict";
+var GLSL_1_0_17_words = [
+ "attribute",
+ "const",
+ "uniform",
+ "varying",
+ "break",
+ "continue",
+ "do",
+ "for",
+ "while",
+ "if",
+ "else",
+ "in",
+ "out",
+ "inout",
+ "float",
+ "int",
+ "void",
+ "bool",
+ "true",
+ "false",
+ "lowp",
+ "mediump",
+ "highp",
+ "precision",
+ "invariant",
+ "discard",
+ "return",
+ "mat2",
+ "mat3",
+ "mat4",
+ "vec2",
+ "vec3",
+ "vec4",
+ "ivec2",
+ "ivec3",
+ "ivec4",
+ "bvec2",
+ "bvec3",
+ "bvec4",
+ "sampler2D",
+ "samplerCube",
+ "struct"
+]
+
+var GLSL_1_0_17_FutureWords = [
+ "asm",
+ "class",
+ "union",
+ "enum",
+ "typedef",
+ "template",
+ "this",
+ "packed",
+ "goto",
+ "switch",
+ "default",
+ "inline",
+ "noinline",
+ "volatile",
+ "public",
+ "static",
+ "extern",
+ "external",
+ "interface",
+ "flat",
+ "long",
+ "short",
+ "double",
+ "half",
+ "fixed",
+ "unsigned",
+ "superp",
+ "input",
+ "output",
+ "hvec2",
+ "hvec3",
+ "hvec4",
+ "dvec2",
+ "dvec3",
+ "dvec4",
+ "fvec2",
+ "fvec3",
+ "fvec4",
+ "sampler1D",
+ "sampler3D",
+ "sampler1DShadow",
+ "sampler2DShadow",
+ "sampler2DRect",
+ "sampler3DRect",
+ "sampler2DRectShadow",
+ "sizeof",
+ "cast",
+ "namespace",
+ "using",
+ "__foo", // something that has 2 underscores
+ "foo__bar", // something that has 2 underscores
+ "gl_foo", // something that starts with gl_
+ "webgl_foo" // something that starts with webgl_
+];
+
+description();
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+var reservedWordsLists = [
+ GLSL_1_0_17_words,
+ GLSL_1_0_17_FutureWords
+];
+
+var reservedWords = [];
+for (var ii = 0; ii < reservedWordsLists.length; ++ii) {
+ var list = reservedWordsLists[ii];
+ for (var jj = 0; jj < list.length; ++jj) {
+ reservedWords.push(list[jj]);
+ }
+}
+
+var src = [];
+for (var ii = 0; ii < 4; ++ii) {
+ var vsrc = document.getElementById("vertexShader" + ii).text;
+ var fsrc = document.getElementById("fragmentShader" + ii).text;
+ src.push({vsrc: vsrc, fsrc: fsrc});
+}
+
+var wordNdx = 0;
+
+function testNextWord() {
+ if (wordNdx >= reservedWords.length) {
+ finishTest();
+ return;
+ }
+ testWord(reservedWords[wordNdx]);
+ ++wordNdx;
+ setTimeout(testNextWord, 0);
+}
+testNextWord();
+
+function testWord(word) {
+ debug("");
+ debug("testing: " + word);
+
+ for (var ii = 0; ii < src.length; ++ii) {
+ var vs = src[ii].vsrc.replace(/\$replaceMe/g, word);
+ var fs = src[ii].fsrc.replace(/\$replaceMe/g, word);
+
+ var success = true;
+ var program = wtu.loadProgram(gl, vs, fs, function(msg) {
+ //debug(msg);
+ success = false;
+ }, true);
+ if (success) {
+ testFailed("shader with: '" + word + "' compiled even though it should not");
+ } else {
+ testPassed("shader with: '" + word + "' correctly failed to compile");
+ }
+ if (program) {
+ gl.deleteProgram(program);
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no GL errors");
+ }
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html
new file mode 100644
index 0000000000..c05649aa83
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-short-circuiting-operators.html
@@ -0,0 +1,156 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL short-circuit evaluation</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+
+<!-------------------------------------
+ WebGL Shaders
+---------------------------------------->
+<!-- Pass through Shaders -->
+<script id="vshader0" type="x-shader/x-vertex">
+/* PASS-THROUGH VERTEX SHADER */
+attribute vec4 vPosition;
+
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader0" type="x-shader/x-fragment">
+/* PASS-THROUGH FRAGMENT SHADER */
+precision mediump float;
+varying vec4 vPassThrough;
+
+void main()
+{
+ gl_FragColor = vPassThrough;
+}
+</script>
+
+<!-- basic conditonal short circuit Shaders -->
+<script id="vshader1" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec4 vPassThrough;
+
+void main()
+{
+ int x = 1;
+ $(variables)
+
+ if ($(condition))
+ { /*do nothing*/ }
+
+ /* if x was unmodified return green, else return red */
+ vPassThrough = (x == 1) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader1" type="x-shader/x-fragment">
+precision mediump float;
+
+void main()
+{
+ int x = 1;
+ $(variables)
+
+ if ($(condition))
+ { /*do nothing*/ }
+
+ gl_FragColor = (x == 1) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+</script>
+
+<!-- Main body of the Webgl program -->
+<script>
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+wtu.setupUnitQuad(gl, [0, 1]);
+
+var shaderTemplates = [
+ { vs: "vshader1", fs: "fshader0" }, // basic vertex short-circuit test
+ { vs: "vshader0", fs: "fshader1" }, // basic fragment short-circuit test
+];
+
+/* replace the names of the shaders in the tempate variables with
+ * the shaders themselves */
+for (var ii = 0; ii < shaderTemplates.length; ++ii) {
+ var template = shaderTemplates[ii];
+ template.vs = wtu.getScript(template.vs);
+ template.fs = wtu.getScript(template.fs);
+}
+
+/* define the conditon that will be used in the shaders. If additional
+ * variables are needed that are not present i the shader they my be
+ * defined in the variables variable */
+var tests = [
+ { condition: "true || (x = 0) == 1", variables: "" }, /* test basic 'or' short circuit */
+ { condition: "false && (x = 0) == 1", variables: "" }, /* test basic 'and' short circuit */
+ { condition: "(j == 3 && j == k) || (j > (x = 0))", variables: "int j = 3;\nint k = 3;" }, /* test basic 'or' short circuit with actual condition */
+ { condition: "(j == 3 && j == k) && (j > (x = 0))", variables: "int j = 3;\nint k = 4;" }, /* test basic 'and' short circuit with actual condition */
+ { condition: "(j + 3 > k && ((j < 10) || (x + 5 > j + (x = 0))) || ( x = 0 ) == 7)", variables: "int j = 5;\nint k = 3;" }, /* complex test */
+ { condition: "j + 1 == 6 ? x == 1 || j > (x = 0) : (x = 0) == 1 && (x = 0) <= 1", variables: "int j = 5;" }, /* nested with ternary operator */
+ { condition: "true && (true || (x = 0) == 1)", variables: "" }, /* test unfold short circuit update order correctness */
+];
+
+function testShortCircuit(test) {
+ debug("");
+ debug("testing short circuit condition: " + test.condition);
+
+ /* Setting clear color to blue */
+ gl.clearColor(0.0, 0.0, 1.0, 1.0);
+
+ for (var ii = 0; ii < shaderTemplates.length; ++ii) {
+
+ /* clear the screen so that subsequent tests don't conflict */
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var template = shaderTemplates[ii];
+
+ var vs = wtu.replaceParams(template.vs, test);
+ var fs = wtu.replaceParams(template.fs, test);
+
+ var program = wtu.setupProgram(gl, [vs, fs], ['vPosition'], undefined, true);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0);
+
+ gl.deleteProgram(program);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no GL errors");
+ }
+}
+
+var testNdx = 0;
+function runNextTest() {
+ testShortCircuit(tests[testNdx++]);
+ if (testNdx >= tests.length) {
+ finishTest();
+ } else {
+ setTimeout(runNextTest, 0);
+ }
+}
+
+runNextTest();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html
new file mode 100644
index 0000000000..e96ab4055c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-similar-uniform-array-names.html
@@ -0,0 +1,109 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL similar names issue</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main(void) {
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader1" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_nameCollision[2];
+uniform vec4 u_nameCollision2[2];
+uniform vec4 u_name[2];
+void main(void) {
+ gl_FragColor = u_nameCollision[0] + u_nameCollision2[0] + u_name[0];
+}
+</script>
+<script id="fshader2" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_nameCollision2[2];
+uniform vec4 u_nameCollision[2];
+uniform vec4 u_name[2];
+void main(void) {
+ gl_FragColor = u_nameCollision2[0] + u_nameCollision[0] + u_name[0];
+}
+</script>
+<script id="fshader3" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_nameCollision[2];
+uniform vec4 u_name[2];
+uniform vec4 u_nameCollision2[2];
+void main(void) {
+ gl_FragColor = u_nameCollision[0] + u_name[0] + u_nameCollision2[0];
+}
+</script>
+<script id="fshader4" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_nameCollision2[2];
+uniform vec4 u_name[2];
+uniform vec4 u_nameCollision[2];
+void main(void) {
+ gl_FragColor = u_nameCollision2[0] + u_name[0] + u_nameCollision[0];
+}
+</script>
+<script id="fshader5" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_name[2];
+uniform vec4 u_nameCollision[2];
+uniform vec4 u_nameCollision2[2];
+void main(void) {
+ gl_FragColor = u_name[0] + u_nameCollision[0] + u_nameCollision2[0];
+}
+</script>
+<script id="fshader6" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_name[2];
+uniform vec4 u_nameCollision2[2];
+uniform vec4 u_nameCollision[2];
+void main(void) {
+ gl_FragColor = u_name[0] + u_nameCollision2[0] + u_nameCollision[0];
+}
+</script>
+</head>
+<body>
+<canvas id="canvas" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+wtu.setupUnitQuad(gl);
+
+for (var ii = 0; ii < 6; ++ii) {
+ var program = wtu.setupProgram(gl, ["vshader", "fshader" + (ii + 1)], ["a_position"]);
+ var loc1 = gl.getUniformLocation(program, "u_name[0]");
+ var loc2 = gl.getUniformLocation(program, "u_nameCollision[0]");
+ var loc3 = gl.getUniformLocation(program, "u_nameCollision2[0]");
+ gl.uniform4fv(loc1, [1, 0, 0, 0]);
+ gl.uniform4fv(loc2, [0, 1, 0, 0]);
+ gl.uniform4fv(loc3, [0, 0, 0, 1]);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 255, 0, 255], "Should be yellow");
+}
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html
new file mode 100644
index 0000000000..b5e87f9c85
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-too-many-uniforms.html
@@ -0,0 +1,123 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main()
+{
+ gl_Position = a_position;
+}
+</script>
+<script id="vshader-max" type="x-shader/x-vertex">
+attribute vec4 a_position;
+uniform vec4 u_color[$(maxUniformVectors)];
+void main()
+{
+ vec4 v = vec4(0, 0, 0, 0);
+ for (int i = 0; i < $(maxUniformVectors); ++i) {
+ v = v + vec4(u_color[i]);
+ }
+ gl_Position = a_position + v;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(0, 1, 0, 1);
+}
+</script>
+<script id="fshader-max" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_color[$(maxUniformVectors)];
+void main()
+{
+ vec4 v = vec4(0, 0, 0, 0);
+ for (int i = 0; i < $(maxUniformVectors); ++i) {
+ v = v + vec4(u_color[i]);
+ }
+ gl_FragColor = v;
+}
+</script>
+<script>
+"use strict";
+description("checks shader with too many uniforms fails");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var maxFragmentUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);
+var maxVertexUniformVectors = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);
+
+// Up to 2 uniform vector registers may be spent for literal constants in
+// vshader-max or fshader-max code. One vector row is used for the vec4, and
+// another may be used for integer constants that are allowed to be treated
+// internally as floats and are packable to the space of one row. This is
+// according to the GLSL ES variable packing algorithm detailed in Section 7 of
+// Appendix A of the GLSL ES Specification 10.0.17.
+var maxVectorStorageUsedForLiterals = 2;
+
+var tests = [
+ { desc: "using all uniforms in vertex shader should succeed",
+ maxUniformVectors: maxVertexUniformVectors - maxVectorStorageUsedForLiterals,
+ vShader: "vshader-max",
+ fShader: "fshader",
+ success: true,
+ },
+ { desc: "using too many uniforms in vertex shader should fail",
+ maxUniformVectors: maxVertexUniformVectors + 1,
+ vShader: "vshader-max",
+ fShader: "fshader",
+ color: [0, 1, 0, 1],
+ success: false,
+ },
+ { desc: "using all uniforms in fragment shader should succeed",
+ maxUniformVectors: maxFragmentUniformVectors - maxVectorStorageUsedForLiterals,
+ vShader: "vshader",
+ fShader: "fshader-max",
+ success: true,
+ },
+ { desc: "using too many uniforms in fragment shader should fail",
+ maxUniformVectors: maxFragmentUniformVectors + 1,
+ vShader: "vshader",
+ fShader: "fshader-max",
+ color: [0, 1, 0, 1],
+ success: false,
+ },
+];
+
+var glslTests = [];
+
+for (var ii = 0; ii < tests.length; ++ii) {
+ var test = tests[ii];
+ var vSrc = wtu.replaceParams(wtu.getScript(test.vShader), test);
+ var fSrc = wtu.replaceParams(wtu.getScript(test.fShader), test);
+ glslTests.push({
+ vShaderSource: vSrc,
+ fShaderSource: fSrc,
+ linkSuccess: test.success,
+ passMsg: 'shader ' + test.desc,
+ });
+}
+
+GLSLConformanceTester.runTests(glslTests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html
new file mode 100644
index 0000000000..fac53b08d8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-two-initializer-types.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with different initializer types should succeed
+precision mediump float;
+
+void main() {
+ float test1[4], test2;
+ gl_FragColor = vec4(0.0,1.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html
new file mode 100644
index 0000000000..06783bcfd8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-undefined-preprocessor-symbol.frag.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader (3.4) undefined preprocessor symbol should fail
+#if UNDEFINED_FOO
+ // according to ES GLSL spec 3.4 undefined symbols should fail.
+#else
+ precision mediump float;
+ void main()
+ {
+ gl_FragColor = vec4(0.0,0.0,0.0,1.0);
+ }
+#endif
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html
new file mode 100644
index 0000000000..be8d3067b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-uniform-in-loop-condition.vert.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader with uniform variable in loop condition should fail
+// http://www.khronos.org/registry/webgl/specs/latest/#SUPPORTED_GLSL_CONSTRUCTS
+uniform int u_numIterations;
+attribute vec4 a_position;
+
+void main()
+{
+ float count = 0.0;
+ for (int i = 0; i < u_numIterations; i++) {
+ count += 1.0;
+ }
+ gl_Position = a_position + vec4(count, count, count, count);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html
new file mode 100644
index 0000000000..c5f5860707
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec2-return-value.frag.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with vec2 return value from function call should succeed
+precision mediump float;
+
+vec2 functionResult();
+
+void main()
+{
+ vec2 r = functionResult();
+ gl_FragColor = vec4(r.x, r.y, r.x, r.y);
+}
+
+vec2 functionResult()
+{
+ return vec2(1.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html
new file mode 100644
index 0000000000..fe5a60c6c4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec3-return-value.frag.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with vec3 return value from function call should succeed
+precision mediump float;
+
+vec3 functionResult();
+
+void main()
+{
+ vec3 r = functionResult();
+ gl_FragColor = vec4(r.x, r.y, r.z, r.x);
+}
+
+vec3 functionResult()
+{
+ return vec3(1.0, 1.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html
new file mode 100644
index 0000000000..69001a0f83
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-return-value.frag.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shader with vec4 return value from function call should succeed
+precision mediump float;
+
+vec4 functionResult();
+
+void main()
+{
+ vec4 r = functionResult();
+ gl_FragColor = vec4(r.x, r.y, r.z, r.w);
+}
+
+vec4 functionResult()
+{
+ return vec4(1.0, 1.0, 1.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html
new file mode 100644
index 0000000000..2cc0e8ea61
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-vec4-vec3-vec4-conditional.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader that vec4->vec3->vec4 conditional should succeed
+precision mediump float;
+uniform float x;
+void main()
+{
+ gl_FragColor = vec4((x > 0.0 ? vec4(1.0, 1.0, 1.0, 0.0) : vec4(0.1, 0.1, 0.1, 0.0)).xyz, 1.0);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html
new file mode 100644
index 0000000000..0d88a7f689
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.frag.html
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader that uses __VERSION__==100 should succeed
+#if __VERSION__ == 100
+ precision mediump float;
+ void main()
+ {
+ gl_FragColor = vec4(0.0,0.0,0.0,1.0);
+ }
+#else
+ foo
+#endif
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html
new file mode 100644
index 0000000000..9a0357971f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-100.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader uses the #version 100 directive should succeed
+#version 100
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html
new file mode 100644
index 0000000000..c1bc6d7d07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-120.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader uses the #version not 100 directive should fail
+#version 120
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html
new file mode 100644
index 0000000000..6983c92f9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-version-130.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader uses the #version not 100 directive should fail
+#version 130
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html
new file mode 100644
index 0000000000..a1c0af9d9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-webgl-identifier.vert.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader that uses webgl identifier should fail
+attribute vec4 webgl_vPosition;
+void main()
+{
+ gl_Position = webgl_vPosition;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html
new file mode 100644
index 0000000000..592f55541e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-with-while-loop.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with while loop should fail
+precision mediump float;
+void main() {
+ int k = 0;
+ while (k < 5) {
+ k++;
+ }
+ gl_FragColor = vec4(float(k));
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html
new file mode 100644
index 0000000000..c5543e2119
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shader-without-precision.frag.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader without precision should fail
+uniform vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html
new file mode 100644
index 0000000000..c06de87ef8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-constant-expression-loop-conditions.html
@@ -0,0 +1,115 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShaderLiteralLoopCondition" type="text/something-not-javascript">
+attribute vec4 a_position;
+void main()
+{
+ for (int i = 0; i < 5 + 5; i++) { }
+ gl_Position = a_position;
+}
+</script>
+<script id="fragmentShaderLiteralLoopCondition" type="text/something-not-javascript">
+void main()
+{
+ for (int i = 0; i < 5 + 5; i++) { }
+ gl_FragColor = vec4(1.0);
+}
+</script>
+<script id="vertexShaderConstVarLoopCondition" type="text/something-not-javascript">
+attribute vec4 a_position;
+void main()
+{
+ // Explicitly constant variables can be part of a constant expression
+ const int constVar = 5;
+ for (int i = 0; i < 5 + constVar; i++) { }
+ gl_Position = a_position;
+}
+</script>
+<script id="fragmentShaderConstVarLoopCondition" type="text/something-not-javascript">
+void main()
+{
+ // Explicitly constant variables can be part of a constant expression
+ const int constVar = 5;
+ for (int i = 0; i < constVar + 5; i++) { }
+ gl_FragColor = vec4(1.0);
+}
+</script>
+<script id="vertexShaderNonConstVarLoopCondition" type="text/something-not-javascript">
+attribute vec4 a_position;
+void main()
+{
+ // Despite assigning a constant and not modifying it, nonConstVar is not semantically a constant expression
+ int nonConstVar = 10;
+ for (int i = 0; i < nonConstVar; i++) { }
+ gl_Position = a_position;
+}
+</script>
+<script id="fragmentShaderNonConstVarLoopCondition" type="text/something-not-javascript">
+void main()
+{
+ // Despite assigning a constant and not modifying it, nonConstVar is not semantically a constant expression
+ int nonConstVar = 10;
+ for (int i = 0; i < nonConstVar; i++) { }
+ gl_FragColor = vec4(1.0);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+var tests = [];
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderLiteralLoopCondition"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderLiteralLoopCondition"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Shaders with literals in the loop condition should compile and link.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderConstVarLoopCondition"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderConstVarLoopCondition"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Shaders with constant variables in the loop condition should compile and link.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderNonConstVarLoopCondition"),
+ vShaderSuccess: false,
+ fShaderSource: wtu.getScript("fragmentShaderLiteralLoopCondition"),
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "Vertex shader with non-const variable in the loop condition should fail.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderLiteralLoopCondition"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderNonConstVarLoopCondition"),
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Fragment shader with non-const variable in the loop condition should fail.",
+});
+
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html
new file mode 100644
index 0000000000..205d78cee4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-invariance.html
@@ -0,0 +1,332 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShaderVariant" type="text/something-not-javascript">
+varying vec4 v_varying;
+
+void main()
+{
+ gl_PointSize = 1.0;
+ gl_Position = v_varying;
+}
+</script>
+<script id="vertexShaderInvariant" type="text/something-not-javascript">
+invariant varying vec4 v_varying;
+
+void main()
+{
+ gl_Position = v_varying;
+}
+</script>
+<script id="vertexShaderSeparateInvariant" type="text/something-not-javascript">
+varying vec4 v_varying;
+invariant v_varying;
+
+void main()
+{
+ gl_Position = v_varying;
+}
+</script>
+<script id="vertexShaderSeparateInvariantWrongOrder" type="text/something-not-javascript">
+invariant v_varying;
+varying vec4 v_varying;
+
+void main()
+{
+ gl_Position = v_varying;
+}
+</script>
+<script id="vertexShaderGlobalInvariant" type="text/something-not-javascript">
+#pragma STDGL invariant(all)
+varying vec4 v_varying;
+
+void main()
+{
+ gl_Position = v_varying;
+}
+</script>
+<script id="vertexShaderInvariantGlPosition" type="text/something-not-javascript">
+invariant gl_Position;
+
+void main()
+{
+ gl_Position = vec4(0, 0, 0, 0);
+}
+</script>
+<script id="vertexShaderInvariantGlPointSize" type="text/something-not-javascript">
+invariant gl_PointSize;
+
+void main()
+{
+ gl_PointSize = 1.0;
+ gl_Position = vec4(0, 0, 0, 0);
+}
+</script>
+<script id="fragmentShaderVariant" type="text/something-not-javascript">
+precision mediump float;
+
+varying vec4 v_varying;
+
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="fragmentShaderInvariant" type="text/something-not-javascript">
+precision mediump float;
+
+invariant varying vec4 v_varying;
+
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="fragmentShaderSeparateInvariant" type="text/something-not-javascript">
+precision mediump float;
+
+varying vec4 v_varying;
+invariant v_varying;
+
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="fragmentShaderSeparateInvariantWrongOrder" type="text/something-not-javascript">
+precision mediump float;
+
+invariant v_varying;
+varying vec4 v_varying;
+
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="fragmentShaderGlobalInvariant" type="text/something-not-javascript">
+#pragma STDGL invariant(all)
+precision mediump float;
+
+varying vec4 v_varying;
+
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script id="fragmentShaderInvariantGlFragCoord" type="text/something-not-javascript">
+invariant gl_FragCoord;
+
+void main()
+{
+ gl_FragColor = gl_FragCoord;
+}
+</script>
+<script id="fragmentShaderVariantGlFragCoord" type="text/something-not-javascript">
+void main()
+{
+ gl_FragColor = gl_FragCoord;
+}
+</script>
+<script id="fragmentShaderInvariantGlPointCoord" type="text/something-not-javascript">
+invariant gl_PointCoord;
+
+void main()
+{
+ gl_FragColor = vec4(gl_PointCoord, 0.0, 0.0);
+}
+</script>
+<script id="fragmentShaderVariantGlPointCoord" type="text/something-not-javascript">
+void main()
+{
+ gl_FragColor = vec4(gl_PointCoord, 0.0, 0.0);
+}
+</script>
+<script id="fragmentShaderInvariantGlFrontFacing" type="text/something-not-javascript">
+invariant gl_FrontFacing;
+
+void main()
+{
+ gl_FragColor = gl_FrontFacing ? vec4(1, 1, 1, 1) : vec4(0, 0, 0, 1);
+}
+</script>
+<script id="fragmentShaderVariantGlFrontFacing" type="text/something-not-javascript">
+void main()
+{
+ gl_FragColor = gl_FrontFacing ? vec4(1, 1, 1, 1) : vec4(0, 0, 0, 1);
+}
+</script>
+<script>
+// GLSL 1.0.17 4.3.5
+"use strict";
+// See GLSL ES spec 1.0.17 section 4.6.4 "Invariance and linkage".
+var cases = [
+ {
+ vShaderId: "vertexShaderVariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariant",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with variant varying and fragment shader with invariant varying must fail",
+ },
+ {
+ vShaderId: "vertexShaderInvariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderVariant",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with invariant varying and fragment shader with variant varying must fail",
+ },
+ {
+ vShaderId: "vertexShaderGlobalInvariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderVariant",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with invariant (global setting) varying and fragment shader with variant varying must fail",
+ },
+ {
+ vShaderId: "vertexShaderGlobalInvariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariant",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with invariant (global setting) varying and fragment shader with invariant varying must succeed",
+ },
+ {
+ vShaderId: "vertexShaderSeparateInvariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariant",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with invariant (separately set) varying and fragment shader with invariant varying must succeed",
+ },
+ {
+ vShaderId: "vertexShaderInvariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderSeparateInvariant",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with invariant varying and fragment shader with invariant (separately set) varying must succeed",
+ },
+ {
+ vShaderId: "vertexShaderSeparateInvariantWrongOrder",
+ vShaderSuccess: false,
+ fShaderId: "fragmentShaderInvariant",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with invariant (separately set in wrong order) varying must fail",
+ },
+ {
+ vShaderId: "vertexShaderInvariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderSeparateInvariantWrongOrder",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "fragment shader with invariant (separately set in wrong order) varying must fail",
+ },
+ {
+ vShaderId: "vertexShaderInvariantGlPosition",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariantGlFragCoord",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with invariant gl_Position and fragment shader with invariant gl_FragCoord must succeed",
+ },
+ {
+ vShaderId: "vertexShaderVariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariantGlFragCoord",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with variant gl_Position and fragment shader with invariant gl_FragCoord must fail",
+ },
+ {
+ vShaderId: "vertexShaderInvariantGlPosition",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderVariantGlFragCoord",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with invariant gl_Position and fragment shader with variant gl_FragCoord must succeed",
+ },
+ {
+ vShaderId: "vertexShaderInvariantGlPointSize",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariantGlPointCoord",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with invariant gl_PointSize and fragment shader with invariant gl_PointCoord must succeed",
+ },
+ {
+ vShaderId: "vertexShaderVariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariantGlPointCoord",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with variant gl_PointSize and fragment shader with invariant gl_PointCoord must fail",
+ },
+ {
+ vShaderId: "vertexShaderInvariantGlPointSize",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderVariantGlPointCoord",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with invariant gl_PointSize and fragment shader with variant gl_PointCoord must succeed",
+ },
+ {
+ vShaderId: "vertexShaderVariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderVariantGlFrontFacing",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "fragment shader with variant gl_FrontFacing must succeed compilation",
+ },
+ {
+ vShaderId: "vertexShaderVariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderInvariantGlFrontFacing",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "fragment shader with invariant gl_FrontFacing must fail compilation",
+ },
+ {
+ vShaderId: "vertexShaderVariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderGlobalInvariant",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with variant varying and fragment shader with invariant (global setting) varying must succeed",
+ },
+ {
+ vShaderId: "vertexShaderInvariant",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderGlobalInvariant",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with invariant varying and fragment shader with invariant (global setting) varying must fail",
+ }
+];
+
+GLSLConformanceTester.runTests(cases);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html
new file mode 100644
index 0000000000..73a032278f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-uniforms.html
@@ -0,0 +1,87 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// Shaders with mis-matching uniform types should fail
+// GLSL 1.017 4.3.4
+uniform $(type) u_uniform;
+
+void main()
+{
+ gl_Position = $(code);
+}
+</script>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shaders with mis-matching uniform types should fail
+// GLSL 1.017 4.3.4
+precision mediump float;
+
+uniform $(type) u_uniform;
+
+void main()
+{
+ gl_FragColor = $(code);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var uniformTypes = [
+ { type: "bool", code: "vec4(u_uniform, 0, 0, 0)", },
+ { type: "float", code: "vec4(u_uniform, 0, 0, 0)", },
+ { type: "int", code: "vec4(u_uniform, 0, 0, 0)", },
+ { type: "vec2", code: "vec4(u_uniform, 0, 0)", },
+ { type: "ivec2", code: "vec4(u_uniform, 0, 0)", },
+ { type: "bvec2", code: "vec4(u_uniform, 0, 0)", },
+ { type: "vec3", code: "vec4(u_uniform, 0)", },
+ { type: "ivec3", code: "vec4(u_uniform, 0)", },
+ { type: "bvec3", code: "vec4(u_uniform, 0)", },
+ { type: "vec4", code: "vec4(u_uniform)", },
+ { type: "ivec4", code: "vec4(u_uniform)", },
+ { type: "bvec4", code: "vec4(u_uniform)", },
+ { type: "mat2", code: "vec4(u_uniform[0][0], 0, 0, 0)", },
+ { type: "mat3", code: "vec4(u_uniform[0][0], 0, 0, 0)", },
+ { type: "mat4", code: "vec4(u_uniform[0][0], 0, 0, 0)", },
+];
+var vSource = wtu.getScript("vertexShader");
+var fSource = wtu.getScript("fragmentShader");
+var tests = [];
+for (var ii = 0; ii < uniformTypes.length; ++ii) {
+ var u1 = uniformTypes[ii];
+ var vs = wtu.replaceParams(vSource, u1);
+ for (var jj = ii + 1; jj < uniformTypes.length; ++jj) {
+ var u2 = uniformTypes[jj];
+ var fs = wtu.replaceParams(fSource, u2);
+ tests.push({
+ vShaderSource: vs,
+ vShaderSuccess: true,
+ fShaderSource: fs,
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with uniform " + u1.type + " and fragment shader with uniform " + u2.type + " with the same name should fail to link",
+ });
+ }
+}
+
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html
new file mode 100644
index 0000000000..342bbc0199
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-mis-matching-varyings.html
@@ -0,0 +1,80 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// Shaders with mis-matching varying types should fail
+// GLSL 1.0.17 4.3.5
+attribute $(type) a_attribute;
+varying $(type) v_varying;
+
+void main()
+{
+ v_varying = a_attribute;
+ gl_Position = vec4(0,0,0,0);
+}
+</script>
+<script id="fragmentShader" type="text/something-not-javascript">
+// Shaders with mis-matching varyings types should fail
+// GLSL 1.0.17 4.3.5
+precision mediump float;
+
+varying $(type) v_varying;
+
+void main()
+{
+ gl_FragColor = $(code);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var varyingTypes = [
+ { type: "float", code: "vec4(v_varying, 0, 0, 0)", },
+ { type: "vec2", code: "vec4(v_varying, 0, 0)", },
+ { type: "vec3", code: "vec4(v_varying, 0)", },
+ { type: "vec4", code: "vec4(v_varying)", },
+ { type: "mat2", code: "vec4(v_varying[0][0], 0, 0, 0)", },
+ { type: "mat3", code: "vec4(v_varying[0][0], 0, 0, 0)", },
+ { type: "mat4", code: "vec4(v_varying[0][0], 0, 0, 0)", },
+];
+var vSource = wtu.getScript("vertexShader");
+var fSource = wtu.getScript("fragmentShader");
+var tests = [];
+for (var ii = 0; ii < varyingTypes.length; ++ii) {
+ var u1 = varyingTypes[ii];
+ var vs = wtu.replaceParams(vSource, u1);
+ for (var jj = ii + 1; jj < varyingTypes.length; ++jj) {
+ var u2 = varyingTypes[jj];
+ var fs = wtu.replaceParams(fSource, u2);
+ tests.push({
+ vShaderSource: vs,
+ vShaderSuccess: true,
+ fShaderSource: fs,
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with varying " + u1.type + " and fragment shader with varying " + u2.type + " with the same name should fail to link",
+ });
+ }
+}
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html
new file mode 100644
index 0000000000..4dab279f60
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-missing-varyings.html
@@ -0,0 +1,74 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// GLSL 1.0.17 4.3.5
+void main()
+{
+ gl_Position = vec4(0,0,0,0);
+}
+</script>
+<script id="fragmentShader" type="text/something-not-javascript">
+// GLSL 1.0.17 4.3.5
+precision mediump float;
+
+varying $(type) v_varying;
+
+void main()
+{
+ gl_FragColor = $(code);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var varyingTypes = [
+ { type: "float", code: "vec4(v_varying, 0, 0, 0)", },
+ { type: "vec2", code: "vec4(v_varying, 0, 0)", },
+ { type: "vec3", code: "vec4(v_varying, 0)", },
+ { type: "vec4", code: "vec4(v_varying)", },
+ { type: "mat2", code: "vec4(v_varying[0][0], 0, 0, 0)", },
+ { type: "mat3", code: "vec4(v_varying[0][0], 0, 0, 0)", },
+ { type: "mat4", code: "vec4(v_varying[0][0], 0, 0, 0)", },
+];
+var vSource = wtu.getScript("vertexShader");
+var fSource = wtu.getScript("fragmentShader");
+var tests = [];
+for (var ii = 0; ii < varyingTypes.length; ++ii) {
+ var u1 = varyingTypes[ii];
+ var vs = wtu.replaceParams(vSource, u1);
+ for (var jj = ii + 1; jj < varyingTypes.length; ++jj) {
+ var u2 = varyingTypes[jj];
+ var fs = wtu.replaceParams(fSource, u2);
+ tests.push({
+ vShaderSource: vs,
+ vShaderSuccess: true,
+ fShaderSource: fs,
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader no varyings and fragment shader with varying " + u2.type + " should fail to link",
+ });
+ }
+}
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html
new file mode 100644
index 0000000000..e4c9af8b8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-name-conflicts.html
@@ -0,0 +1,88 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader should succeed
+precision mediump float;
+uniform vec4 foo;
+void main()
+{
+ gl_FragColor = foo;
+}
+</script>
+<script id="vertexShader" type="text/something-not-javascript">
+// vertex shader should succeed
+attribute vec4 foo;
+void main()
+{
+ gl_Position = foo;
+}
+</script>
+<script>
+"use strict";
+
+/*
+This test previously concluded that an attribute in a vertex shader
+would conflict across shaders with a uniform of the same name in the
+fragment shader, based on the following sections of the GLSL ES 1.0.17
+specification:
+
+---
+Section 4.2.6
+
+...
+
+With the exception of uniform declarations, vertex and fragment shaders
+have separate name spaces. Functions and global variables declared in a
+vertex shader cannot be referenced by a fragment shader and vice versa.
+Uniforms have a single name space. Uniforms declared with the same name
+must have matching types and precisions.
+
+Section 4.3.3
+
+Attribute variables are required to have global scope
+
+Section 4.3.4
+
+The uniform qualifier is used to declare global variables
+---
+
+GLSL ES 3.00 later confirmed that pipeline stages have distinct
+namespaces. The OpenGL ES working group confirmed in discussions
+https://github.com/KhronosGroup/WebGL/issues/3201 that this was the
+intended behavior for GLSL ES 1.00.
+
+For this reason, this test asserts that such usage does not generate a
+conflict.
+*/
+
+GLSLConformanceTester.runTests([
+ { vShaderId: 'vertexShader',
+ vShaderSuccess: true,
+ fShaderId: 'fragmentShader',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'using the same name for a vertex shader attribute and fragment shader uniform should succeed'
+ },
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html
new file mode 100644
index 0000000000..8713bd0cbe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-uniform-structs.html
@@ -0,0 +1,289 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShaderStructSequence" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec4 pos;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_Position = uni.pos;
+}
+</script>
+<script id="fragmentShaderStructSequence" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec4 color;
+ vec4 pos;
+};
+
+uniform info uni;
+void main()
+{
+ gl_FragColor = uni.color;
+}
+</script>
+<script id="vertexShaderStructName" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec4 pos;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_Position = uni.pos;
+}
+</script>
+<script id="fragmentShaderStructNameFailure" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info1 {
+ vec4 pos;
+ vec4 color;
+};
+
+uniform info1 uni;
+void main()
+{
+ gl_FragColor = uni.color;
+}
+</script>
+<script id="fragmentShaderStructNameSuccess" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+
+// Add a struct before info to make sure the struct info here is assigned
+// a different internal unique ID from the struct info in vertex shader.
+struct extra {
+ vec4 p;
+};
+
+struct info {
+ vec4 pos;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ extra my;
+ my.p = uni.color;
+ gl_FragColor = my.p;
+}
+</script>
+<script id="vertexShaderStructFieldName" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec4 pos;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_Position = uni.pos;
+}
+</script>
+<script id="fragmentShaderStructFieldName" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec4 pos1;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_FragColor = uni.color;
+}
+</script>
+<script id="vertexShaderStructFieldType" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec4 pos;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_Position = uni.pos;
+}
+</script>
+<script id="fragmentShaderStructFieldType" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec3 pos;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_FragColor = uni.color;
+}
+</script>
+<script id="vertexShaderStructFieldPrecision" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+struct info {
+ mediump vec4 pos;
+ highp vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_Position = uni.pos;
+}
+</script>
+<script id="fragmentShaderStructFieldPrecision" type="text/something-not-javascript">
+// Structures must have the same name, sequence of type names, and
+// type definitions, and field names to be considered the same type.
+// GLSL 1.017 4.2.4
+precision mediump float;
+struct info {
+ vec4 pos;
+ vec4 color;
+};
+
+uniform info uni;
+void main()
+{
+ gl_FragColor = uni.color;
+}
+</script>
+<script id="vertexShaderUnnamedStruct" type="text/something-not-javascript">
+// ANGLE regression on Windows, crbug.com/401296
+uniform struct {
+ float f;
+ vec4 v;
+} u_struct;
+
+void main()
+{
+ gl_Position = u_struct.f * u_struct.v;
+}
+</script>
+<script id="fragmentShaderSimple" type="text/something-not-javascript">
+void main()
+{
+ gl_FragColor = vec4(1.0);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+var tests = [];
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderStructName"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderStructNameSuccess"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Structures with the same defination must be considered the same type.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderStructName"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderStructNameFailure"),
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "Structures must have the same name to be considered the same type.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderStructSequence"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderStructSequence"),
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "Structures must have the same sequence of type names to be considered the same type.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderStructFieldName"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderStructFieldName"),
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "Structures must have the same field names to be considered the same type.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderStructFieldType"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderStructFieldType"),
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "Structures must have the same type definitions to be considered the same type.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderStructFieldPrecision"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderStructFieldPrecision"),
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "Structures must have the same type definitions (including precision) to be considered the same type.",
+});
+tests.push({
+ vShaderSource: wtu.getScript("vertexShaderUnnamedStruct"),
+ vShaderSuccess: true,
+ fShaderSource: wtu.getScript("fragmentShaderSimple"),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Shaders with uniforms of unnamed struct type should compile and link successfully.",
+});
+
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html
new file mode 100644
index 0000000000..87baaa2bdc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shaders-with-varyings.html
@@ -0,0 +1,103 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShaderNoVarying" type="text/something-not-javascript">
+void main()
+{
+ gl_Position = vec4(0,0,0,0);
+}
+</script>
+<script id="vertexShaderUnusedVarying" type="text/something-not-javascript">
+varying vec4 v_varying;
+
+void main()
+{
+ gl_Position = vec4(0,0,0,0);
+}
+</script>
+<script id="vertexShaderUsedVarying" type="text/something-not-javascript">
+varying vec4 v_varying;
+
+void main()
+{
+ gl_Position = v_varying;
+}
+</script>
+<script id="fragmentShaderUnusedVarying" type="text/something-not-javascript">
+precision mediump float;
+
+varying vec4 v_varying;
+
+void main()
+{
+ gl_FragColor = vec4(0,0,0,0);
+}
+</script>
+<script id="fragmentShaderUsedVarying" type="text/something-not-javascript">
+precision mediump float;
+
+varying vec4 v_varying;
+
+void main()
+{
+ gl_FragColor = v_varying;
+}
+</script>
+<script>
+// GLSL 1.0.17 4.3.5
+"use strict";
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "vertexShaderNoVarying",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderUnusedVarying",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with no varying and fragment shader with unused varying must succeed",
+ },
+ {
+ vShaderId: "vertexShaderNoVarying",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderUsedVarying",
+ fShaderSuccess: true,
+ linkSuccess: false,
+ passMsg: "vertex shader with no varying and fragment shader with used varying must fail",
+ },
+ {
+ vShaderId: "vertexShaderUnusedVarying",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderUnusedVarying",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with unused varying and fragment shader with unused varying must succeed",
+ },
+ {
+ vShaderId: "vertexShaderUnusedVarying",
+ vShaderSuccess: true,
+ fShaderId: "fragmentShaderUsedVarying",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "vertex shader with unused varying and fragment shader with used varying must succeed",
+ },
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html
new file mode 100644
index 0000000000..77786bb385
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/shared.html
@@ -0,0 +1,151 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="sharedVertexShader" type="text/something-not-javascript">
+// shared vertex shader should succeed.
+uniform mat4 viewProjection;
+uniform vec3 worldPosition;
+uniform vec3 nextPosition;
+uniform float fishLength;
+uniform float fishWaveLength;
+uniform float fishBendAmount;
+attribute vec4 position;
+attribute vec2 texCoord;
+varying vec4 v_position;
+varying vec2 v_texCoord;
+varying vec3 v_surfaceToLight;
+void main() {
+ vec3 vz = normalize(worldPosition - nextPosition);
+ vec3 vx = normalize(cross(vec3(0,1,0), vz));
+ vec3 vy = cross(vz, vx);
+ mat4 orientMat = mat4(
+ vec4(vx, 0),
+ vec4(vy, 0),
+ vec4(vz, 0),
+ vec4(worldPosition, 1));
+ mat4 world = orientMat;
+ mat4 worldViewProjection = viewProjection * world;
+ mat4 worldInverseTranspose = world;
+
+ v_texCoord = texCoord;
+ // NOTE:If you change this you need to change the laser code to match!
+ float mult = position.z > 0.0 ?
+ (position.z / fishLength) :
+ (-position.z / fishLength * 2.0);
+ float s = sin(mult * fishWaveLength);
+ float a = sign(s);
+ float offset = pow(mult, 2.0) * s * fishBendAmount;
+ v_position = (
+ worldViewProjection *
+ (position +
+ vec4(offset, 0, 0, 0)));
+ v_surfaceToLight = (world * position).xyz;
+ gl_Position = v_position;
+}
+</script>
+<script id="fragmentShaderA" type="text/something-not-javascript">
+// shared fragment shader should succeed.
+precision mediump float;
+uniform vec4 lightColor;
+varying vec4 v_position;
+varying vec2 v_texCoord;
+varying vec3 v_surfaceToLight;
+
+uniform vec4 ambient;
+uniform sampler2D diffuse;
+uniform vec4 specular;
+uniform float shininess;
+uniform float specularFactor;
+// #fogUniforms
+
+vec4 lit(float l ,float h, float m) {
+ return vec4(1.0,
+ max(l, 0.0),
+ (l > 0.0) ? pow(max(0.0, h), m) : 0.0,
+ 1.0);
+}
+void main() {
+ vec4 diffuseColor = texture2D(diffuse, v_texCoord);
+ vec4 normalSpec = vec4(0,0,0,0); // #noNormalMap
+ vec3 surfaceToLight = normalize(v_surfaceToLight);
+ vec3 halfVector = normalize(surfaceToLight);
+ vec4 litR = lit(1.0, 1.0, shininess);
+ vec4 outColor = vec4(
+ (lightColor * (diffuseColor * litR.y + diffuseColor * ambient +
+ specular * litR.z * specularFactor * normalSpec.a)).rgb,
+ diffuseColor.a);
+ // #fogCode
+ gl_FragColor = outColor;
+}
+</script>
+<script id="fragmentShaderB" type="text/something-not-javascript">
+// shared fragment shader should succeed.
+precision mediump float;
+varying vec4 v_position;
+varying vec2 v_texCoord;
+varying vec3 v_surfaceToLight;
+
+// #fogUniforms
+
+vec4 lit(float l ,float h, float m) {
+ return vec4(1.0,
+ max(l, 0.0),
+ (l > 0.0) ? pow(max(0.0, h), m) : 0.0,
+ 1.0);
+}
+void main() {
+ vec4 normalSpec = vec4(0,0,0,0); // #noNormalMap
+ vec4 reflection = vec4(0,0,0,0); // #noReflection
+ vec3 surfaceToLight = normalize(v_surfaceToLight);
+ vec4 skyColor = vec4(0.5,0.5,1,1); // #noReflection
+
+ vec3 halfVector = normalize(surfaceToLight);
+ vec4 litR = lit(1.0, 1.0, 10.0);
+ vec4 outColor = vec4(mix(
+ skyColor,
+ vec4(1,2,3,4) * (litR.y + litR.z * normalSpec.a),
+ 1.0 - reflection.r).rgb,
+ 1.0);
+ // #fogCode
+ gl_FragColor = outColor;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTests([
+ { vShaderSource: document.getElementById("sharedVertexShader").text,
+ vShaderSuccess: true,
+ fShaderSource: document.getElementById("fragmentShaderA").text,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'shared fragment shader should succeed',
+ },
+ { vShaderSource: document.getElementById("sharedVertexShader").text,
+ vShaderSuccess: true,
+ fShaderSource: document.getElementById("fragmentShaderB").text,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'shared fragment shader should succeed',
+ }
+]);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-inout-parameter.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-inout-parameter.html
new file mode 100644
index 0000000000..e041661477
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-inout-parameter.html
@@ -0,0 +1,117 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL Structure as Inout Parameter Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+
+<script id="simple-vs" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main(void) {
+ gl_Position = a_position;
+}
+</script>
+<script id="struct-inout-parameter-fs" type="x-shader/x-fragment">
+struct ColorData {
+ vec3 red;
+ vec3 blue;
+};
+
+void modify(inout ColorData colorData) {
+ colorData.red += vec3(0.5, 0.0, 0.0);
+ colorData.blue += vec3(0.0, 0.0, 0.5);
+}
+
+void main() {
+ ColorData colorData;
+ colorData.red = vec3(0.5, 0.0, 0.0);
+ colorData.blue = vec3(0.0, 0.0, 0.5);
+
+ vec3 red = vec3(1.0, 0.0, 0.0);
+ vec3 green = vec3(0.0, 1.0, 0.0);
+ vec3 blue = vec3(0.0, 0.0, 1.0);
+ vec3 finalColor;
+
+ modify(colorData);
+
+ if (colorData.red == red && colorData.blue == blue)
+ finalColor = green;
+ else
+ finalColor = red;
+
+ gl_FragColor = vec4(finalColor, 1.0);
+}
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Testing structs as inout parameter");
+
+debug('Regression test for <a href="http://crbug.com/851870">http://crbug.com/851870</a> / <a href="https://github.com/mrdoob/three.js/issues/14137">https://github.com/mrdoob/three.js/issues/14137</a>');
+
+function prepend(floatPrecision) {
+ let source = document.getElementById('struct-inout-parameter-fs').text;
+ return 'precision ' + floatPrecision + ' float;\n' + source;
+}
+
+let tests = [
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderSource: prepend('lowp'),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "lowp struct used as inout parameter",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderSource: prepend('mediump'),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "mediump struct used as inout parameter",
+ },
+];
+
+let wtu = WebGLTestUtils;
+let gl = wtu.create3DContext();
+let precision = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);
+let highpSupported = (precision.rangeMin >= 62 && precision.rangeMax >= 62 && precision.precision >= 16);
+debug("highp is" + (highpSupported ? "" : " not") + " supported in fragment shaders");
+
+if (highpSupported) {
+ tests.push(
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderSource: prepend('highp'),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "highp struct used as inout parameter",
+ }
+ );
+}
+
+GLSLConformanceTester.runTests(tests);
+debug("");
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-out-parameter.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-out-parameter.html
new file mode 100644
index 0000000000..4190c691e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-as-out-parameter.html
@@ -0,0 +1,115 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL Structure as Out Parameter Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+
+<script id="simple-vs" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main(void) {
+ gl_Position = a_position;
+}
+</script>
+<script id="struct-out-parameter-fs" type="x-shader/x-fragment">
+struct ColorData {
+ vec3 red;
+ vec3 blue;
+};
+
+void modify(out ColorData colorData) {
+ colorData.red = vec3(1.0, 0.0, 0.0);
+ colorData.blue = vec3(0.0, 0.0, 1.0);
+}
+
+void main() {
+ ColorData colorData;
+
+ vec3 red = vec3(1.0, 0.0, 0.0);
+ vec3 green = vec3(0.0, 1.0, 0.0);
+ vec3 blue = vec3(0.0, 0.0, 1.0);
+ vec3 finalColor;
+
+ modify(colorData);
+
+ if (colorData.red == red && colorData.blue == blue)
+ finalColor = green;
+ else
+ finalColor = red;
+
+ gl_FragColor = vec4(finalColor, 1.0);
+}
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Testing structs as out parameter");
+
+debug('Regression test for <a href="http://crbug.com/851873">http://crbug.com/851873</a> / <a href="https://github.com/mrdoob/three.js/issues/14137">https://github.com/mrdoob/three.js/issues/14137</a>');
+
+function prepend(floatPrecision) {
+ let source = document.getElementById('struct-out-parameter-fs').text;
+ return 'precision ' + floatPrecision + ' float;\n' + source;
+}
+
+let tests = [
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderSource: prepend('lowp'),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "lowp struct used as out parameter",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderSource: prepend('mediump'),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "mediump struct used as out parameter",
+ },
+];
+
+let wtu = WebGLTestUtils;
+let gl = wtu.create3DContext();
+let precision = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);
+let highpSupported = (precision.rangeMin >= 62 && precision.rangeMax >= 62 && precision.precision >= 16);
+debug("highp is" + (highpSupported ? "" : " not") + " supported in fragment shaders");
+
+if (highpSupported) {
+ tests.push(
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderSource: prepend('highp'),
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "highp struct used as out parameter",
+ }
+ );
+}
+
+GLSLConformanceTester.runTests(tests);
+debug("");
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html
new file mode 100644
index 0000000000..9d1d77d068
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-assign.html
@@ -0,0 +1,214 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL Structure Assignment Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+
+<script id="simple-vs" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main(void) {
+ gl_Position = a_position;
+}
+</script>
+<script id="simple-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ float f;
+};
+
+my_struct a = my_struct(0.0);
+my_struct b = my_struct(1.0);
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ a = b;
+ if (a.f == 1.0) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="vec-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec3 v;
+};
+
+my_struct a = my_struct(vec3(0.0, 0.0, 0.0));
+my_struct b = my_struct(vec3(1.0, 2.0, 3.0));
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ a = b;
+ if (a.v.x == 1.0) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="nested-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct s1
+{
+ float f;
+};
+
+struct s2
+{
+ s1 s;
+};
+
+s2 a = s2(s1(0.0));
+s2 b = s2(s1(1.0));
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ a = b;
+ if (a.s.f == 1.0) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="nested-vec-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct s1
+{
+ vec3 v;
+};
+
+struct s2
+{
+ s1 s;
+};
+
+s2 a = s2(s1(vec3(0.0, 0.0, 0.0)));
+s2 b = s2(s1(vec3(1.0, 2.0, 3.0)));
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ a = b;
+ if (a.s.v.x == 1.0) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="array-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct my_struct
+{
+ float f[3];
+};
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ my_struct a;
+ my_struct b;
+ for (int i = 0; i < 3; ++i) {
+ a.f[i] = 0.0;
+ b.f[i] = float(i);
+ }
+
+ a = b;
+ if (a.f[1] == 1.0 && a.f[2] == 2.0) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="sampler-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct my_struct
+{
+ sampler2D s;
+};
+
+uniform my_struct a;
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ my_struct b;
+ b = a;
+}
+</script>
+</head>
+<body>
+<canvas id="canvas" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Testing struct assignment");
+
+var wtu = WebGLTestUtils;
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "simple-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Simple struct with one float",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "vec-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Simple struct with a vector",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "nested-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Nested struct with a float",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "nested-vec-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Nested struct with a vector",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "array-struct-fs",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Assigning a struct containing an array should not compile",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "sampler-struct-fs",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Assigning a struct containing a sampler should not compile",
+ }
+]);
+debug("");
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html
new file mode 100644
index 0000000000..50ac40e5c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-equals.html
@@ -0,0 +1,217 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>GLSL Structure Equals Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+
+<script id="simple-vs" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main(void) {
+ gl_Position = a_position;
+}
+</script>
+<script id="simple-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ float f;
+};
+
+my_struct a = my_struct(1.0);
+my_struct b = my_struct(1.0);
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if (a == b) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="vec-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+struct my_struct {
+ vec3 v;
+};
+
+my_struct a = my_struct(vec3(1.0, 2.0, 3.0));
+my_struct b = my_struct(vec3(1.0, 2.0, 3.0));
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if (a == b) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="nested-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct s1
+{
+ float f;
+};
+
+struct s2
+{
+ s1 s;
+};
+
+s2 a = s2(s1(1.0));
+s2 b = s2(s1(1.0));
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if (a == b) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="nested-vec-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct s1
+{
+ vec3 v;
+};
+
+struct s2
+{
+ s1 s;
+};
+
+s2 a = s2(s1(vec3(1.0, 2.0, 3.0)));
+s2 b = s2(s1(vec3(1.0, 2.0, 3.0)));
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if (a == b) {
+ gl_FragColor.y = 1.0;
+ }
+}
+</script>
+<script id="array-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct my_struct
+{
+ float f[3];
+};
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+ my_struct a;
+ my_struct b;
+ for (int i = 0; i < 3; ++i) {
+ a.f[i] = 0.0;
+ b.f[i] = 1.0;
+ }
+
+ if (a == b) {
+ gl_FragColor.x = 1.0;
+ }
+}
+</script>
+<script id="sampler-struct-fs" type="x-shader/x-fragment">
+precision mediump float;
+
+struct my_struct
+{
+ sampler2D s;
+};
+
+uniform my_struct a;
+uniform my_struct b;
+
+void main(void) {
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if (a == b) {
+ gl_FragColor.x = 1.0;
+ }
+}
+</script>
+</head>
+<body>
+<canvas id="canvas" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Testing struct equals");
+
+var wtu = WebGLTestUtils;
+GLSLConformanceTester.runTests([
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "simple-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Simple struct with one float",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "vec-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Simple struct with a vector",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "nested-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Nested struct with a float",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "nested-vec-struct-fs",
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true,
+ passMsg: "Nested struct with a vector",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "array-struct-fs",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Comparing a struct containing an array should not compile",
+ },
+ {
+ vShaderId: "simple-vs",
+ vShaderSuccess: true,
+ fShaderId: "sampler-struct-fs",
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Comparing a struct containing a sampler should not compile",
+ }
+]);
+debug("");
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html
new file mode 100644
index 0000000000..108cee9d0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-mixed-array-declarators.html
@@ -0,0 +1,71 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<title></title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+precision mediump float;
+void main() {
+ struct S {
+ $(type) field;
+ };
+ S s1[2], s2;
+ $(var).field = $(initializer);
+ gl_FragColor = $(asVec4);
+}
+</script>
+<script>
+"use strict";
+description("Verifies that mixed (array vs. not array) struct declarators work correctly.");
+var tests = [];
+var wtu = WebGLTestUtils;
+var typeInfos = [
+ { type: 'float', initializer: '1.0', asVec4: 'vec4(0.0,$(var).field,0.0,1.0)' },
+ { type: 'vec2', initializer: 'vec2(0.0, 1.0)', asVec4: 'vec4($(var).field,0.0,1.0)' },
+ { type: 'vec3', initializer: 'vec3(0.0, 1.0, 0.0)', asVec4: 'vec4($(var).field,1.0)' },
+ { type: 'vec4', initializer: 'vec4(0.0, 1.0, 0.0, 1.0)', asVec4: '$(var).field' },
+ { type: 'int', initializer: '1', asVec4: 'vec4(0.0,$(var).field,0.0,1.0)' },
+ { type: 'ivec2', initializer: 'ivec2(0, 1)', asVec4: 'vec4($(var).field,0.0,1.0)' },
+ { type: 'ivec3', initializer: 'ivec3(0, 1, 0)', asVec4: 'vec4($(var).field,1.0)' },
+ { type: 'ivec4', initializer: 'ivec4(0, 1, 0, 1)', asVec4: 'vec4($(var).field)' },
+ { type: 'bool', initializer: 'true', asVec4: 'vec4(0.0,$(var).field,0.0,1.0)' },
+ { type: 'bvec2', initializer: 'bvec2(false, true)', asVec4: 'vec4($(var).field,0.0,1.0)' },
+ { type: 'bvec3', initializer: 'bvec3(false, true, false)', asVec4: 'vec4($(var).field,1.0)' },
+ { type: 'bvec4', initializer: 'bvec4(false,true,false,true)',asVec4: 'vec4($(var).field)' },
+];
+['s1[0]', 's1[1]', 's2'].forEach(function(varName) {
+ typeInfos.forEach(function (typeInfo) {
+ var replaceParams = {
+ type: typeInfo.type,
+ initializer: typeInfo.initializer,
+ var: varName,
+ asVec4: wtu.replaceParams(typeInfo.asVec4, {var: varName})
+ };
+ tests.push({
+ fShaderSource: wtu.replaceParams(wtu.getScript('fragmentShader'), replaceParams),
+ passMsg: typeInfo.type,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render:true
+ });
+ });
+});
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html
new file mode 100644
index 0000000000..772e47d70d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-exceeds-maximum.html
@@ -0,0 +1,55 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// shader with too-deep struct nesting should fail per WebGL spec
+struct nesting5 {
+ vec4 vecfield;
+};
+
+struct nesting4 {
+ nesting5 field5;
+};
+
+struct nesting3 {
+ nesting4 field4;
+};
+
+struct nesting2 {
+ nesting3 field3;
+};
+
+struct nesting1 {
+ nesting2 field2;
+};
+
+uniform nesting1 uniform1;
+void main()
+{
+ gl_Position = uniform1.field2.field3.field4.field5.vecfield;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html
new file mode 100644
index 0000000000..0762628141
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-of-variable-names.html
@@ -0,0 +1,74 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<title></title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+precision mediump float;
+struct S { $(outer_type) u; };
+void main() {
+ S S; // This is legal, 'S' as a typename is defined in another scope.
+ {
+ struct S { $(inner_type) a; }; // This is legal as well, 'S' is now defined as a variable name in an ancestor scope
+ S newvar;
+ newvar.a = $(initializer);
+ gl_FragColor = $(fragColor);
+ }
+}
+</script>
+<script>
+"use strict";
+description("This test verifies that defining a typename in a new scope when the typename is the name of a variable that hides a typename declaration succeeds for all combinations of GLSL types.");
+var tests = [];
+var wtu = WebGLTestUtils;
+var typeInfo = [
+ { Type: 'float', initializer: '1.0', fragColor: 'vec4(0.0, newvar.a, 0.0, 1.0)' },
+ { Type: 'vec2', initializer: 'vec2(0.0, 1.0)', fragColor: 'vec4(newvar.a, 0.0, 1.0)' },
+ { Type: 'vec3', initializer: 'vec3(0.0, 1.0, 0.0)', fragColor: 'vec4(newvar.a, 1.0)' },
+ { Type: 'vec4', initializer: 'vec4(0.0, 1.0, 0.0, 1.0)', fragColor: 'newvar.a' },
+ { Type: 'int', initializer: '1', fragColor: 'vec4(0.0, newvar.a, 0.0, 1.0)' },
+ { Type: 'ivec2', initializer: 'ivec2(0, 1)', fragColor: 'vec4(newvar.a, 0.0, 1.0)' },
+ { Type: 'ivec3', initializer: 'ivec3(0, 1, 0)', fragColor: 'vec4(newvar.a, 1.0)' },
+ { Type: 'ivec4', initializer: 'ivec4(0, 1, 0, 1)', fragColor: 'vec4(newvar.a)' },
+ { Type: 'bool', initializer: 'true', fragColor: 'vec4(0.0, newvar.a, 0.0, 1.0)' },
+ { Type: 'bvec2', initializer: 'bvec2(false, true)', fragColor: 'vec4(newvar.a, 0.0, 1.0)' },
+ { Type: 'bvec3', initializer: 'bvec3(false, true, false)', fragColor: 'vec4(newvar.a, 1.0)' },
+ { Type: 'bvec4', initializer: 'bvec4(false,true,false,true)',fragColor: 'vec4(newvar.a)' },
+];
+typeInfo.forEach(function (outerType) {
+ typeInfo.forEach(function (innerType) {
+ var replaceParams = {
+ outer_type: outerType.Type,
+ inner_type: innerType.Type,
+ // use the initializer and fragColor for the inner type. Its definition should override the variable name in the outerscope.
+ initializer: innerType.initializer,
+ fragColor: innerType.fragColor
+ };
+ tests.push({
+ fShaderSource: wtu.replaceParams(wtu.getScript('fragmentShader'), replaceParams),
+ passMsg: 'Outer struct type: ' + outerType.Type + ' inner struct type: ' + innerType.Type,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true
+ });
+ })
+})
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html
new file mode 100644
index 0000000000..1707e57007
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-nesting-under-maximum.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+// shader with struct nesting less than maximum in WebGL spec should succeed
+struct nesting4 {
+ vec4 vecfield;
+};
+
+struct nesting3 {
+ nesting4 field4;
+};
+
+struct nesting2 {
+ nesting3 field3;
+};
+
+struct nesting1 {
+ nesting2 field2;
+};
+
+uniform nesting1 uniform1;
+void main()
+{
+ gl_Position = uniform1.field2.field3.field4.vecfield;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html
new file mode 100644
index 0000000000..3c0c704a29
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-specifiers-in-uniforms.html
@@ -0,0 +1,65 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<title></title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+precision mediump float;
+uniform struct S { $(type) field;} s;
+void main() {
+ // All uniforms are required to be zero initialized. Add the color green
+ // to make the rendering test pass.
+ gl_FragColor = $(asVec4) + vec4(0.0, 1.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+description("Verifies that structure specifiers work with uniforms.");
+var tests = [];
+var wtu = WebGLTestUtils;
+var typeInfos = [
+ { type: 'float', asVec4: 'vec4(0.0,s.field,0.0,0.0)' },
+ { type: 'vec2', asVec4: 'vec4(s.field,0.0,0.0)' },
+ { type: 'vec3', asVec4: 'vec4(s.field,0.0)' },
+ { type: 'vec4', asVec4: 's.field' },
+ { type: 'int', asVec4: 'vec4(0.0,s.field,0.0,0.0)' },
+ { type: 'ivec2', asVec4: 'vec4(s.field,0.0,0.0)' },
+ { type: 'ivec3', asVec4: 'vec4(s.field,0.0)' },
+ { type: 'ivec4', asVec4: 'vec4(s.field)' },
+ { type: 'bool', asVec4: 'vec4(0.0,s.field,0.0,0.0)' },
+ { type: 'bvec2', asVec4: 'vec4(s.field,0.0,0.0)' },
+ { type: 'bvec3', asVec4: 'vec4(s.field,0.0)' },
+ { type: 'bvec4', asVec4: 'vec4(s.field)' },
+];
+typeInfos.forEach(function (typeInfo) {
+ var replaceParams = {
+ type: typeInfo.type,
+ asVec4: typeInfo.asVec4
+ };
+ tests.push({
+ fShaderSource: wtu.replaceParams(wtu.getScript('fragmentShader'), replaceParams),
+ passMsg: typeInfo.type,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render:true
+ });
+});
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html
new file mode 100644
index 0000000000..d14a860fd8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/struct-unary-operators.html
@@ -0,0 +1,70 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<title></title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+precision mediump float;
+struct S { $(type) t; };
+void main() {
+ S a;
+ a.t = $(initializer);
+ S b = $(operator)a; // Unary operators not allowed
+ gl_FragColor = $(fragColor);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies that unary operators +, ++, -, --, !, and ~ do not work on structures. Per the spec, field selectors, equality and assignment are the only operators allowed on structures.");
+var tests = [];
+var wtu = WebGLTestUtils;
+var operators = ['+', '++', '-', '--', '!', '~']
+var typeInfos = [
+ { type: 'float', initializer: '1.0', fragColor: 'vec4(0.0, b.t, 0.0, 1.0)' },
+ { type: 'vec2', initializer: 'vec2(0.0, 1.0)', fragColor: 'vec4(b.t, 0.0, 1.0)' },
+ { type: 'vec3', initializer: 'vec3(0.0, 1.0, 0.0)', fragColor: 'vec4(b.t, 1.0)' },
+ { type: 'vec4', initializer: 'vec4(0.0, 1.0, 0.0, 1.0)', fragColor: 'b.t' },
+ { type: 'int', initializer: '1', fragColor: 'vec4(0.0, b.t, 0.0, 1.0)' },
+ { type: 'ivec2', initializer: 'ivec2(0, 1)', fragColor: 'vec4(b.t, 0.0, 1.0)' },
+ { type: 'ivec3', initializer: 'ivec3(0, 1, 0)', fragColor: 'vec4(b.t, 1.0)' },
+ { type: 'ivec4', initializer: 'ivec4(0, 1, 0, 1)', fragColor: 'vec4(b.t)' },
+ { type: 'bool', initializer: 'true', fragColor: 'vec4(0.0, b.t, 0.0, 1.0)' },
+ { type: 'bvec2', initializer: 'bvec2(false, true)', fragColor: 'vec4(b.t, 0.0, 1.0)' },
+ { type: 'bvec3', initializer: 'bvec3(false, true, false)', fragColor: 'vec4(b.t, 1.0)' },
+ { type: 'bvec4', initializer: 'bvec4(false,true,false,true)',fragColor: 'vec4(b.t)' },
+];
+operators.forEach(function (operator) {
+ typeInfos.forEach(function (typeInfo) {
+ var replaceParams = {
+ initializer: typeInfo.initializer,
+ type: typeInfo.type,
+ fragColor: typeInfo.fragColor,
+ operator: operator,
+ };
+ tests.push({
+ fShaderSource: wtu.replaceParams(wtu.getScript('fragmentShader'), replaceParams),
+ passMsg: 'Unary operator ' + operator + ' cannot be used on a struct with a ' + typeInfo.type,
+ fShaderSuccess: false,
+ linkSuccess: false
+ });
+ });
+});
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html
new file mode 100644
index 0000000000..adeddc5e33
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operator-on-arrays.html
@@ -0,0 +1,64 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests - Ternary operator on arrays</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshader-array-ternary-operator" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ float a[3];
+ float b[3];
+ float c[3] = true ? a : b;
+}
+</script>
+<script id="fshader-struct-array-ternary-operator" type="x-shader/x-fragment">
+precision mediump float;
+struct MyStruct {
+ bool a[3];
+};
+
+void main()
+{
+ MyStruct b;
+ MyStruct c;
+ MyStruct d = true ? b : c;
+}
+</script>
+<script>
+"use strict";
+description("Checks ternary operators for structs and arrays.");
+
+GLSLConformanceTester.runTests([
+{ fShaderId: 'fshader-array-ternary-operator',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "Using ternary operators with arrays is not allowed",
+},
+{ fShaderId: 'fshader-struct-array-ternary-operator',
+ fShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: "By implication, using ternary operators with structs containing arrays is not allowed",
+},
+]);
+
+debug("");
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html
new file mode 100644
index 0000000000..a8fe592ad0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-global-initializers.html
@@ -0,0 +1,67 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<title>Ternary Operators in Global Initializers</title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+precision mediump float;
+const $(type) green = $(green);
+const $(type) black = $(black);
+$(type) var = (true) ? green : black;
+void main() {
+ gl_FragColor = $(asVec4);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies that ternary operators can be used in global initializers.");
+var tests = [];
+var wtu = WebGLTestUtils;
+var typeInfos = [
+ { type: 'float', green: '1.0', black: '0.0', asVec4: 'vec4(0.0,var,0.0,1.0)' },
+ { type: 'vec2', green: 'vec2(0.0,1.0)', black: 'vec2(0.0,0.0)', asVec4: 'vec4(var,0.0,1.0)' },
+ { type: 'vec3', green: 'vec3(0.0,1.0,0.0)', black: 'vec3(0.0,0.0,0.0)', asVec4: 'vec4(var,1.0)' },
+ { type: 'vec4', green: 'vec4(0.0,1.0,0.0,1.0)', black: 'vec4(0.0,0.0,0.0,0.0)', asVec4: 'var' },
+ { type: 'int', green: '1', black: '0', asVec4: 'vec4(0.0,var,0.0,1.0)' },
+ { type: 'ivec2', green: 'ivec2(0,1)', black: 'ivec2(0,0)', asVec4: 'vec4(var,0.0,1.0)' },
+ { type: 'ivec3', green: 'ivec3(0,1,0)', black: 'ivec3(0,0,0)', asVec4: 'vec4(var,1.0)' },
+ { type: 'ivec4', green: 'ivec4(0,1,0,1)', black: 'ivec4(0,0,0,0)', asVec4: 'vec4(var)' },
+ { type: 'bool', green: 'true', black: 'false', asVec4: 'vec4(0.0,var,0.0,1.0)' },
+ { type: 'bvec2', green: 'bvec2(false,true)', black: 'bvec2(false,false)', asVec4: 'vec4(var,0.0,1.0)' },
+ { type: 'bvec3', green: 'bvec3(false,true,false)', black: 'bvec3(false,false,false)', asVec4: 'vec4(var,1.0)' },
+ { type: 'bvec4', green: 'bvec4(false,true,false,true)',black: 'bvec4(false,false,false,false)', asVec4: 'vec4(var)' },
+];
+typeInfos.forEach(function (typeInfo) {
+ var replaceParams = {
+ type: typeInfo.type,
+ green: typeInfo.green,
+ black: typeInfo.black,
+ asVec4: typeInfo.asVec4,
+ };
+ tests.push({
+ fShaderSource: wtu.replaceParams(wtu.getScript('fragmentShader'), replaceParams),
+ passMsg: typeInfo.type,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ render: true
+ });
+});
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html
new file mode 100644
index 0000000000..cdbc59a5c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/ternary-operators-in-initializers.html
@@ -0,0 +1,124 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css" />
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+<title></title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="intFragShader" type="text/something-not-javascript">
+void main() {
+ int i = 2, j = (i > 1) ? 1 : 0;
+ gl_FragColor = vec4(0.0, j, 0.0, 1.0);
+}
+</script>
+<script id="ivec2FragShader" type="text/something-not-javascript">
+void main() {
+ ivec2 i = ivec2(2, 0), j = (i.x > 1) ? ivec2(0, 1) : ivec2(0, 0);
+ gl_FragColor = vec4(j, 0.0, 1.0);
+}
+</script>
+<script id="ivec3FragShader" type="text/something-not-javascript">
+void main() {
+ ivec3 i = ivec3(0, 2, 0), j = (i.y > 1) ? ivec3(0, 1, 0) : ivec3(0, 0, 0);
+ gl_FragColor = vec4(j, 1.0);
+}
+</script>
+<script id="ivec4FragShader" type="text/something-not-javascript">
+void main() {
+ ivec4 i = ivec4(0.0, 0.0, 2.0, 0.0), j = (i.z > 1) ? ivec4(0, 1, 0, 1) : ivec4(0, 0, 0, 1);
+ gl_FragColor = vec4(j);
+}
+</script>
+<script id="floatFragShader" type="text/something-not-javascript">
+void main() {
+ precision mediump float;
+ float i = 2.0, j = (i > 1.0) ? 1.0 : 0.0;
+ gl_FragColor = vec4(0.0, j, 0.0, 1.0);
+}
+</script>
+<script id="vec2FragShader" type="text/something-not-javascript">
+void main() {
+ precision mediump float;
+ vec2 i = vec2(2.0, 0.0), j = (i.x > 1.0) ? vec2(0.0, 1.0) : vec2(0.0, 0.0);
+ gl_FragColor = vec4(j, 0.0, 1.0);
+}
+</script>
+<script id="vec3FragShader" type="text/something-not-javascript">
+void main() {
+ precision mediump float;
+ vec3 i = vec3(0.0, 2.0, 0.0), j = (i.y > 1.0) ? vec3(0.0, 1.0, 0.0) : vec3(0.0, 0.0, 0.0);
+ gl_FragColor = vec4(j, 1.0);
+}
+</script>
+<script id="vec4FragShader" type="text/something-not-javascript">
+void main() {
+ precision mediump float;
+ vec4 i = vec4(0.0, 0.0, 2.0, 0.0), j = (i.z > 1.0) ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(0.0, 0.0, 0.0, 1.0);
+ gl_FragColor = j;
+}
+</script>
+<script id="boolFragShader" type="text/something-not-javascript">
+void main() {
+ bool i = true, j = i ? true : false;
+ gl_FragColor = vec4(0.0, j, 0.0, 1.0);
+}
+</script>
+<script id="bvec2FragShader" type="text/something-not-javascript">
+void main() {
+ bvec2 i = bvec2(true, false), j = i.x ? bvec2(false, true) : bvec2(false, false);
+ gl_FragColor = vec4(j, 0.0, 1.0);
+}
+</script>
+<script id="bvec3FragShader" type="text/something-not-javascript">
+void main() {
+ bvec3 i = bvec3(false, true, false), j = i.y ? bvec3(false, true, false) : bvec3(false, false, false);
+ gl_FragColor = vec4(j, 1.0);
+}
+</script>
+<script id="bvec4FragShader" type="text/something-not-javascript">
+void main() {
+ bvec4 i = bvec4(false, false, true, true), j = i.z ? bvec4(false, true, false, true) : bvec4(false, false, false, true);
+ gl_FragColor = vec4(j);
+}
+</script>
+<script>
+"use strict";
+description("This test verifies initializers with ternary operators correctly initialize all variables.");
+// Test fragment shaders are of the form
+// void main() {
+// {type} i = {initializer}, j = {ternary test using i that succeeds} ? : {green} : {black};
+// gl_FragColor = vec4(...); // Emit green so that test will pass
+// }
+// The fragment shader must compile and link with the default vertex shader. J must be able to use the values of I as well as have its own
+// values properly initialized.
+var tests = [
+ { fShaderId: 'intFragShader', passMsg: 'Ternary operator in integer initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'ivec2FragShader', passMsg: 'Ternary operator in ivec2 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'ivec3FragShader', passMsg: 'Ternary operator in ivec3 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'ivec4FragShader', passMsg: 'Ternary operator in ivec4 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'floatFragShader', passMsg: 'Ternary operator in float initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'vec2FragShader', passMsg: 'Ternary operator in vec2 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'vec3FragShader', passMsg: 'Ternary operator in vec3 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'vec4FragShader', passMsg: 'Ternary operator in vec4 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'boolFragShader', passMsg: 'Ternary operator in bool initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'bvec2FragShader', passMsg: 'Ternary operator in bvec2 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'bvec3FragShader', passMsg: 'Ternary operator in bvec3 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+ { fShaderId: 'bvec4FragShader', passMsg: 'Ternary operator in bvec4 initalization', fShaderSuccess: true, linkSuccess: true, render: true },
+];
+GLSLConformanceTester.runTests(tests);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html
new file mode 100644
index 0000000000..8aeaeb1937
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uniform-location-length-limits.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<title>WebGL uniform location length tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description">Verify limits on the lengths of uniform locations per WebGL spec, "Maximum Uniform and Attribute Location Lengths".</div>
+<div id="console"></div>
+<script id="goodVertexShader" type="x-shader/x-vertex">
+// A vertex shader where the needed uniform location is exactly 256 characters.
+struct Nesting2 {
+ vec4 identifier62CharactersLong_01234567890123456789012345678901234;
+};
+
+struct Nesting1 {
+ Nesting2 identifier64CharactersLong_0123456789012345678901234567890123456;
+};
+
+uniform Nesting1 identifier128CharactersLong_0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789;
+
+void main() {
+ gl_Position = identifier128CharactersLong_0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.identifier64CharactersLong_0123456789012345678901234567890123456.identifier62CharactersLong_01234567890123456789012345678901234;
+}
+</script>
+<script id="badVertexShader" type="x-shader/x-vertex">
+// A vertex shader where the needed uniform location is 257 characters.
+struct Nesting2 {
+ vec4 identifier63CharactersLong_012345678901234567890123456789012345;
+};
+
+struct Nesting1 {
+ Nesting2 identifier64CharactersLong_0123456789012345678901234567890123456;
+};
+
+uniform Nesting1 identifier128CharactersLong_0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789;
+
+void main() {
+ Nesting2 temp = identifier128CharactersLong_0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.identifier64CharactersLong_0123456789012345678901234567890123456;
+ gl_Position = temp.identifier63CharactersLong_012345678901234567890123456789012345;
+}
+</script>
+<script id="fragmentShader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+debug("Test uniform location underneath the length limit");
+var program = wtu.loadProgramFromScript(gl, "goodVertexShader", "fragmentShader");
+shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true');
+var uniformLoc = gl.getUniformLocation(program, "identifier128CharactersLong_0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.identifier64CharactersLong_0123456789012345678901234567890123456.identifier62CharactersLong_01234567890123456789012345678901234");
+shouldBeNonNull('uniformLoc');
+wtu.glErrorShouldBe(gl, gl.NONE);
+
+debug("Test uniform location over the length limit");
+program = wtu.loadProgramFromScript(gl, "badVertexShader", "fragmentShader");
+wtu.glErrorShouldBe(gl, gl.NONE);
+shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true');
+var uniformLoc = gl.getUniformLocation(program, "identifier128CharactersLong_0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.identifier64CharactersLong_0123456789012345678901234567890123456.identifier63CharactersLong_012345678901234567890123456789012345");
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
+shouldBeNull('uniformLoc');
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uninitialized-local-global-variables.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uninitialized-local-global-variables.html
new file mode 100644
index 0000000000..d0552af096
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/misc/uninitialized-local-global-variables.html
@@ -0,0 +1,274 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Uninitialized local/global variables should be initialized</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+
+<script id="vs_uninit_in_frag" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 a_position;
+void main() {
+ gl_Position = a_position;
+}
+</script>
+
+<!-- Uninitialized local in vertex shader -->
+<script id="vs_uninit_local_in_vert" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 a_position;
+varying vec3 v_uninit;
+void main() {
+ vec3 uninit; // uninitialized
+ v_uninit = uninit;
+ gl_Position = a_position;
+}
+</script>
+<script id="fs_uninit_local_in_vert" type="x-shader/x-fragment">
+precision mediump float;
+varying vec3 v_uninit;
+void main() {
+ gl_FragColor = v_uninit.xyzz;
+}
+</script>
+
+<!-- Uninitialized local in fragment shader -->
+<script id="fs_uninit_local_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ vec2 uninit; // uninitialized
+ gl_FragColor = uninit.xyyy;
+}
+</script>
+
+<!-- Uninitialized global in vertex shader -->
+<script id="vs_uninit_global_in_vert" type="x-shader/x-vertex">
+precision mediump float;
+attribute vec4 a_position;
+varying float v_uninit;
+float uninit; // uninitialized
+void main() {
+ v_uninit = uninit;
+ gl_Position = a_position;
+}
+</script>
+<script id="fs_uninit_global_in_vert" type="x-shader/x-fragment">
+precision mediump float;
+varying float v_uninit;
+void main() {
+ gl_FragColor = vec4(v_uninit);
+}
+</script>
+
+<!-- Uninitialized global in fragment shader -->
+<script id="fs_uninit_global_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+vec4 uninit; // uninitialized
+void main() {
+ gl_FragColor = uninit;
+}
+</script>
+
+<!-- Uninitialized local int in fragment shader -->
+<script id="fs_uninit_local_int_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ int uninit;
+ gl_FragColor = vec4(uninit);
+}
+</script>
+
+<!-- Uninitialized local variable and another variable in the same declaration using it as an initializer in fragment shader -->
+<script id="fs_uninit_two_local_variables_in_declaration_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ vec2 uninit, uninit2 = uninit;
+ gl_FragColor = uninit2.xyyy;
+}
+</script>
+
+<!-- Uninitialized local array and another variable in the same declaration using it in its initializer in fragment shader -->
+<script id="fs_uninit_array_and_another_in_declaration_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ vec2 uninit[2], uninit2 = uninit[0];
+ gl_FragColor = uninit2.xyyy;
+}
+</script>
+
+<!-- Uninitialized global int in fragment shader -->
+<script id="fs_uninit_global_int_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+int uninit; // uninitialized
+void main() {
+ gl_FragColor = vec4(uninit);
+}
+</script>
+
+<!-- Uninitialized local struct in fragment shader -->
+<script id="fs_uninit_local_struct_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+struct S { vec4 v; };
+void main() {
+ S uninit; // uninitialized
+ gl_FragColor = uninit.v;
+}
+</script>
+
+<!-- Uninitialized global struct in fragment shader -->
+<script id="fs_uninit_global_struct_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+struct S { vec4 v; };
+S uninit; // uninitialized
+void main() {
+ gl_FragColor = uninit.v;
+}
+</script>
+
+<!-- Uninitialized nameless local struct in fragment shader -->
+<script id="fs_uninit_nameless_local_struct_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ struct { vec4 v; } uninit; // uninitialized
+ gl_FragColor = uninit.v;
+}
+</script>
+
+<!-- Uninitialized nameless global struct in fragment shader -->
+<script id="fs_uninit_nameless_global_struct_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+struct { vec4 v; } uninit; // uninitialized
+void main() {
+ gl_FragColor = uninit.v;
+}
+</script>
+
+<!-- Uninitialized local bool in fragment shader -->
+<script id="fs_uninit_local_bool_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ bool uninit[16]; // uninitialized
+ bool result;
+ for (int i = 0; i < 16; i++) {
+ result = result || uninit[i];
+ }
+ gl_FragColor = result ? vec4(1, 0, 0, 1) : vec4(0);
+}
+</script>
+
+<!-- Uninitialized global bool in fragment shader -->
+<script id="fs_uninit_global_bool_in_frag" type="x-shader/x-fragment">
+precision mediump float;
+bool uninit[16]; // uninitialized
+void main() {
+ bool result = false;
+ for (int i = 0; i < 16; i++) {
+ result = result || uninit[i];
+ }
+ gl_FragColor = result ? vec4(1, 0, 0, 1) : vec4(0);
+}
+</script>
+
+</head>
+<body>
+<canvas id="canvas" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Uninitialized local/global variables should be initialized: http://anglebug.com/1966');
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+wtu.setupUnitQuad(gl);
+
+var cases = [
+ {
+ name: "Uninitialized local variable in vertex shader",
+ prog: ["vs_uninit_local_in_vert", "fs_uninit_local_in_vert"],
+ },
+ {
+ name: "Uninitialized local variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_local_in_frag"],
+ },
+ {
+ name: "Uninitialized global variable in vertex shader",
+ prog: ["vs_uninit_global_in_vert", "fs_uninit_global_in_vert"],
+ },
+ {
+ name: "Uninitialized global variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_global_in_frag"],
+ },
+ {
+ name: "Uninitialized local int variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_local_int_in_frag"],
+ },
+ {
+ name: "Uninitialized local variable and another variable in the same declaration using it as an initializer in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_two_local_variables_in_declaration_in_frag"],
+ },
+ {
+ name: "Uninitialized local array and another variable in the same declaration using it in its initializer in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_array_and_another_in_declaration_in_frag"],
+ },
+ {
+ name: "Uninitialized global int variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_global_int_in_frag"],
+ },
+ {
+ name: "Uninitialized local struct variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_local_struct_in_frag"],
+ },
+ {
+ name: "Uninitialized global struct variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_global_struct_in_frag"],
+ },
+ {
+ name: "Uninitialized nameless local struct variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_nameless_local_struct_in_frag"],
+ },
+ {
+ name: "Uninitialized nameless global struct variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_nameless_global_struct_in_frag"],
+ },
+ {
+ name: "Uninitialized local bool array variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_local_bool_in_frag"],
+ },
+ {
+ name: "Uninitialized global bool array variable in fragment shader",
+ prog: ["vs_uninit_in_frag", "fs_uninit_global_bool_in_frag"],
+ },
+];
+
+function runTest() {
+ for (var i = 0; i < cases.length; ++i) {
+ debug("");
+ debug(cases[i].name);
+ var program = wtu.setupProgram(gl, cases[i].prog, ["a_position"], undefined, true);
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 0, 0, 0]);
+ }
+
+ debug("");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+runTest();
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/00_test_list.txt
new file mode 100644
index 0000000000..110657c1f7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/00_test_list.txt
@@ -0,0 +1,2 @@
+--min-version 1.0.4 comments.html
+--min-version 1.0.4 macro-expansion-tricky.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/comments.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/comments.html
new file mode 100644
index 0000000000..0e3dfb3e32
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/comments.html
@@ -0,0 +1,204 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Comments</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+
+// Your syntax highlighter may hate this file.
+// Because this stuff is tricky, we collect all tests here, including duplicating from other tests.
+// That way, this test file is a one-stop-shop for validation testing.
+
+const nonAscii = [
+ 65533,
+ 65533,
+ 65533,
+ 65533,
+ 834,
+ 96,
+ 65533,
+ 114,
+ 65533,
+ 98,
+ 65533,
+ 104,
+ 65533,
+ 104,
+ 65533,
+ 322,
+ 834,
+ 514,
+ 65533,
+ 65533,
+ 322,
+ 65533,
+ 65533,
+ 66,
+].map(x => String.fromCodePoint(x)).join('');
+
+GLSLConformanceTester.runTests([{
+ vShaderSource: `void main() {}`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Normal minimal testcase'
+ }, {
+ vShaderSource: `void main() {}/*`,
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'Missing block-comment-end'
+ }, {
+ vShaderSource: `void main() {}/**`,
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'Partial block-comment-end'
+ }, {
+ vShaderSource: `void main() {}/**/`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Complete block-comment-end'
+ }, {
+ vShaderSource: `void main() {}/* **/`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Complete block-comment-end with **/'
+ }, {
+ vShaderSource: `void main() {}/`,
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'Partial line-comment-begin at EOF'
+ }, {
+ vShaderSource: `void main() {}//`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Complete line-comment-begin at EOF'
+ }, {
+ vShaderSource: `//
+void main() {}`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: `Minimal line comment: "//,\\n"`
+ }, {
+ vShaderSource: `//\
+
+void main() {}`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: `Minimal continued line comment: "//,\\,\\n,\\n"`
+ }, {
+ vShaderSource: `//\
+a
+void main() {}`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: `Line-comment continuation with content that must be skipped: "//,\\,\\n,a,\\n"`
+ }, {
+ vShaderSource: `void main() {} // The quick brown fox jumped\\over the lazy dog`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Backslash in comment'
+ }, {
+ vShaderSource: `void main() {} // The quick brown fox jumped\\over the lazy dog
+`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Backslash in comment with newline before EOF'
+ }, {
+ vShaderSource: `void main() {} // The quick brown fox jumped\\
+over the lazy dog`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Line-comment with backslash-line-continuation'
+ }, {
+ vShaderSource: `void main() {} // The quick brown fox jumped\\
+over the lazy dog
+`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Line-comment with backslash-line-continuation with newline before EOF'
+ }, {
+ vShaderSource: `void main() {}//${String.fromCodePoint(0x8f)}`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'upper-ascii in line-comment'
+ }, {
+ vShaderSource: `void main() {}/*${String.fromCodePoint(0x8f)}*/`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'upper-ascii in block-comment'
+
+ // -
+ // Like comment_frag.frag from conformance/ogles/GL/build/build_049_to_056.html
+ }, {
+ vShaderSource: `
+void main()
+{
+ /****** // comment not closed
+}`,
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'Unclosed block-comment containing line-comment'
+
+
+ // -
+ // Like conformance/glsl/misc/non-ascii-comments.vert.html
+ }, {
+ vShaderSource: `void main() {}/*${String.fromCodePoint(0x8f)}`,
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'upper-ascii in unterminated block-comment'
+ }, {
+ vShaderSource: `void main() {}// ${nonAscii}`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'More non-ascii in line-comment'
+ }, {
+ vShaderSource: `void main() {}/*
+ * ${nonAscii}
+ */`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'More non-ascii in block-comment'
+ }, {
+ vShaderSource: `void main() {}/*
+ * ${nonAscii}
+ *`,
+ vShaderSuccess: false,
+ linkSuccess: false,
+ passMsg: 'More non-ascii in unterminated block-comment'
+
+
+ // -
+ // Like deqp/data/gles2/shaders/preprocessor.html | preprocessor.comments.comment_trick_2_*
+ }, {
+ vShaderSource: `void main() {
+ float out0;
+ /**/
+ out0 = 1.0;
+ /*/
+ out0 = 0.0;
+ /**/
+ }`,
+ vShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: '/**/ /*/ /**/'
+}]);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/macro-expansion-tricky.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/macro-expansion-tricky.html
new file mode 100644
index 0000000000..8c925f4d7d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/preprocessor/macro-expansion-tricky.html
@@ -0,0 +1,46 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Tricky macro expansion</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderRecursiveMacroNameInsideIncompleteMacroInvocationInMacroExpansion" type="x-shader/x-fragment">
+#define m(a)
+#define a m((a)
+a)
+
+precision mediump float;
+
+void main() {
+ gl_FragColor = vec4(0.0);
+}
+</script>
+<script type="application/javascript">
+"use strict";
+description();
+
+GLSLConformanceTester.runTests([
+{
+ fShaderId: 'fshaderRecursiveMacroNameInsideIncompleteMacroInvocationInMacroExpansion',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: 'Recursive macro name inside incomplete macro invocation in macro expansion should not crash'
+}
+]);
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt
new file mode 100644
index 0000000000..7c2da3e8f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/00_test_list.txt
@@ -0,0 +1,8 @@
+_webgl_field.vert.html
+_webgl_function.vert.html
+_webgl_struct.vert.html
+_webgl_variable.vert.html
+webgl_field.vert.html
+webgl_function.vert.html
+webgl_struct.vert.html
+webgl_variable.vert.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html
new file mode 100644
index 0000000000..b9bba36da7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_field.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved _webgl prefix as structure field should fail
+struct Foo {
+ int _webgl_bar;
+};
+
+void main() {
+ Foo foo = Foo(1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html
new file mode 100644
index 0000000000..ea9586fd53
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_function.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved _webgl prefix as function name should fail
+vec4 _webgl_foo() {
+ return vec4(1.0);
+}
+
+void main() {
+ gl_Position = _webgl_foo();
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html
new file mode 100644
index 0000000000..df61e9d7d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_struct.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved _webgl prefix as structure name should fail
+struct _webgl_Foo {
+ int bar;
+};
+
+void main() {
+ _webgl_Foo foo = _webgl_Foo(1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html
new file mode 100644
index 0000000000..bcae6ec7ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/_webgl_variable.vert.html
@@ -0,0 +1,34 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved _webgl prefix as structure field should fail
+void main() {
+ vec4 _webgl_foo;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html
new file mode 100644
index 0000000000..a41712661f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_field.vert.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved webgl_ prefix as structure field should fail
+struct Foo {
+ int webgl_bar;
+};
+
+void main() {
+ Foo foo = Foo(1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html
new file mode 100644
index 0000000000..4a9ac1698a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_function.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved webgl_ prefix as function name should fail
+vec4 webgl_foo() {
+ return vec4(1.0);
+}
+
+void main() {
+ gl_Position = webgl_foo();
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html
new file mode 100644
index 0000000000..a5a0294a3d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_struct.vert.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved webgl_ prefix as structure name should fail
+struct webgl_Foo {
+ int bar;
+};
+
+void main() {
+ webgl_Foo foo = webgl_Foo(1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html
new file mode 100644
index 0000000000..f2b6708e9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/reserved/webgl_variable.vert.html
@@ -0,0 +1,34 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vertexShader" type="text/something-not-javascript">
+
+// use of reserved webgl_ prefix as variable should fail
+void main() {
+ vec4 webgl_foo;
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt
new file mode 100644
index 0000000000..c0f612d81d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/00_test_list.txt
@@ -0,0 +1,4 @@
+glsl-function-texture2d-bias.html
+glsl-function-texture2dlod.html
+glsl-function-texture2dproj.html
+--min-version 1.0.3 glsl-function-texture2dprojlod.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html
new file mode 100644
index 0000000000..073276615f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2d-bias.html
@@ -0,0 +1,101 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture2D GLSL conformance test.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="256" height="256" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader2d" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main() {
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+<script id="fshader2d" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+uniform float bias;
+varying vec2 texCoord;
+void main() {
+ gl_FragData[0] = texture2D(tex, texCoord, bias);
+}
+</script>
+<script>
+"use strict";
+description("tests GLSL texture2D function with bias");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+
+shouldBe("canvas.width", "256");
+shouldBe("canvas.height", "256");
+
+var gl = wtu.create3DContext(canvas);
+var program = wtu.setupProgram(
+ gl, ['vshader2d', 'fshader2d'], ['vPosition', 'texCoord0'], [0, 1]);
+wtu.setupUnitQuad(gl, 0, 1);
+
+var colors = [
+ {name: 'red', color:[255, 0, 0, 255]},
+ {name: 'green', color:[0, 255, 0, 255]},
+ {name: 'blue', color:[0, 0, 255, 255]},
+ {name: 'yellow', color:[255, 255, 0, 255]},
+ {name: 'magenta', color:[255, 0, 255, 255]},
+ {name: 'cyan', color:[0, 255, 255, 255]},
+ {name: 'pink', color:[255, 128, 128, 255]},
+ {name: 'gray', color:[128, 128, 128, 255]},
+ {name: 'light green', color:[128, 255, 128, 255]},
+];
+
+shouldBe("colors.length", "9");
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+for (var ii = 0; ii < colors.length; ++ii) {
+ var color = colors[ii];
+ var size = Math.pow(2, colors.length - ii - 1);
+ wtu.fillTexture(gl, tex, size, size, color.color, ii);
+}
+
+var loc = gl.getUniformLocation(program, "bias");
+
+for (var ii = 0; ii < colors.length; ++ii) {
+ gl.uniform1f(loc, ii);
+ var color = colors[ii];
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, color.color,
+ "256x256 texture drawn to 256x256 dest with bias = " + ii +
+ " should be " + color.name);
+}
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html
new file mode 100644
index 0000000000..41387bca15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dlod.html
@@ -0,0 +1,109 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture2D GLSL conformance test.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="256" height="256" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader2d" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec4 color;
+uniform sampler2D tex;
+uniform float lod;
+void main() {
+ gl_Position = vPosition;
+ color = texture2DLod(tex, texCoord0, lod);
+}
+</script>
+<script id="fshader2d" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+void main() {
+ gl_FragData[0] = color;
+}
+</script>
+<script>
+"use strict";
+description("tests GLSL texture2DLod function");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+
+shouldBe("canvas.width", "256");
+shouldBe("canvas.height", "256");
+
+var colors = [
+ {name: 'red', color:[255, 0, 0, 255]},
+ {name: 'green', color:[0, 255, 0, 255]},
+ {name: 'blue', color:[0, 0, 255, 255]},
+ {name: 'yellow', color:[255, 255, 0, 255]},
+ {name: 'magenta', color:[255, 0, 255, 255]},
+ {name: 'cyan', color:[0, 255, 255, 255]},
+ {name: 'pink', color:[255, 128, 128, 255]},
+ {name: 'gray', color:[128, 128, 128, 255]},
+ {name: 'light green', color:[128, 255, 128, 255]},
+];
+
+var gl = wtu.create3DContext(canvas);
+if (gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0) {
+ runTest();
+} else {
+ testPassed("MAX_VERTEX_TEXTURE_IMAGE_UNITS == 0, this is okay.");
+}
+
+function runTest() {
+ var program = wtu.setupProgram(
+ gl, ['vshader2d', 'fshader2d'], ['vPosition', 'texCoord0'], [0, 1]);
+ wtu.setupUnitQuad(gl, 0, 1);
+
+ shouldBe("colors.length", "9");
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+ for (var ii = 0; ii < colors.length; ++ii) {
+ var color = colors[ii];
+ var size = Math.pow(2, colors.length - ii - 1);
+ wtu.fillTexture(gl, tex, size, size, color.color, ii);
+ }
+
+ var loc = gl.getUniformLocation(program, "lod");
+
+ for (var ii = 0; ii < colors.length; ++ii) {
+ gl.uniform1f(loc, ii);
+ var color = colors[ii];
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, color.color,
+ "256x256 texture drawn to 256x256 dest with lod = " + ii +
+ " should be " + color.name);
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+}
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html
new file mode 100644
index 0000000000..c9e042f9a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dproj.html
@@ -0,0 +1,116 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture2D GLSL conformance test.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader0" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main() {
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+<script id="fshader0" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+uniform float divisor;
+varying vec2 texCoord;
+void main() {
+ gl_FragData[0] = texture2DProj(tex, vec3(texCoord, divisor));
+}
+</script>
+<script id="vshader1" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main() {
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+<script id="fshader1" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+uniform float divisor;
+varying vec2 texCoord;
+void main() {
+ gl_FragData[0] = texture2DProj(tex, vec4(texCoord, 123.0, divisor));
+}
+</script>
+<script>
+"use strict";
+description("tests GLSL texture2DProj function with");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example", {antialias: false});
+
+wtu.setupUnitQuad(gl, 0, 1);
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+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.REPEAT);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+var c = document.createElement("canvas");
+c.width = 16;
+c.height = 16;
+var ctx = c.getContext("2d");
+ctx.fillStyle = "rgb(0,255,0)";
+ctx.fillRect(0, 0, 16, 16);
+ctx.fillStyle = "rgb(0,0,255)";
+ctx.fillRect(0, 0, 8, 8);
+ctx.fillRect(8, 8, 8, 8);
+
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+
+for (var ss = 0; ss < 2; ++ss) {
+ debug("");
+ debug(ss ? "testing vec4 version" : "testing vec3 version");
+ var program = wtu.setupProgram(
+ gl, ['vshader' + ss, 'fshader' + ss],
+ ['vPosition', 'texCoord0'], [0, 1]);
+ gl.useProgram(program);
+ var loc = gl.getUniformLocation(program, "divisor");
+
+ for (var ii = 0; ii < 3; ++ii) {
+ var denominator = Math.pow(2, ii);
+ gl.uniform1f(loc, 1 / denominator);
+ wtu.clearAndDrawUnitQuad(gl);
+ var size = 16 / denominator;
+ for (var yy = 0; yy < 32; yy += size) {
+ for (var xx = 0; xx < 32; xx += size) {
+ var odd = (xx / size + yy / size) % 2;
+ var color = odd ? [0, 255, 0, 255] : [0, 0, 255, 255];
+ var msg = "" + xx + ", " + yy + ", " + size + ", " + size + " should be " + (odd ? "green" : "blue");
+ wtu.checkCanvasRect(gl, xx, yy, size, size, color, msg);
+ }
+ }
+ }
+}
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html
new file mode 100644
index 0000000000..c7c091ee8e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/samplers/glsl-function-texture2dprojlod.html
@@ -0,0 +1,162 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture2D GLSL conformance test.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="256" height="256" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader2dvec3" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec4 color;
+uniform sampler2D tex;
+uniform float divisor;
+uniform float lod;
+void main() {
+ gl_Position = vPosition;
+ color = texture2DProjLod(tex, vec3(0.75 * divisor, 0.25 * divisor, divisor), lod);
+}
+</script>
+<script id="vshader2dvec4" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec4 color;
+uniform sampler2D tex;
+uniform float divisor;
+uniform float lod;
+void main() {
+ gl_Position = vPosition;
+ color = texture2DProjLod(tex, vec4(0.75 * divisor, 0.25 * divisor, 123.0, divisor), lod);
+}
+</script>
+<script id="fshader2d" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+void main() {
+ gl_FragData[0] = color;
+}
+</script>
+<script>
+"use strict";
+description("tests GLSL texture2DProjLod function");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+
+shouldBe("canvas.width", "256");
+shouldBe("canvas.height", "256");
+
+var colors = [
+ {name: 'red', color:[255, 0, 0, 255]},
+ {name: 'green', color:[0, 255, 0, 255]},
+ {name: 'blue', color:[0, 0, 255, 255]},
+ {name: 'yellow', color:[255, 255, 0, 255]},
+ {name: 'magenta', color:[255, 0, 255, 255]},
+ {name: 'cyan', color:[0, 255, 255, 255]},
+ {name: 'pink', color:[255, 128, 128, 255]},
+ {name: 'gray', color:[128, 128, 128, 255]},
+ {name: 'light green', color:[128, 255, 128, 255]},
+];
+var contextTypes = ["2d", "webgl"];
+var vectorTypes = ["vec3", "vec4"];
+
+var gl = wtu.create3DContext(canvas);
+if (gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0) {
+ runTest();
+} else {
+ testPassed("MAX_VERTEX_TEXTURE_IMAGE_UNITS == 0, this is okay.");
+}
+
+
+function runTest() {
+ // Avoid creating a WebGL context for every test, as it causes:
+ // Too many active WebGL contexts. Oldest context will be lost.
+ var canvasWebGL = document.createElement("canvas");
+ var ctxWebGL = canvasWebGL.getContext("webgl");
+
+ // Might as well do the same for canvas 2d
+ var canvas2d = document.createElement("canvas");
+ var ctx2d = canvas2d.getContext("2d");
+
+ shouldBe("colors.length", "9");
+ contextTypes.forEach((context) => {
+ vectorTypes.forEach((vectorType) => {
+ debug("");
+ debug(`testing ${context} context with ${vectorType} vertex shader`);
+ var program = wtu.setupProgram(
+ gl, ['vshader2d' + vectorType, 'fshader2d'], ['vPosition', 'texCoord0'], [0, 1]);
+ wtu.setupUnitQuad(gl, 0, 1);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texParameteri(
+ gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+ // Fill the top right quadrant of each texture level with one of the colors
+ for (var ii = 0; ii < colors.length; ++ii) {
+ var color = colors[ii];
+ var size = Math.pow(2, colors.length - ii - 1);
+
+ if (context === "2d") {
+ canvas2d.width = size;
+ canvas2d.height = size;
+ ctx2d.fillStyle = "rgb(0,0,0)";
+ ctx2d.fillRect(0, 0, size, size);
+ ctx2d.fillStyle = "rgb(" + color.color[0] + "," + color.color[1] + "," + color.color[2] + ")";
+ ctx2d.fillRect(size / 2, 0, size / 2, size / 2);
+ gl.texImage2D(gl.TEXTURE_2D, ii, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+ } else if (context === "webgl") {
+ canvasWebGL.width = canvasWebGL.height = size;
+ ctxWebGL.clearColor(0, 0, 0, 1);
+ ctxWebGL.clear(gl.COLOR_BUFFER_BIT);
+ ctxWebGL.enable(gl.SCISSOR_TEST);
+ ctxWebGL.scissor(size/2, size/2, size/2, size/2)
+ ctxWebGL.clearColor(color.color[0]/255, color.color[1]/255, color.color[2]/255, 1)
+ ctxWebGL.clear(gl.COLOR_BUFFER_BIT);
+ gl.texImage2D(gl.TEXTURE_2D, ii, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvasWebGL);
+ }
+ }
+
+ var lodLoc = gl.getUniformLocation(program, "lod");
+ var divLoc = gl.getUniformLocation(program, "divisor");
+
+ for (var div = 1; div < 4; ++div) {
+ for (var ii = 0; ii < colors.length - 1; ++ii) {
+ gl.uniform1f(lodLoc, ii);
+ gl.uniform1f(divLoc, div);
+ var lodColor = colors[ii];
+ var size = Math.pow(2, colors.length - ii - 1);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, lodColor.color,
+ "sampling with lod = " + ii +
+ " divider = " + div +
+ " should be " + lodColor.name);
+ }
+ }
+ });
+ });
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+}
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt
new file mode 100644
index 0000000000..31fe0f8f20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/00_test_list.txt
@@ -0,0 +1,6 @@
+gl-fragcoord.html
+gl-frontfacing.html
+gl-pointcoord.html
+--min-version 1.0.2 glsl-built-ins.html
+--min-version 1.0.3 gl-fragcoord-xy-values.html
+--min-version 1.0.3 gl-fragdata-and-fragcolor.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html
new file mode 100644
index 0000000000..161a58bfc6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord-xy-values.html
@@ -0,0 +1,185 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>gl-fragcoord 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>
+</head>
+<body>
+<canvas id="canvas" width="32" height="32">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+// Inputs
+attribute vec4 aPosInfo;
+
+// Outputs
+varying vec2 vTargetPixelCoord;
+
+void main()
+{
+ vTargetPixelCoord = aPosInfo.zw;
+
+ gl_PointSize = 1.0;
+ gl_Position = vec4(aPosInfo.xy, 0.0, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+// Inputs
+varying vec2 vTargetPixelCoord;
+
+// Colors used to signal correctness
+const vec4 red = vec4(1.0, 0.0, 0.0, 1.0);
+const vec4 green = vec4(0.0, 1.0, 0.0, 1.0);
+
+void main()
+{
+ // Check pixel index
+ bool pixelIxValid = (floor(gl_FragCoord.xy) == vTargetPixelCoord);
+
+ // Check fractional part of coordinates
+ bool fracCoordValid = all(lessThan(abs(fract(gl_FragCoord.xy) - vec2(0.5)), vec2(0.0001)));
+
+ gl_FragColor = (pixelIxValid && fracCoordValid) ? green : red;
+}
+</script>
+
+<script id="test_fshader" type="x-shader/x-fragment">
+// Shader to test if the frame buffer positions within the output pixel are different for the five render passes
+// Pass on frame buffer position in varying, change in vertex shader : vTargetPixelCoord = aPosInfo.xy;
+// Set test_fshader in setupProgram()
+
+precision mediump float;
+
+// Inputs
+varying vec2 vTargetPixelCoord;
+
+const vec2 pixSize = vec2(2.0/32.0, 2.0/32.0);
+
+void main()
+{
+ // Coordinates within a framebuffer pixel [0, 1>
+ vec2 inPixelCoord = fract(vTargetPixelCoord / pixSize);
+
+ // Create different color dependent on the position inside the framebuffer pixel
+ float r = (inPixelCoord.x < 0.4) ? 0.2 : (inPixelCoord.x > 0.6) ? 0.8 : 0.5;
+ float g = (inPixelCoord.y < 0.4) ? 0.2 : (inPixelCoord.y > 0.6) ? 0.8 : 0.5;
+
+ gl_FragColor = vec4(r, g, 0.0, 1.0);
+}
+</script>
+
+<script>
+"use strict";
+
+// Test if gl_FragCoord.xy values are always of the form :
+// (first framebuffer pixel index + 0.5, second framebuffer pixel index + 0.5)
+// (if no multisampling)
+
+// This is done by rendering a set of points which targets either the center of the
+// output pixel or the center of one of the quadrants
+
+// Constants
+var floatsPerAttribute = 4;
+
+// Globals
+var wtu;
+var gl;
+var program;
+var vxBuffer;
+
+// Set data for one attribute (framebuffer.xy, pixel_index.xy)
+function setPixelData(data, dIx, xx, yy, xSize, ySize, xOffset, yOffset)
+{
+ // Frame buffer first coordinate [-1, 1]
+ data[dIx++] = (xx + 0.5) * xSize + xOffset - 1;
+
+ // Frame buffer second coordinate [-1, 1]
+ data[dIx++] = (yy + 0.5) * ySize + yOffset - 1;
+
+ // Frame buffer pixel first index
+ data[dIx++] = xx;
+
+ // Frame buffer pixel second index
+ data[dIx++] = yy;
+
+ return dIx;
+}
+
+// Create attribute data
+function createAttributeData(xOffset, yOffset)
+{
+ // Retrieve realised dimensions of viewport
+ var widthPx = gl.drawingBufferWidth;
+ var heightPx = gl.drawingBufferHeight;
+ var pixelCount = widthPx * heightPx;
+
+ // Pixel size in framebuffer coordinates
+ var pWidth = 2 / widthPx;
+ var pHeight = 2 / heightPx;
+ var data = new Float32Array(pixelCount * floatsPerAttribute);
+ var dIx = 0;
+ for (var yy = 0; yy < heightPx; ++yy)
+ for (var xx = 0; xx < widthPx; ++xx)
+ dIx = setPixelData(data, dIx, xx, yy, pWidth, pHeight, xOffset * pWidth, yOffset * pHeight);
+
+ if (dIx !== data.length)
+ wtu.error("gl-fragcoord-xy-values.html, createAttributeData(), index not correct at end");
+
+ return data;
+}
+
+// Initialize test
+function init()
+{
+ description("tests gl_FragCoord.xy values");
+
+ wtu = WebGLTestUtils;
+ gl = wtu.create3DContext("canvas", { antialias: false });
+ program = wtu.setupProgram(gl, ["vshader", "fshader"], ["aPosInfo"]);
+ vxBuffer = gl.createBuffer();
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, vxBuffer);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, floatsPerAttribute, gl.FLOAT, false, 0, 0);
+}
+
+// Render data
+function render(xOffset, yOffset, passMsg)
+{
+ // Set attribute data
+ var data = createAttributeData(xOffset, yOffset);
+ gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.POINTS, 0, data.length / floatsPerAttribute);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw");
+ var green = [0, 255, 0, 255];
+ wtu.checkCanvas(gl, green, passMsg);
+}
+
+// Run tests
+init();
+render(0, 0, "green : sampling at center of output pixel is correct");
+render(0.25, 0.25, "green : sampling in top right quadrant of output pixel is correct");
+render(-0.25, 0.25, "green : sampling in top left quadrant of output pixel is correct");
+render( 0.25, -0.25, "green : sampling in bottom right quadrant of output pixel is correct");
+render(-0.25, -0.25, "green : sampling in bottom left quadrant of output pixel is correct");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html
new file mode 100644
index 0000000000..e5f6e27537
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragcoord.html
@@ -0,0 +1,84 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>gl-fragcoord 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>
+</head>
+<body>
+<canvas id="example" width="32" height="32">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(
+ floor(gl_FragCoord.x * 4.0 / 32.0) / 4.0,
+ floor(gl_FragCoord.y * 4.0 / 32.0) / 4.0,
+ floor(gl_FragCoord.z * 4.0) / 4.0,
+ 1);
+}
+</script>
+
+<script>
+"use strict";
+function init()
+{
+ description("tests gl_FragCoord");
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(
+ [-1, -1, -1, 1, -1, 0, -1, 1, 0,
+ -1, 1, 0, 1, -1, 0, 1, 1, 1]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw");
+
+ for (var xx = 0; xx < 32; xx += 4) {
+ for (var yy = 0; yy < 32; yy += 4) {
+ var zz = (xx / 64) + (yy / 64);
+ var color = [
+ Math.floor(Math.floor(xx * 4.0 / 32.0) / 4 * 256),
+ Math.floor(Math.floor(yy * 4.0 / 32.0) / 4 * 256),
+ Math.floor(Math.floor(zz * 4.0) / 4 * 256)
+ ];
+ var msg = "should be " + color;
+ wtu.checkCanvasRect(gl, xx, yy, 1, 1, color, msg, 4);
+ }
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html
new file mode 100644
index 0000000000..5f0e82e8af
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-fragdata-and-fragcolor.html
@@ -0,0 +1,38 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/glsl-conformance-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fragmentShader" type="text/something-not-javascript">
+// fragment shader with static assignment to both gl_FragData[0] and gl_FragColor should fail.
+// GLES spec section 3.8.2 subsection Shader Outputs.
+precision mediump float;
+
+void main()
+{
+ gl_FragData[0] = vec4(1, 0, 0, 1);
+ gl_FragColor = vec4(0, 1, 0, 1);
+}
+</script>
+<script>
+"use strict";
+GLSLConformanceTester.runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html
new file mode 100644
index 0000000000..1716161bcf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-frontfacing.html
@@ -0,0 +1,86 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>gl-fragcoord 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>
+</head>
+<body>
+<canvas id="example" width="32" height="32">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(
+ gl_FrontFacing ? 1.0 : 0.0,
+ gl_FrontFacing ? 0.0 : 1.0,
+ 0,
+ 1);
+}
+</script>
+
+<script>
+"use strict";
+function init()
+{
+ description("tests gl_FrontFacing");
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+ var gridRes = 4;
+ wtu.setupIndexedQuad(gl, gridRes, 0, true);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.TRIANGLES, gridRes * gridRes * 6, gl.UNSIGNED_SHORT, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from draw");
+
+ var step = 32 / gridRes;
+ var halfStep = step / 2;
+ var quarterStep = halfStep / 2;
+ for (var xx = 0; xx < 32; xx += step) {
+ for (var yy = 0; yy < 32; yy += step) {
+ for (var ii = 0; ii < 2; ++ii) {
+ var color = [
+ ii == 0 ? 255 : 0,
+ ii == 0 ? 0 : 255,
+ 0
+ ];
+ var msg = "should be " + color;
+ wtu.checkCanvasRect(
+ gl,
+ xx + quarterStep + halfStep * ii,
+ yy + quarterStep + halfStep * ii,
+ 1, 1, color, msg, 4);
+ }
+ }
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html
new file mode 100644
index 0000000000..f87078a6ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/gl-pointcoord.html
@@ -0,0 +1,141 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>gl-pointcoord 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>
+</head>
+<body>
+<canvas id="example" width="256" height="256">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+uniform float uPointSize;
+void main()
+{
+ gl_PointSize = uPointSize;
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(
+ gl_PointCoord.x,
+ gl_PointCoord.y,
+ 0,
+ 1);
+}
+</script>
+
+<script>
+"use strict";
+description("Checks gl_PointCoord and gl_PointSize");
+debug("");
+
+// NOTE: I'm not 100% confident in this test. I think it is correct.
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+shouldBeNonNull("gl");
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+shouldBe("gl.getError()", "gl.NO_ERROR");
+
+var canvas = gl.canvas;
+var width = canvas.width;
+var height = canvas.height;
+shouldBe("width", "height");
+
+var maxPointSize = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)[1];
+shouldBeTrue("maxPointSize >= 1");
+// The minimum and maximum point sizes may be floating-point numbers.
+shouldBeTrue("Math.floor(maxPointSize) >= 1");
+maxPointSize = Math.floor(maxPointSize);
+shouldBeTrue("maxPointSize % 1 == 0");
+
+maxPointSize = Math.min(maxPointSize, 64);
+var pointWidth = maxPointSize / width;
+var pointStep = Math.floor(maxPointSize / 4);
+var pointStep = Math.max(1, pointStep);
+
+var pointSizeLoc = gl.getUniformLocation(program, "uPointSize");
+gl.uniform1f(pointSizeLoc, maxPointSize);
+
+var pixelOffset = (maxPointSize % 2) ? (1 / width) : 0;
+var vertexObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array(
+ [-0.5 + pixelOffset, -0.5 + pixelOffset,
+ 0.5 + pixelOffset, -0.5 + pixelOffset,
+ -0.5 + pixelOffset, 0.5 + pixelOffset,
+ 0.5 + pixelOffset, 0.5 + pixelOffset]),
+ gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+gl.drawArrays(gl.POINTS, 0, 4);
+shouldBe("gl.getError()", "gl.NO_ERROR");
+
+function s2p(s) {
+ return (s + 1.0) * 0.5 * width;
+}
+
+//function print(x, y) {
+// var b = new Uint8Array(4);
+// gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, b);
+// debug("" + x + "," + y + ": " + b[0] + "," + b[1] + "," + b[2]);
+//}
+//
+//for (var ii = 0; ii < 100; ++ii) {
+// print(ii, ii);
+//}
+
+for (var py = 0; py < 2; ++py) {
+ for (var px = 0; px < 2; ++px) {
+ debug("");
+ var pointX = -0.5 + px + pixelOffset;
+ var pointY = -0.5 + py + pixelOffset;
+ for (var yy = 0; yy < maxPointSize; yy += pointStep) {
+ for (var xx = 0; xx < maxPointSize; xx += pointStep) {
+ // formula for s and t from OpenGL ES 2.0 spec section 3.3
+ var xw = s2p(pointX);
+ var yw = s2p(pointY);
+ //debug("xw: " + xw + " yw: " + yw);
+ var u = xx / maxPointSize * 2 - 1;
+ var v = yy / maxPointSize * 2 - 1;
+ var xf = Math.floor(s2p(pointX + u * pointWidth));
+ var yf = Math.floor(s2p(pointY + v * pointWidth));
+ //debug("xf: " + xf + " yf: " + yf);
+ var s = 0.5 + (xf + 0.5 - xw) / maxPointSize;
+ var t = 0.5 + (yf + 0.5 - yw) / maxPointSize;
+ //debug("s: " + s + " t: " + t);
+ var color = [Math.floor(s * 255), Math.floor((1 - t) * 255), 0];
+ var msg = "pixel " + xf + "," + yf + " should be " + color;
+ wtu.checkCanvasRect(gl, xf, yf, 1, 1, color, msg, 4);
+ }
+ }
+ }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html
new file mode 100644
index 0000000000..32c3f8f5e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/glsl/variables/glsl-built-ins.html
@@ -0,0 +1,106 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL built in variables Conformance Test</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<link rel="stylesheet" href="../../../resources/glsl-feature-tests.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main()
+{
+ gl_Position = a_position;
+}
+</script>
+<script id="vshaderCheck" type="x-shader/x-vertex">
+attribute vec4 a_position;
+varying vec4 v_color;
+void main()
+{
+ gl_Position = a_position;
+ v_color = (gl_$(name) == $(max)) ? vec4(0,1,0,1) : vec4(1,0,0,1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main()
+{
+ gl_FragColor = v_color;
+}
+</script>
+<script id="fshaderCheck" type="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = (gl_$(name) == $(max)) ? vec4(0,1,0,1) : vec4(1,0,0,1);
+}
+</script>
+<script>
+"use strict";
+description();
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var contextVersion = wtu.getDefault3DContextVersion();
+
+var variables = [
+ { name: 'MaxVertexAttribs', min: 8, },
+ { name: 'MaxVertexUniformVectors', min: 128, },
+ { name: 'MaxVaryingVectors', min: 8, },
+ { name: 'MaxVertexTextureImageUnits', min: 0, },
+ { name: 'MaxCombinedTextureImageUnits', min: 8, },
+ { name: 'MaxTextureImageUnits', min: 8, },
+ { name: 'MaxFragmentUniformVectors', min: 16, },
+];
+
+if (contextVersion <= 1) {
+ variables.push({ name: 'MaxDrawBuffers', min: 1, max: 1});
+} else {
+ variables.push({ name: 'MaxDrawBuffers', min: 1, });
+}
+
+var toUnderscore = function(str) {
+ return str.replace(/([a-z])([A-Z])/g, function (g) { return g[0] + "_" + g[1].toUpperCase() }).toUpperCase();
+};
+
+var shaderPairs = [
+ [wtu.getScript("vshader"), wtu.getScript("fshaderCheck")],
+ [wtu.getScript("vshaderCheck"), wtu.getScript("fshader")],
+];
+
+wtu.setupUnitQuad(gl);
+
+variables.forEach(function(variable) {
+ debug("");
+ debug("Testing gl_" + variable.name);
+ if (!variable.max) {
+ variable.max = gl.getParameter(gl[toUnderscore(variable.name)]);
+ expectTrue(variable.max >= variable.min, "gl.getParameter(gl." + toUnderscore(variable.name) + ") >= " + variable.min);
+ }
+ shaderPairs.forEach(function(pair) {
+ var shaders = [wtu.replaceParams(pair[0], variable), wtu.replaceParams(pair[1], variable)];
+ var program = wtu.setupProgram(gl, shaders, ["a_position"], undefined, true);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ });
+});
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt
new file mode 100644
index 0000000000..79eb84a48e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/00_test_list.txt
@@ -0,0 +1,6 @@
+--min-version 1.0.4 gl-line-width.html
+gl-min-attribs.html
+gl-max-texture-dimensions.html
+gl-min-textures.html
+gl-min-uniforms.html
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html
new file mode 100644
index 0000000000..e446c62a94
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-line-width.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Verify that line width limits are enforced.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+// Query the line width range
+var lineWidthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+
+if (lineWidthRange[0] > 1 || lineWidthRange[1] < 1)
+ testFailed("Line width range must include width 1");
+
+// Zero, negative, or NaN values should cause an error and leave the value unchanged.
+var curLineWidth = gl.getParameter(gl.LINE_WIDTH);
+gl.lineWidth(0);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "Should not be able to set lineWidth to zero");
+shouldBe('gl.getParameter(gl.LINE_WIDTH)', 'curLineWidth'); // Previous value should be preserved
+
+gl.lineWidth(-1);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "Should not be able to set lineWidth to a negative value");
+shouldBe('gl.getParameter(gl.LINE_WIDTH)', 'curLineWidth'); // Previous value should be preserved
+
+gl.lineWidth(NaN);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "Should not be able to set lineWidth to NaN");
+shouldBe('gl.getParameter(gl.LINE_WIDTH)', 'curLineWidth'); // Previous value should be preserved
+
+// Check that the line width can be set to the valid range.
+gl.lineWidth(lineWidthRange[1]);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be able to set lineWidth to the max supported value");
+shouldBe('gl.getParameter(gl.LINE_WIDTH)', 'lineWidthRange[1]');
+
+gl.lineWidth(lineWidthRange[0]);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be able to set lineWidth to the min supported value");
+shouldBe('gl.getParameter(gl.LINE_WIDTH)', 'lineWidthRange[0]');
+
+// Checks that the line width can be set outside the supported range without error,
+// and the unclamped value can be queried back.
+// Yes, this is actually what the spec says should happen.
+// See: https://www.khronos.org/opengles/sdk/docs/man3/html/glLineWidth.xhtml
+gl.lineWidth(lineWidthRange[1]+1);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be able to set lineWidth to the above max supported value");
+shouldBe('gl.getParameter(gl.LINE_WIDTH)', 'lineWidthRange[1]+1');
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html
new file mode 100644
index 0000000000..a9c5850225
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-max-texture-dimensions.html
@@ -0,0 +1,109 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL the max advertized texture size is supported.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform samplerCube tex;
+varying vec2 texCoord;
+void main()
+{
+ gl_FragColor = textureCube(tex, normalize(vec3(texCoord, 1)));
+}
+</script>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+function shouldBePowerOfTwo(n, name) {
+ var power = Math.round(Math.log(n) / Math.log(2));
+ if (Math.pow(2, power) == n) {
+ testPassed(name + ' is a power of two.');
+ } else {
+ testFailed(name + ' should be a power of two, but was ' + n);
+ }
+}
+
+// Note: It seems like a reasonable assuption that a 1xN texture size should
+// work. Even 1 by 128k is only 512k
+var maxSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
+debug("advertised max size: " + maxSize);
+debug("verifying max size is power-of-two (implied by GLES 2.0 section 3.7.1)");
+shouldBePowerOfTwo(maxSize, 'Max size');
+var testSize = Math.min(maxSize, 128 * 1024);
+var pixels = new Uint8Array(testSize * 4);
+for (var ii = 0; ii < testSize; ++ii) {
+ var off = ii * 4;
+ pixels[off + 0] = 0;
+ pixels[off + 1] = 255;
+ pixels[off + 2] = 128;
+ pixels[off + 3] = 255;
+}
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+
+debug("test " + testSize + "x1");
+gl.texImage2D(
+ gl.TEXTURE_2D, 0, gl.RGBA, testSize, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ pixels);
+gl.generateMipmap(gl.TEXTURE_2D);
+
+wtu.clearAndDrawUnitQuad(gl);
+wtu.checkCanvas(gl, [0, 255, 128, 255],
+ "Should be 0, 255, 128, 255");
+debug("test 1x" + testSize);
+gl.texImage2D(
+ gl.TEXTURE_2D, 0, gl.RGBA, 1, testSize, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ pixels);
+gl.generateMipmap(gl.TEXTURE_2D);
+
+wtu.clearAndDrawUnitQuad(gl);
+wtu.checkCanvas(gl, [0, 255, 128, 255],
+ "Should be 0, 255, 128, 255");
+
+var program = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition', 'texCoord0'], [0, 1]);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+
+// NOTE: We can't easily test cube maps because they require width == height
+// and we might not have enough memory for maxSize by maxSize texture.
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html
new file mode 100644
index 0000000000..368130306c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-attribs.html
@@ -0,0 +1,86 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL the minimum number of attributes are supported.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec4 v0;
+attribute vec4 v1;
+attribute vec4 v2;
+attribute vec4 v3;
+attribute vec4 v4;
+attribute vec4 v5;
+attribute vec4 v6;
+varying vec4 color;
+void main()
+{
+ gl_Position = vPosition;
+ color = v0 + v1 + v2 + v3 + v4 + v5 + v6;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+var program = wtu.setupProgram(
+ gl,
+ ['vshader', 'fshader'],
+ ['vPosition', 'v0', 'v1', 'v2', 'v3', 'v4', 'v5', 'v6'],
+ [0, 1, 2, 3, 4, 5, 6, 7]);
+
+for (var ii = 0; ii < 7; ++ii) {
+ var v = (ii + 1) / 28;
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ v, v/2, v/4, v/8,
+ v, v/2, v/4, v/8,
+ v, v/2, v/4, v/8,
+ v, v/2, v/4, v/8,
+ v, v/2, v/4, v/8,
+ v, v/2, v/4, v/8]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(ii + 1);
+ gl.vertexAttribPointer(ii + 1, 4, gl.FLOAT, false, 0, 0);
+}
+
+wtu.clearAndDrawUnitQuad(gl);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.checkCanvasRect(gl, 0, 0, gl.canvas.width, gl.canvas.height, [255, 127, 64, 32], "Should render 255,127,64,32 (+/-1)", 1);
+
+var successfullyParsed = true;
+
+</script>
+</body>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html
new file mode 100644
index 0000000000..33b9f1f94c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-textures.html
@@ -0,0 +1,81 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL the minimum number of uniforms are supported.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+#define NUM_TEXTURES 8 // See spec
+precision mediump float;
+uniform sampler2D uni[NUM_TEXTURES];
+void main()
+{
+ vec4 c = vec4(0,0,0,0);
+ // The loop was manually unrolled in order to verify that this works.
+ // A separate test sampler-array-using-loop-index.html checks that
+ // loops indexing sampler arrays still work.
+ c += texture2D(uni[0], vec2(0.5, 0.5));
+ c += texture2D(uni[1], vec2(0.5, 0.5));
+ c += texture2D(uni[2], vec2(0.5, 0.5));
+ c += texture2D(uni[3], vec2(0.5, 0.5));
+ c += texture2D(uni[4], vec2(0.5, 0.5));
+ c += texture2D(uni[5], vec2(0.5, 0.5));
+ c += texture2D(uni[6], vec2(0.5, 0.5));
+ c += texture2D(uni[7], vec2(0.5, 0.5));
+ gl_FragColor = c;
+}
+</script>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+//------------------------------------------------------------------------------
+var program = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition'], [0]);
+
+for (var ii = 0; ii < 8; ++ii) {
+ var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
+ gl.activeTexture(gl.TEXTURE0 + ii);
+ var tex = gl.createTexture();
+ wtu.fillTexture(gl, tex, 1, 1, [32, 16, 8, ii * 9], 0);
+ gl.uniform1i(loc, ii);
+}
+
+wtu.clearAndDrawUnitQuad(gl);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.checkCanvas(gl, [255, 128, 64, 252],
+ "Should render using all texture units", 1);
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html
new file mode 100644
index 0000000000..e4a1bf7ea4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/limits/gl-min-uniforms.html
@@ -0,0 +1,105 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL the minimum number of uniforms are supported.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+#define NUM_UNIFORMS 128 // See spec
+attribute vec4 vPosition;
+uniform vec4 uni[NUM_UNIFORMS];
+varying vec4 color;
+void main()
+{
+ gl_Position = vPosition;
+ vec4 c = vec4(0,0,0,0);
+ for (int ii = 0; ii < NUM_UNIFORMS; ++ii) {
+ c += uni[ii];
+ }
+ color = c;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+<script id="vshader2" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader2" type="x-shader/x-fragment">
+precision mediump float;
+#define NUM_UNIFORMS 16 // See spec
+uniform vec4 uni[NUM_UNIFORMS];
+void main()
+{
+ vec4 c = vec4(0,0,0,0);
+ for (int ii = 0; ii < NUM_UNIFORMS; ++ii) {
+ c += uni[ii];
+ }
+ gl_FragColor = vec4(c.r, c.g, c.b, c.a / 120.0);
+}
+</script>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+//------------------------------------------------------------------------------
+var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['vPosition'], [0]);
+
+for (var ii = 0; ii < 128; ++ii) {
+ var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
+ gl.uniform4f(loc, 2/256, 2/512, 2/1024, ii/8128);
+}
+
+wtu.clearAndDrawUnitQuad(gl);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.checkCanvasRect(gl, 0, 0, gl.canvas.width, gl.canvas.height, [255, 127, 64, 255], "Should render 255,127,64,32 (+/-1)", 1);
+
+//------------------------------------------------------------------------------
+var program = wtu.setupProgram(gl, ['vshader2', 'fshader2'], ['vPosition'], [0]);
+
+for (var ii = 0; ii < 16; ++ii) {
+ var loc = gl.getUniformLocation(program, "uni[" + ii + "]");
+ gl.uniform4f(loc, 16/2048, 16/1024, 16/512, ii);
+}
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.clearAndDrawUnitQuad(gl);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.checkCanvasRect(gl, 0, 0, gl.canvas.width, gl.canvas.height, [32, 64, 127, 255], "Should render 32,64,127,255 (+/-1)", 1);
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html
new file mode 100644
index 0000000000..d36e9877ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/angle-instanced-arrays-state-leakage.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that ANGLE_instanced_arrays state does not leak to browser</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<style>
+canvas {
+ border: 1px solid black;
+}
+.correct {
+ border: 1px solid black;
+ background-color: #00ff00;
+}
+</style>
+</head>
+<body>
+<pre>
+This test must be run manually.
+
+This test tests that leaving state for ANGLE_instanced_arrays with non-default values at the
+end of rendering does not interfere with proper compositing of results.
+Failures seen on Linux and Mac with Chrome 32.
+See http://crbug.com/304927 for more info.
+
+You should see a <span class="correct">green rectangle</span>
+with black a outline on success. Briefly flashing red is normal.
+</pre>
+<canvas id='c'></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var c = document.getElementById("c");
+// The bug has only been seen with preserveDrawingBuffer=true.
+var gl = wtu.create3DContext(c, { preserveDrawingBuffer: true });
+var ext = wtu.getExtensionWithKnownPrefixes(gl, "ANGLE_instanced_arrays");
+var frame = 0;
+function render() {
+ var RED_FRAMES = 3;
+ if (frame < RED_FRAMES) {
+ // Draw N frames red, leaving the vertex divisor to 0 after each call.
+ gl.clearColor(1,0,0,1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.requestAnimFrame(render);
+ } else {
+ // Draw 2 more times in green, setting the divisor to 1 afterward.
+ gl.clearColor(0,1,0,1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ if (frame - RED_FRAMES < 2) {
+ wtu.requestAnimFrame(render);
+ } else {
+ finishTest();
+ }
+ // Leave attrib 0 set with a divisor of 1 before returning to browser.
+ if (ext) {
+ ext.vertexAttribDivisorANGLE(0, 1);
+ }
+ }
+ frame++;
+}
+
+if (!ext) {
+ testPassed("No ANGLE_instanced_arrays support -- this is legal");
+}
+wtu.requestAnimFrame(render);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html
new file mode 100644
index 0000000000..c18c8ab96e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-clear-on-zero-count-draw.html
@@ -0,0 +1,90 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that the canvas is NOT recomposited after unsucessful draw call</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<style>
+canvas {
+ border: 1px solid black;
+}
+.correct {
+ border: 1px solid black;
+ background-color: #ffffff;
+}
+</style>
+</head>
+<body>
+<pre>
+This test must be run manually.
+
+This test tests that a canvas is cleared
+even when a draw call has a zero count.
+
+You should see three <span class="correct">white rectangles</span>
+with black outlines on success.
+</pre>
+<canvas id='c1'></canvas>
+<canvas id='c2'></canvas>
+<canvas id='c3'></canvas>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+void main() {
+ gl_Position = vec4(0,0,0,1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ discard;
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var c1 = document.getElementById("c1");
+var c2 = document.getElementById("c2");
+var c3 = document.getElementById("c2");
+var gl1 = wtu.create3DContext(c1);
+var gl2 = wtu.create3DContext(c2);
+var gl3 = wtu.create3DContext(c2);
+gl1.clearColor(0,1,0,1);
+gl1.clear(gl1.COLOR_BUFFER_BIT);
+gl2.clearColor(0,1,0,1);
+gl2.clear(gl2.COLOR_BUFFER_BIT);
+gl3.clearColor(0,1,0,1);
+gl3.clear(gl2.COLOR_BUFFER_BIT);
+
+wtu.waitForComposite(function() {
+ // test drawArrays
+ gl1.drawArrays(gl1.TRIANGLES, 0, 0);
+ wtu.glErrorShouldBe(gl1, gl1.NO_ERROR, "no errors");
+});
+
+wtu.waitForComposite(function() {
+ // test drawElements
+ var buf = gl2.createBuffer();
+ gl2.bindBuffer(gl2.ELEMENT_ARRAY_BUFFER, buf);
+ gl2.bufferData(gl2.ELEMENT_ARRAY_BUFFER, new Uint8Array(1), gl2.STATIC_DRAW);
+ gl2.drawElements(gl2.TRIANGLES, 0, gl2.UNSIGNED_SHORT, 0);
+ wtu.glErrorShouldBe(gl2, gl2.NO_ERROR, "no errors");
+});
+
+wtu.waitForComposite(function() {
+ // test draw with program.
+ wtu.setupProgram(gl3, ["vshader", "fshader"]);
+ gl1.drawArrays(gl3.TRIANGLES, 0, 0);
+ wtu.glErrorShouldBe(gl3, gl2.NO_ERROR, "no errors");
+});
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html
new file mode 100644
index 0000000000..3cab7821c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-readpixels.html
@@ -0,0 +1,50 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that the canvas is NOT recomposited after calling readPixels</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<style>
+canvas {
+ border: 1px solid black;
+}
+.correct {
+ border: 1px solid black;
+ background-color: #00ff00;
+}
+</style>
+</head>
+<body>
+<pre>
+This test must be run manually.
+
+This test tests that a canvas is NOT cleared
+and recomposited after calling readPixels.
+
+You should see a <span class="correct">green rectangle</span>
+with black a outline on success.
+</pre>
+<canvas id='c'></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var c = document.getElementById("c");
+var gl = wtu.create3DContext(c);
+gl.clearColor(0,1,0,1);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.waitForComposite(function() {
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors");
+});
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html
new file mode 100644
index 0000000000..ba104d0774
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/canvas-no-clear-on-unsuccessful-draw.html
@@ -0,0 +1,63 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that the canvas is NOT recomposited after unsucessful draw call</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<style>
+canvas {
+ border: 1px solid black;
+}
+.correct {
+ border: 1px solid black;
+ background-color: #00ff00;
+}
+</style>
+</head>
+<body>
+<pre>
+This test must be run manually.
+
+This test tests that a canvas is NOT cleared
+when a draw call fails.
+
+You should see two <span class="correct">green rectangles</span>
+with black outlines on success.
+</pre>
+<canvas id='c1'></canvas>
+<canvas id='c2'></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var c1 = document.getElementById("c1");
+var c2 = document.getElementById("c2");
+var gl1 = wtu.create3DContext(c1);
+var gl2 = wtu.create3DContext(c2);
+gl1.clearColor(0,1,0,1);
+gl1.clear(gl1.COLOR_BUFFER_BIT);
+gl2.clearColor(0,1,0,1);
+gl2.clear(gl2.COLOR_BUFFER_BIT);
+wtu.waitForComposite(function() {
+ gl1.drawArrays(gl1.BLEND, 0, 0);
+ wtu.glErrorShouldBe(gl1, gl1.INVALID_ENUM, "no errors");
+});
+
+wtu.waitForComposite(function() {
+ var buf = gl2.createBuffer();
+ gl2.bindBuffer(gl2.ELEMENT_ARRAY_BUFFER, buf);
+ gl2.bufferData(gl2.ELEMENT_ARRAY_BUFFER, new Uint8Array(1), gl2.STATIC_DRAW);
+ gl2.drawElements(gl2.BLEND, 0, gl2.UNSIGNED_SHORT, 0);
+ wtu.glErrorShouldBe(gl2, gl2.INVALID_ENUM, "no errors");
+});
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html b/dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html
new file mode 100644
index 0000000000..f5b6fe8d19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/manual/framebuffers-keep-contents-exiting-fullscreen-mode.html
@@ -0,0 +1,134 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that framebuffers keep contents exiting fullscreen mode.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<style>
+canvas {
+ width: 100%;
+ height: 50px;
+ border: 1px solid black;
+}
+#f {
+ left: 0px;
+ top: 0px;
+}
+#inner {
+}
+input.button {
+ font-size: 36pt;
+}
+.redbox {
+ border: 1px solid black;
+ background-color: red;
+}
+#canvasholder {
+ position: relative;
+}
+#clabel {
+ position: absolute;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ font-size: 40px;
+ z-index: 10;
+ text-align: center;
+}
+</style>
+</head>
+<body>
+<pre>
+This test must be run manually.
+
+Checks that framebuffers keep their contents going into and out of fullscreen mode.
+
+Through the entire test you should see a <span class="redbox">red rectangle</span>. If it is not <span class="redbox">red</span> in all cases the test has failed.
+</pre>
+<div id="f">
+ <div id="inner">
+ <div id="buttonHolder">
+ <div><input id="button" class="button" type="button" value="Click this button to continue the test"/></div>
+ <div id="canvasholder">
+ <canvas id='c'></canvas>
+ <div id='clabel'>
+ should be red
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var testedFullScreen = false;
+var c = document.getElementById("c");
+var button = document.getElementById("button");
+var buttonHolder = document.getElementById("buttonHolder");
+var gl = wtu.create3DContext(c);
+if (!gl) {
+ testFailed("can't init WebGL");
+}
+
+var checkState = function() {
+ debug("");
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 255, 0, 255]);
+ shouldBeNonNull("gl.getParameter(gl.FRAMEBUFFER_BINDING)");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+var checkFramebufferState = function(fullscreen) {
+ checkState();
+
+ debug("fullscreen:" + fullscreen);
+
+ if (fullscreen) {
+ // Not sure if this is needed but need to make sure
+ // we at least went fullscreen once.
+ testedFullScreen = true;
+ } else {
+ if (testedFullScreen) {
+ finishTest();
+ }
+ }
+};
+
+var test = function() {
+ if (!wtu.setupFullscreen("button", "f", checkFramebufferState)) {
+ testPassed("Browser does not support fullscreen mode. This is OK");
+ finishTest();
+ return;
+ }
+
+ var fb = gl.createFramebuffer();
+ var tex = gl.createTexture();
+
+ gl.clearColor(1,0,0,1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ checkState();
+};
+test();
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt
new file mode 100644
index 0000000000..3cbdf888f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/00_test_list.txt
@@ -0,0 +1,17 @@
+bad-arguments-test.html
+--min-version 1.0.2 boolean-argument-conversion.html
+--min-version 1.0.2 delayed-drawing.html
+error-reporting.html
+--min-version 1.0.4 expando-loss.html
+functions-returning-strings.html
+--min-version 1.0.4 hint.html
+--max-version 1.9.9 instanceof-test.html
+invalid-passed-params.html
+is-object.html
+null-object-behaviour.html
+object-deletion-behaviour.html
+shader-precision-format.html
+type-conversion-test.html
+uninitialized-test.html
+webgl-specific.html
+--min-version 1.0.4 webgl-specific-stencil-settings.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html
new file mode 100644
index 0000000000..2ae7d91bf3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/bad-arguments-test.html
@@ -0,0 +1,100 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description("Tests calling WebGL APIs with wrong argument types");
+
+
+var testArguments = [
+ { value: "foo",
+ throwsForNullables: true },
+ { value: 0,
+ throwsForNullables: true },
+ { value: null,
+ throwsForNullables: false },
+ { value: undefined,
+ throwsForNullables: false }
+];
+
+var argument;
+
+var context = wtu.create3DContext();
+var program;
+var shader;
+var loc;
+wtu.loadStandardProgramAsync(context, function(success, prog) {
+ program = prog;
+ wtu.loadStandardVertexShaderAsync(context, function(success, s) {
+ shader = s;
+
+ assertMsg(program != null, "Program Compiled");
+ assertMsg(shader != null, "Shader Compiled");
+
+ loc = context.getUniformLocation(program, "u_modelViewProjMatrix");
+ assertMsg(loc != null, "getUniformLocation succeeded");
+
+ for (var i = 0; i < testArguments.length; ++i) {
+ argument = testArguments[i].value;
+
+ debug('Testing argument: ' + argument);
+
+ // These functions don't accept nullable arguments any more.
+ shouldThrow("context.compileShader(argument)");
+ shouldThrow("context.linkProgram(argument)");
+ shouldThrow("context.attachShader(program, argument)");
+ shouldThrow("context.attachShader(argument, shader)");
+ shouldThrow("context.detachShader(program, argument)");
+ shouldThrow("context.detachShader(argument, shader)");
+ shouldThrow("context.shaderSource(argument, 'foo')");
+ shouldThrow("context.bindAttribLocation(argument, 0, 'foo')");
+ shouldThrow("context.getProgramInfoLog(argument)");
+ shouldThrow("context.getProgramParameter(argument, 0)");
+ shouldThrow("context.getShaderInfoLog(argument)");
+ shouldThrow("context.getShaderParameter(argument, 0)");
+ shouldThrow("context.getShaderSource(argument)");
+ shouldThrow("context.getUniform(argument, loc)");
+ shouldThrow("context.getUniform(program, argument)");
+ shouldThrow("context.getUniformLocation(argument, 'u_modelViewProjMatrix')");
+
+ // The following entry points still accept nullable arguments.
+ var func;
+ if (testArguments[i].throwsForNullables) {
+ func = shouldThrow;
+ } else {
+ func = shouldBeUndefined;
+ }
+
+ func("context.bindBuffer(context.ARRAY_BUFFER, argument)");
+ func("context.bindFramebuffer(context.FRAMEBUFFER, argument)");
+ func("context.bindRenderbuffer(context.RENDERBUFFER, argument)");
+ func("context.bindTexture(context.TEXTURE_2D, argument)");
+ func("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, argument)");
+ func("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, argument, 0)");
+ func("context.uniform2fv(argument, new Float32Array([0.0, 0.0]))");
+ func("context.uniform2iv(argument, new Int32Array([0, 0]))");
+ func("context.uniformMatrix2fv(argument, false, new Float32Array([0.0, 0.0, 0.0, 0.0]))");
+ func("context.useProgram(argument)");
+ }
+ finishTest();
+ });
+});
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html
new file mode 100644
index 0000000000..1423673bda
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/boolean-argument-conversion.html
@@ -0,0 +1,115 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/test-eval.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description("Test that conversion of boolean arguments of WebGL functions follows EcmaScript 9.2. ToBoolean");
+debug("");
+debug("When an object is converted to a boolean, it should always evaluate as true. Any valueOf() method should not even get called. See Mozilla bug 727590 where Gecko incorrectly converted such an argument to a Number instead of a Boolean, giving the wrong behavior. See 9.2 and 9.3 in the EcmaScript specification.");
+debug("");
+var gl = wtu.create3DContext();
+var program = wtu.loadStandardProgram(gl);
+var shader = wtu.loadStandardVertexShader(gl);
+var shouldGenerateGLError = wtu.shouldGenerateGLError;
+
+assertMsg(program != null, "Program Compiled");
+assertMsg(shader != null, "Shader Compiled");
+
+var uloc = gl.getUniformLocation(program, "u_modelViewProjMatrix");
+var aloc = gl.getAttribLocation(program, "a_vertex");
+
+gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from initialization.");
+assertMsg(uloc, "Uniform not found");
+assertMsg(aloc >= 0, "Attribute not found");
+
+var boolArg = { valueOf: function() { throw "Converting an Object to a Boolean should just give 'true' without further evaluation"; } }
+
+function shouldNotThrowWithBoolArgs(code) {
+ try {
+ TestEval(code);
+ } catch(e) {
+ testFailed(code + " threw exception: " + e);
+ return;
+ }
+ testPassed(code + " converted its boolean arguments correctly");
+}
+
+shouldNotThrowWithBoolArgs(
+ "gl.colorMask(boolArg, boolArg, boolArg, boolArg)"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.depthMask(boolArg)"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.sampleCoverage(1, boolArg)"
+);
+
+function zeroArray(length) {
+ var a = new Array(length);
+ for (var i = 0; i < length; i++)
+ a[i] = 0;
+ return a;
+}
+
+function zeroFloat32Array(length) {
+ var a = new Float32Array(length);
+ for (var i = 0; i < length; i++)
+ a[i] = 0;
+ return a;
+}
+
+shouldNotThrowWithBoolArgs(
+ "gl.uniformMatrix2fv(uloc, boolArg, zeroFloat32Array(4))"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.uniformMatrix2fv(uloc, boolArg, zeroArray(4))"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.uniformMatrix3fv(uloc, boolArg, zeroFloat32Array(9))"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.uniformMatrix3fv(uloc, boolArg, zeroArray(9))"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.uniformMatrix4fv(uloc, boolArg, zeroFloat32Array(16))"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.uniformMatrix4fv(uloc, boolArg, zeroArray(16))"
+);
+
+shouldNotThrowWithBoolArgs(
+ "gl.vertexAttribPointer(aloc, 4, gl.FLOAT, boolArg, 4, 0)"
+);
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html
new file mode 100644
index 0000000000..4dc9ea8f3a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/delayed-drawing.html
@@ -0,0 +1,64 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Delayed Drawing 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>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+enableJSTestPreVerboseLogging();
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+var tex = gl.createTexture();
+wtu.fillTexture(gl, tex, 5, 3, [0, 192, 128, 255]);
+
+var loc = gl.getUniformLocation(program, "tex");
+gl.uniform1i(loc, 0);
+
+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);
+
+
+drawAndCheck();
+
+setTimeout(step2, 1000);
+
+function step2() {
+ drawAndCheck();
+ finishTest();
+}
+
+function drawAndCheck() {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors before drawing.");
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from drawing.");
+ wtu.checkCanvas(
+ gl, [0, 192, 128, 255],
+ "draw should be 0, 192, 128, 255");
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html
new file mode 100644
index 0000000000..bfba0abc86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/error-reporting.html
@@ -0,0 +1,75 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Tests generation of synthetic and real GL errors");
+
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+
+// Other tests like incorrect-context-object-behaviour already test the raising
+// of many synthetic GL errors. This test verifies the raising of certain
+// known real GL errors, and contains a few regression tests for bugs
+// discovered in the synthetic error generation and in the WebGL
+// implementation itself.
+
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+
+debug("Testing getActiveAttrib");
+shouldThrow("context.getActiveAttrib(null, 2)");
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+// Error state should be clear by this point
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+// Real OpenGL error
+shouldBeNull("context.getActiveAttrib(program, 2)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+// Error state should be clear by this point
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+
+debug("Testing getActiveUniform");
+shouldThrow("context.getActiveUniform(null, 0)");
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+// Error state should be clear by this point
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+// Real OpenGL error
+shouldBeNull("context.getActiveUniform(program, 50)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+// Error state should be clear by this point
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+
+debug("Testing attempts to manipulate the default framebuffer");
+shouldBeUndefined("context.bindFramebuffer(context.FRAMEBUFFER, null)");
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+shouldBeUndefined("context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, null)");
+// Synthetic OpenGL error
+wtu.glErrorShouldBe(context, context.INVALID_OPERATION);
+// Error state should be clear by this point
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+shouldBeUndefined("context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, null, 0)");
+// Synthetic OpenGL error
+wtu.glErrorShouldBe(context, context.INVALID_OPERATION);
+// Error state should be clear by this point
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html
new file mode 100644
index 0000000000..9e1f041f02
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/expando-loss.html
@@ -0,0 +1,223 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>WebGL Object Expandos Conformance Test</title>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="8" height="8" style="width: 8px; height: 8px;"></canvas>
+<script>
+"use strict";
+description("This test verifies that WebGL object expandos are preserved across garbage collections.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+
+// Helpers that set expandos and verify they are set to the correct value.
+var expandoValue = "WebGL is awesome!"
+function setTestExpandos(instance) {
+ instance.expando1 = expandoValue;
+ instance.expando2 = { subvalue : expandoValue };
+}
+function verifyTestExpandos(instance, msg) {
+ assertMsg(instance.expando1 === expandoValue, msg + ": Expect basic expando to survive despite GC.");
+ assertMsg(instance.expando2 && instance.expando2.subvalue === expandoValue, msg + ": Expect subobject expando to survive despite GC.");
+}
+
+// Tests that we don't get expando loss for bound resources where the
+// only remaining reference is internal to WebGL
+function testBasicBindings() {
+ debug('Basic Bindings');
+
+ // Test data that describes how to create, bind, and retrieve an object off of the context
+ var glProt = Object.getPrototypeOf(gl);
+ var simpleData = [
+ {
+ creationFn: glProt.createTexture,
+ bindFn: glProt.bindTexture,
+ bindConstant: glProt.TEXTURE_2D,
+ retrieveConstant: glProt.TEXTURE_BINDING_2D,
+ name: "TEXTURE_BINDING_2D",
+ },
+ {
+ creationFn: glProt.createFramebuffer,
+ bindFn: glProt.bindFramebuffer,
+ bindConstant: glProt.FRAMEBUFFER,
+ retrieveConstant: glProt.FRAMEBUFFER_BINDING,
+ name: "FRAMEBUFFER_BINDING",
+ },
+ {
+ creationFn: glProt.createRenderbuffer,
+ bindFn: glProt.bindRenderbuffer,
+ bindConstant: glProt.RENDERBUFFER,
+ retrieveConstant: glProt.RENDERBUFFER_BINDING,
+ name: "RENDERBUFFER_BINDING",
+ },
+ {
+ creationFn: glProt.createBuffer,
+ bindFn: glProt.bindBuffer,
+ bindConstant: glProt.ELEMENT_ARRAY_BUFFER,
+ retrieveConstant: glProt.ELEMENT_ARRAY_BUFFER_BINDING,
+ name: "ELEMENT_ARRAY_BUFFER_BINDING",
+ },
+ {
+ creationFn: glProt.createBuffer,
+ bindFn: glProt.bindBuffer,
+ bindConstant: glProt.ARRAY_BUFFER,
+ retrieveConstant: glProt.ARRAY_BUFFER_BINDING,
+ name: "ARRAY_BUFFER_BINDING",
+ },
+ {
+ creationFn: glProt.createTexture,
+ bindFn: glProt.bindTexture,
+ bindConstant: glProt.TEXTURE_CUBE_MAP,
+ retrieveConstant: glProt.TEXTURE_BINDING_CUBE_MAP,
+ name: "TEXTURE_BINDING_CUBE_MAP",
+ },
+ ];
+
+ simpleData.forEach(function(test) {
+ var instance = test.creationFn.apply(gl, []);
+ var msg = "getParameter(" + test.name + ")";
+ setTestExpandos(instance);
+
+ test.bindFn.apply(gl, [test.bindConstant, instance]);
+ assertMsg(instance === gl.getParameter(test.retrieveConstant), msg + " returns instance that was bound.");
+
+ // Garbage collect Javascript references. Remaining references should be internal to WebGL.
+ instance = null;
+ webglHarnessCollectGarbage();
+
+ verifyTestExpandos(gl.getParameter(test.retrieveConstant), msg);
+ });
+
+ debug('');
+}
+
+// Attach a couple of shaders to a program and verify no expando loss when you call
+// getAttachedShaders and getParameter(CURRENT_PROGRAM).
+function testProgramsAndShaders() {
+ debug('Programs and Shaders');
+
+ var vs = wtu.loadShader(gl, wtu.simpleVertexShader, gl.VERTEX_SHADER);
+ setTestExpandos(vs);
+
+ var fs = wtu.loadShader(gl, wtu.simpleColorFragmentShader, gl.FRAGMENT_SHADER);
+ setTestExpandos(fs);
+
+ var program = wtu.setupProgram(gl, [vs, fs]);
+ setTestExpandos(program);
+ assertMsg(program === gl.getParameter(gl.CURRENT_PROGRAM), "getParameter(gl.CURRENT_PROGRAM) return instance set with useProgram");
+
+ var attachedShaders = gl.getAttachedShaders(program);
+ assertMsg(attachedShaders.indexOf(vs) !== -1, "Vertex shader instance found in getAttachedShaders");
+ assertMsg(attachedShaders.indexOf(fs) !== -1, "Fragment shader instance found in getAttachedShaders");
+
+ // Garbage collect Javascript references. Remaining references should be internal to WebGL.
+ attachedShaders = null;
+ program = null;
+ vs = null;
+ fs = null;
+ webglHarnessCollectGarbage();
+
+ var currentProgram = gl.getParameter(gl.CURRENT_PROGRAM);
+ verifyTestExpandos(currentProgram, "Current program");
+ shouldBeType(currentProgram, 'WebGLProgram');
+
+ var retrievedShaders = gl.getAttachedShaders(currentProgram);
+ verifyTestExpandos(retrievedShaders[0], "Shader[0]");
+ shouldBeType(retrievedShaders[0], "WebGLShader");
+ verifyTestExpandos(retrievedShaders[1], "Shader[1]");
+ shouldBeType(retrievedShaders[1], "WebGLShader");
+
+ debug('');
+}
+
+// Attach a buffer via vertexAttribPointer and verify no expando loss when you call getVertexAttrib.
+function testVertexAttributeBuffers() {
+ debug('Vertex Attribute Buffers');
+
+ var program = wtu.setupSimpleColorProgram(gl);
+ var position = gl.getAttribLocation(program, "vPosition");
+
+ var buffer = gl.createBuffer();
+ setTestExpandos(buffer);
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);
+ assertMsg(buffer === gl.getVertexAttrib(position, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),
+ "getVertexAttrib(VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) return instance set with vertexAttribPointer");
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+
+ // Garbage collect Javascript references. Remaining references should be internal to WebGL.
+ buffer = null;
+ program = null;
+ webglHarnessCollectGarbage();
+
+ var retrievedBuffer = gl.getVertexAttrib(position, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING);
+ verifyTestExpandos(retrievedBuffer, "Vertex Attribute Buffer");
+ shouldBeType(retrievedBuffer, 'WebGLBuffer');
+
+ debug('');
+}
+
+// Attach renderbuffers to framebuffers and verify no expando loss ocurrs when you call
+// getFramebufferAttachmentParameter
+function testFrameBufferAttachments() {
+ debug('FrameBuffer Attachments');
+
+ var framebuffer = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ var attachments = [
+ { enum: gl.COLOR_ATTACHMENT0, name: "COLOR_ATTACHMENT0" },
+ { enum: gl.DEPTH_ATTACHMENT, name: "DEPTH_ATTACHMENT" },
+ { enum: gl.STENCIL_ATTACHMENT, name: "STENCIL_ATTACHMENT" },
+ { enum: gl.DEPTH_STENCIL_ATTACHMENT,name: "DEPTH_STENCIL_ATTACHMENT" },
+ ];
+
+ // Attach a renderbuffer to all attachment points.
+ attachments.forEach(function(attachment) {
+ var renderbuffer = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ setTestExpandos(renderbuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment.enum, gl.RENDERBUFFER, renderbuffer);
+ assertMsg(renderbuffer === gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment.enum, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME),
+ "getFramebufferAttachmentParameter(" + attachment.name + ") returns instance set with framebufferRenderbuffer");
+ renderbuffer = null;
+ });
+
+ // Garbage collect Javascript references. Remaining references should be internal to WebGL.
+ webglHarnessCollectGarbage();
+
+ // Verify all attached renderbuffers have expandos.
+ attachments.forEach(function(attachment) {
+ var retrievedRenderbuffer = gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachment.enum, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
+ verifyTestExpandos(retrievedRenderbuffer, attachment.name);
+ shouldBeType(retrievedRenderbuffer, 'WebGLRenderbuffer');
+ });
+
+ debug('');
+}
+
+// Run tests
+testBasicBindings();
+testProgramsAndShaders();
+testVertexAttributeBuffers();
+testFrameBufferAttachments();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html
new file mode 100644
index 0000000000..15e89e46f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/functions-returning-strings.html
@@ -0,0 +1,104 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/test-eval.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("Test that functions returning strings really do return strings (and not e.g. null)");
+debug("");
+
+var validVertexShaderString =
+ "attribute vec4 aVertex; attribute vec4 aColor; varying vec4 vColor; void main() { vColor = aColor; gl_Position = aVertex; }";
+var validFragmentShaderString =
+ "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }";
+
+function shouldReturnString(_a)
+{
+ var exception;
+ var _av;
+ try {
+ _av = TestEval(_a);
+ } catch (e) {
+ exception = e;
+ }
+
+ if (exception)
+ testFailed(_a + ' should return a string. Threw exception ' + exception);
+ else if (typeof _av == "string")
+ testPassed(_a + ' returns a string');
+ else
+ testFailed(_a + ' should return a string. Returns: "' + _av + '"');
+}
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ var vs = gl.createShader(gl.VERTEX_SHADER);
+ shouldReturnString("gl.getShaderSource(vs)");
+ shouldReturnString("gl.getShaderInfoLog(vs)");
+ gl.shaderSource(vs, validVertexShaderString);
+ gl.compileShader(vs);
+ shouldReturnString("gl.getShaderSource(vs)");
+ shouldReturnString("gl.getShaderInfoLog(vs)");
+
+ var fs = gl.createShader(gl.FRAGMENT_SHADER);
+ shouldReturnString("gl.getShaderSource(fs)");
+ shouldReturnString("gl.getShaderInfoLog(fs)");
+ gl.shaderSource(fs, validFragmentShaderString);
+ gl.compileShader(fs);
+ shouldReturnString("gl.getShaderSource(fs)");
+ shouldReturnString("gl.getShaderInfoLog(fs)");
+
+ var prog = gl.createProgram();
+ shouldReturnString("gl.getProgramInfoLog(prog)");
+ gl.attachShader(prog, vs);
+ gl.attachShader(prog, fs);
+ gl.linkProgram(prog);
+ shouldReturnString("gl.getProgramInfoLog(prog)");
+
+ // Make sure different numbers of extensions doesn't result in
+ // different test output.
+ var exts = gl.getSupportedExtensions();
+ var allPassed = true;
+ for (var ii = 0; ii < exts.length; ++ii) {
+ var s = exts[ii];
+ if (typeof s != "string") {
+ shouldReturnString("gl.getSupportedExtensions()[" + s + "]");
+ allPassed = false;
+ }
+ }
+ if (allPassed) {
+ testPassed('getSupportedExtensions() returns an array of strings');
+ }
+
+ shouldReturnString("gl.getParameter(gl.VENDOR)");
+ shouldReturnString("gl.getParameter(gl.RENDERER)");
+ shouldReturnString("gl.getParameter(gl.VERSION)");
+ shouldReturnString("gl.getParameter(gl.SHADING_LANGUAGE_VERSION)");
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/hint.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/hint.html
new file mode 100644
index 0000000000..f49f2248fc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/hint.html
@@ -0,0 +1,124 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+const wtu = WebGLTestUtils;
+description("Tests webgl.hint()");
+
+const gl = wtu.create3DContext();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Setup should succeed");
+
+// From https://kdashg.github.io/misc/gl/search-headers.html#str=_HINT
+const HINT_TARGETS = {
+ GL_GENERATE_MIPMAP_HINT: 0x8192,
+ GL_FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8B8B,
+ GL_BINNING_CONTROL_HINT_QCOM: 0x8FB0,
+ GL_PROGRAM_BINARY_RETRIEVABLE_HINT: 0x8257,
+ GL_LINE_SMOOTH_HINT: 0x0C52,
+ GL_POLYGON_SMOOTH_HINT: 0x0C53,
+ EGL_PRODUCER_MAX_FRAME_HINT_NV: 0x3337,
+ EGL_CONSUMER_MAX_FRAME_HINT_NV: 0x3338,
+ EGL_YUV_COLOR_SPACE_HINT_EXT: 0x327B,
+ EGL_SAMPLE_RANGE_HINT_EXT: 0x327C,
+ EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT: 0x327D,
+ EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT: 0x327E,
+ EGL_LOCK_USAGE_HINT_KHR: 0x30C5,
+ GL_TEXTURE_COMPRESSION_HINT: 0x84EF,
+ GL_TEXTURE_STORAGE_HINT_APPLE: 0x85BC,
+ GL_TRANSFORM_HINT_APPLE: 0x85B1,
+ GL_VERTEX_ARRAY_STORAGE_HINT_APPLE: 0x851F,
+ GL_CLIP_VOLUME_CLIPPING_HINT_EXT: 0x80F0,
+ GL_PACK_CMYK_HINT_EXT: 0x800E,
+ GL_UNPACK_CMYK_HINT_EXT: 0x800F,
+ GL_MULTISAMPLE_FILTER_HINT_NV: 0x8534,
+ GL_PREFER_DOUBLEBUFFER_HINT_PGI: 0x1A1F8,
+ GL_CONSERVE_MEMORY_HINT_PGI: 0x1A1FD,
+ GL_RECLAIM_MEMORY_HINT_PGI: 0x1A1FE,
+ GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI: 0x1A203,
+ GL_NATIVE_GRAPHICS_END_HINT_PGI: 0x1A204,
+ GL_ALWAYS_FAST_HINT_PGI: 0x1A20C,
+ GL_ALWAYS_SOFT_HINT_PGI: 0x1A20D,
+ GL_ALLOW_DRAW_OBJ_HINT_PGI: 0x1A20E,
+ GL_ALLOW_DRAW_WIN_HINT_PGI: 0x1A20F,
+ GL_ALLOW_DRAW_FRG_HINT_PGI: 0x1A210,
+ GL_ALLOW_DRAW_MEM_HINT_PGI: 0x1A211,
+ GL_STRICT_DEPTHFUNC_HINT_PGI: 0x1A216,
+ GL_STRICT_LIGHTING_HINT_PGI: 0x1A217,
+ GL_STRICT_SCISSOR_HINT_PGI: 0x1A218,
+ GL_FULL_STIPPLE_HINT_PGI: 0x1A219,
+ GL_CLIP_NEAR_HINT_PGI: 0x1A220,
+ GL_CLIP_FAR_HINT_PGI: 0x1A221,
+ GL_WIDE_LINE_HINT_PGI: 0x1A222,
+ GL_BACK_NORMALS_HINT_PGI: 0x1A223,
+ GL_VERTEX_DATA_HINT_PGI: 0x1A22A,
+ GL_VERTEX_CONSISTENT_HINT_PGI: 0x1A22B,
+ GL_MATERIAL_SIDE_HINT_PGI: 0x1A22C,
+ GL_MAX_VERTEX_HINT_PGI: 0x1A22D,
+ GL_GENERATE_MIPMAP_HINT_SGIS: 0x8192,
+ GL_CONVOLUTION_HINT_SGIX: 0x8316,
+ GL_SCALEBIAS_HINT_SGIX: 0x8322,
+ GL_TEXTURE_MULTI_BUFFER_HINT_SGIX: 0x812E,
+ GL_VERTEX_PRECLIP_HINT_SGIX: 0x83EF,
+ GL_PHONG_HINT_WIN: 0x80EB,
+};
+
+async function testValidTargets(validTargets) {
+ Object.entries(HINT_TARGETS).forEach(kv => {
+ const [k,v] = kv;
+ let targetError = gl.INVALID_ENUM;
+ if (validTargets[v]) {
+ targetError = 0;
+ }
+ debug("");
+ debug(k);
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, `gl.hint(HINT_TARGETS.${k}, gl.DONT_CARE-1)`);
+ wtu.shouldGenerateGLError(gl, targetError, `gl.hint(HINT_TARGETS.${k}, gl.DONT_CARE)`);
+ wtu.shouldGenerateGLError(gl, targetError, `gl.hint(HINT_TARGETS.${k}, gl.FASTEST)`);
+ wtu.shouldGenerateGLError(gl, targetError, `gl.hint(HINT_TARGETS.${k}, gl.NICEST)`);
+ wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, `gl.hint(HINT_TARGETS.${k}, gl.NICEST+1)`);
+ });
+}
+
+(async () => {
+ const validTargets = {};
+ validTargets[HINT_TARGETS.GL_GENERATE_MIPMAP_HINT] = true;
+
+ if (gl.FRAGMENT_SHADER_DERIVATIVE_HINT) { // webgl2
+ validTargets[gl.FRAGMENT_SHADER_DERIVATIVE_HINT] = true;
+ }
+ testValidTargets(validTargets);
+
+ const ext = gl.getExtension("OES_standard_derivatives");
+ if (ext) {
+ debug("");
+ debug("");
+ debug("-----------------------------------------");
+ debug("Test with OES_standard_derivatives enabled");
+ debug("");
+ validTargets[ext.FRAGMENT_SHADER_DERIVATIVE_HINT_OES] = true;
+ testValidTargets(validTargets);
+ }
+
+ finishTest();
+})();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html
new file mode 100644
index 0000000000..aa2464e7a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/instanceof-test.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL instanceof 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>
+</head>
+<body>
+<canvas id="canvas" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../js/tests/instanceof-test.js"></script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html
new file mode 100644
index 0000000000..3f1ca805da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/invalid-passed-params.html
@@ -0,0 +1,170 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test for invalid passed parameters");
+
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext();
+var contextVersion = wtu.getDefault3DContextVersion();
+
+debug("");
+debug("Test createShader()");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.createShader(context.FRAGMENT_SHADER)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.createShader(context.VERTEX_SHADER)");
+wtu.shouldGenerateGLError(context, context.INVALID_ENUM, "context.createShader(0)");
+wtu.shouldGenerateGLError(context, context.INVALID_ENUM, "context.createShader(context.TRIANGLES)");
+
+debug("");
+debug("Test clear()");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.clear(desktopGL['ACCUM_BUFFER_BIT'])");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.clear(desktopGL['ACCUM_BUFFER_BIT'] | context.COLOR_BUFFER_BIT)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.clear(desktopGL['ACCUM_BUFFER_BIT'] | context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.clear(context.COLOR_BUFFER_BIT | context.DEPTH_BUFFER_BIT | context.STENCIL_BUFFER_BIT)");
+
+debug("");
+debug("Test {copy}Tex{Sub}Image2D with negative offset/width/height");
+var tex = context.createTexture();
+var pixels = new Uint8Array(2 * 2 * 4);
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.bindTexture(context.TEXTURE_2D, tex)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, -16, -16, 0, context.RGBA, context.UNSIGNED_BYTE, null)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 16, 16, 0, context.RGBA, context.UNSIGNED_BYTE, null)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.texSubImage2D(context.TEXTURE_2D, 0, -1, -1, 2, 2, context.RGBA, context.UNSIGNED_BYTE, pixels)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.texSubImage2D(context.TEXTURE_2D, 0, 0, 0, -1, -1, context.RGBA, context.UNSIGNED_BYTE, pixels)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.texSubImage2D(context.TEXTURE_2D, 0, 0, 0, 2, 2, context.RGBA, context.UNSIGNED_BYTE, pixels)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, -1, -1, 0)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, 16, 16, 0)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.copyTexSubImage2D(context.TEXTURE_2D, 0, -1, -1, 0, 0, 2, 2)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, -1, -1)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, 2, 2)");
+
+debug("");
+debug("Test renderbufferStorage() with negative width/height");
+var renderbuffer = context.createRenderbuffer();
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.bindRenderbuffer(context.RENDERBUFFER, renderbuffer)");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.renderbufferStorage(context.RENDERBUFFER, context.RGBA4, -2, -2)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.renderbufferStorage(context.RENDERBUFFER, context.RGBA4, 16, 16)");
+
+debug("");
+debug("Test scissor() with negative width/height");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.scissor(0, 0, -2, -2)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.scissor(0, 0, 16, 16)");
+
+debug("");
+debug("Test viewport() with negative width/height");
+wtu.shouldGenerateGLError(context, context.INVALID_VALUE, "context.viewport(0, 0, -2, -2)");
+wtu.shouldGenerateGLError(context, context.NO_ERROR, "context.viewport(0, 0, 16, 16)");
+
+debug("");
+debug("Set up a program to test invalid characters");
+var invalidSet = ['"', '$', '`', '@', '\\', "'"];
+var validUniformName = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_1234567890";
+var validAttribName = "abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
+function generateShaderSource(opt_invalidIdentifierChar, opt_invalidCommentChar) {
+ var invalidIdentifierString = "";
+ var invalidCommentString = "";
+ if (opt_invalidIdentifierChar != undefined) {
+ invalidIdentifierString += opt_invalidIdentifierChar;
+ }
+ if (opt_invalidCommentChar != undefined) {
+ invalidCommentString += opt_invalidCommentChar;
+ }
+ return "uniform float " + validUniformName + invalidIdentifierString + ";\n"
+ + "varying float " + validAttribName + ";\n"
+ + "void main() {\n"
+ + validAttribName + " = " + validUniformName + ";\n"
+ + "gl_Position = vec4(0.0, 0.0, 0.0, 1.0); }\n"
+ + "//.+-/*%<>[](){}^|&~=!:;,?# " + invalidCommentString;
+}
+var vShader = context.createShader(context.VERTEX_SHADER);
+context.shaderSource(vShader, generateShaderSource());
+context.compileShader(vShader);
+shouldBe("context.getError()", "context.NO_ERROR");
+var fShader = context.createShader(context.FRAGMENT_SHADER);
+context.shaderSource(fShader, "precision mediump float;\n"
+ + "varying float " + validAttribName + ";\n"
+ + "void main() {\n"
+ + "gl_FragColor = vec4(" + validAttribName + ", 0.0, 0.0, 1.0); }");
+context.compileShader(fShader);
+shouldBe("context.getError()", "context.NO_ERROR");
+var program = context.createProgram();
+context.attachShader(program, vShader);
+context.attachShader(program, fShader);
+context.linkProgram(program);
+var linkStatus = context.getProgramParameter(program, context.LINK_STATUS);
+shouldBeTrue("linkStatus");
+if (!linkStatus)
+ debug(context.getProgramInfoLog(program));
+shouldBe("context.getError()", "context.NO_ERROR");
+context.bindAttribLocation(program, 1, validAttribName);
+shouldBe("context.getError()", "context.NO_ERROR");
+context.getAttribLocation(program, validAttribName);
+shouldBe("context.getError()", "context.NO_ERROR");
+context.getUniformLocation(program, validUniformName);
+shouldBe("context.getError()", "context.NO_ERROR");
+
+debug("");
+debug("Test shaderSource() with invalid characters");
+for (var i = 0; i < invalidSet.length; ++i) {
+ // Backslash as line-continuation is allowed in WebGL 2.0.
+ if (contextVersion > 1 && invalidSet[i] == '\\')
+ continue;
+ // With recent specification changes from
+ // https://github.com/KhronosGroup/WebGL/pull/3206 , shaderSource no
+ // longer generates INVALID_VALUE.
+ var validShaderSource = generateShaderSource(undefined, invalidSet[i]);
+ context.shaderSource(vShader, validShaderSource);
+ shouldBe("context.getError()", "context.NO_ERROR");
+ var invalidShaderSource = generateShaderSource(invalidSet[i], undefined);
+ context.shaderSource(vShader, invalidShaderSource);
+ shouldBe("context.getError()", "context.NO_ERROR");
+}
+
+debug("");
+debug("Test bindAttribLocation() with invalid characters");
+for (var i = 0; i < invalidSet.length; ++i) {
+ var invalidName = validAttribName + invalidSet[i];
+ context.bindAttribLocation(program, 1, invalidName);
+ shouldBe("context.getError()", "context.INVALID_VALUE");
+}
+
+debug("");
+debug("Test getAttribLocation() with invalid characters");
+for (var i = 0; i < invalidSet.length; ++i) {
+ var invalidName = validAttribName + invalidSet[i];
+ context.getAttribLocation(program, invalidName);
+ shouldBe("context.getError()", "context.INVALID_VALUE");
+}
+
+debug("");
+debug("Test getUniformLocation() with invalid characters");
+for (var i = 0; i < invalidSet.length; ++i) {
+ var invalidName = validUniformName + invalidSet[i];
+ context.getUniformLocation(program, invalidName);
+ shouldBe("context.getError()", "context.INVALID_VALUE");
+}
+
+debug("")
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html
new file mode 100644
index 0000000000..f6255ae573
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/is-object.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas">
+<script>
+"use strict";
+var wtu;
+var canvas;
+var gl;
+var shouldGenerateGLError;
+
+var buffer;
+var framebuffer;
+var program;
+var renderbuffer;
+var shader;
+var texture;
+
+description("Tests 'is' calls against non-bound and deleted objects");
+
+wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+shouldGenerateGLError = wtu.shouldGenerateGLError;
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "buffer = gl.createBuffer()");
+shouldBeFalse("gl.isBuffer(buffer)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
+shouldBeTrue("gl.isBuffer(buffer)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "framebuffer = gl.createFramebuffer()");
+shouldBeFalse("gl.isFramebuffer(framebuffer)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)");
+shouldBeTrue("gl.isFramebuffer(framebuffer)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "renderbuffer = gl.createRenderbuffer()");
+shouldBeFalse("gl.isRenderbuffer(renderbuffer)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer)");
+shouldBeTrue("gl.isRenderbuffer(renderbuffer)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "texture = gl.createTexture()");
+shouldBeFalse("gl.isTexture(texture)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, texture)");
+shouldBeTrue("gl.isTexture(texture)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "program = gl.createProgram()");
+shouldBeTrue("gl.isProgram(program)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteProgram(program)");
+shouldBeFalse("gl.isProgram(program)");
+debug("");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "shader = gl.createShader(gl.VERTEX_SHADER)");
+shouldBeTrue("gl.isShader(shader)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteShader(shader)");
+shouldBeFalse("gl.isShader(shader)");
+debug("");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html
new file mode 100644
index 0000000000..a08584cf05
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/null-object-behaviour.html
@@ -0,0 +1,89 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description("Tests calling WebGL APIs without providing the necessary objects");
+
+var context = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+var shader = wtu.loadStandardVertexShader(context);
+var shouldGenerateGLError = wtu.shouldGenerateGLError;
+
+assertMsg(program != null, "Program Compiled");
+assertMsg(shader != null, "Shader Compiled");
+shouldThrow("context.compileShader(undefined)");
+shouldThrow("context.linkProgram(undefined)");
+shouldThrow("context.attachShader(undefined, undefined)");
+shouldThrow("context.attachShader(program, undefined)");
+shouldThrow("context.attachShader(undefined, shader)");
+shouldThrow("context.detachShader(program, undefined)");
+shouldThrow("context.detachShader(undefined, shader)");
+shouldThrow("context.shaderSource(undefined, undefined)");
+shouldThrow("context.shaderSource(undefined, 'foo')");
+shouldThrow("context.bindAttribLocation(undefined, 0, 'foo')");
+shouldThrow("context.bindBuffer(context.ARRAY_BUFFER, 0)");
+shouldThrow("context.bindFramebuffer(context.FRAMEBUFFER, 0)");
+shouldThrow("context.bindRenderbuffer(context.RENDERBUFFER, 0)");
+shouldThrow("context.bindTexture(context.TEXTURE_2D, 0)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindBuffer(context.ARRAY_BUFFER, null)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindFramebuffer(context.FRAMEBUFFER, null)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindRenderbuffer(context.RENDERBUFFER, null)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindTexture(context.TEXTURE_2D, null)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindBuffer(context.ARRAY_BUFFER, undefined)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindFramebuffer(context.FRAMEBUFFER, undefined)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindRenderbuffer(context.RENDERBUFFER, undefined)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.bindTexture(context.TEXTURE_2D, undefined)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.framebufferRenderbuffer(context.FRAMEBUFFER, context.DEPTH_ATTACHMENT, context.RENDERBUFFER, null)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.framebufferTexture2D(context.FRAMEBUFFER, context.COLOR_ATTACHMENT0, context.TEXTURE_2D, null, 0)");
+shouldThrow("context.getProgramParameter(undefined, 0)");
+shouldThrow("context.getProgramInfoLog(undefined, 0)");
+shouldThrow("context.getShaderParameter(undefined, 0)");
+shouldThrow("context.getShaderInfoLog(undefined, 0)");
+shouldThrow("context.getShaderSource(undefined)");
+shouldThrow("context.getUniform(undefined, null)");
+shouldThrow("context.getUniformLocation(undefined, 'foo')");
+
+debug("");
+debug("check with bindings");
+context.bindBuffer(context.ARRAY_BUFFER, context.createBuffer());
+context.bindTexture(context.TEXTURE_2D, context.createTexture());
+shouldGenerateGLError(context, context.NO_ERROR, "context.bufferData(context.ARRAY_BUFFER, 1, context.STATIC_DRAW)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.getBufferParameter(context.ARRAY_BUFFER, context.BUFFER_SIZE)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 1, 1, 0, context.RGBA, context.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]))");
+shouldGenerateGLError(context, context.NO_ERROR, "context.texParameteri(context.TEXTURE_2D, context.TEXTURE_MIN_FILTER, context.NEAREST)");
+shouldGenerateGLError(context, context.NO_ERROR, "context.getTexParameter(context.TEXTURE_2D, context.TEXTURE_MIN_FILTER)");
+
+debug("");
+debug("check without bindings");
+context.bindBuffer(context.ARRAY_BUFFER, null);
+context.bindTexture(context.TEXTURE_2D, null);
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.bufferData(context.ARRAY_BUFFER, 1, context.STATIC_DRAW)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.getBufferParameter(context.ARRAY_BUFFER, context.BUFFER_SIZE)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 1, 1, 0, context.RGBA, context.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]))");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.texParameteri(context.TEXTURE_2D, context.TEXTURE_MIN_FILTER, context.NEAREST)");
+shouldGenerateGLError(context, context.INVALID_OPERATION, "context.getTexParameter(context.TEXTURE_2D, context.TEXTURE_MIN_FILTER)");
+
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html
new file mode 100644
index 0000000000..54730ec4eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/object-deletion-behaviour.html
@@ -0,0 +1,443 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Tests deletion behavior for buffer, texture, renderbuffer, shader, and program");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var shouldGenerateGLError = wtu.shouldGenerateGLError;
+var contextVersion = wtu.getDefault3DContextVersion();
+
+debug("");
+debug("shader and program deletion");
+
+var vertexShader = wtu.loadStandardVertexShader(gl);
+assertMsg(vertexShader, "vertex shader loaded");
+var fragmentShader = wtu.loadStandardFragmentShader(gl);
+assertMsg(fragmentShader, "fragment shader loaded");
+
+var program = gl.createProgram();
+shouldBeNonNull("program");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.attachShader(program, vertexShader)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.attachShader(program, fragmentShader)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.linkProgram(program)");
+shouldBeTrue("gl.getProgramParameter(program, gl.LINK_STATUS)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.useProgram(program)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteShader(vertexShader)");
+shouldBeTrue("gl.isShader(vertexShader)");
+shouldBeTrue("gl.getShaderParameter(vertexShader, gl.DELETE_STATUS)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.detachShader(program, vertexShader)");
+shouldBeFalse("gl.isShader(vertexShader)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteShader(fragmentShader)");
+shouldBeTrue("gl.isShader(fragmentShader)");
+shouldBeTrue("gl.getShaderParameter(fragmentShader, gl.DELETE_STATUS)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteProgram(program)");
+shouldBeTrue("gl.isProgram(program)");
+shouldBeTrue("gl.getProgramParameter(program, gl.DELETE_STATUS)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.useProgram(null)");
+shouldBeFalse("gl.isProgram(program)");
+shouldBeFalse("gl.isShader(fragmentShader)");
+
+debug("");
+debug("texture deletion");
+
+var fbo = gl.createFramebuffer(), fbo2 = gl.createFramebuffer(), fbo3 = gl.createFramebuffer();
+shouldBeNonNull("fbo");
+shouldBeNonNull("fbo2");
+shouldBeNonNull("fbo3");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+
+var tex = gl.createTexture();
+shouldBeNonNull("tex");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, tex)");
+shouldBe("gl.getParameter(gl.TEXTURE_BINDING_2D)", "tex");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0)");
+shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "tex");
+shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.TEXTURE");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(tex)");
+// Deleting a texture bound to the currently-bound fbo is the same as
+// detaching the textue from fbo first, then delete the texture.
+shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+if (contextVersion > 1) {
+ shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+} else {
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+}
+shouldBeFalse("gl.isTexture(tex)");
+shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindTexture(gl.TEXTURE_2D, tex)");
+shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
+
+var texCubeMap = gl.createTexture();
+shouldBeNonNull("texCubeMap");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap)");
+shouldBe("gl.getParameter(gl.TEXTURE_BINDING_CUBE_MAP)", "texCubeMap");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(texCubeMap)");
+shouldBeFalse("gl.isTexture(texCubeMap)");
+shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_CUBE_MAP)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap)");
+shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_CUBE_MAP)");
+
+var t = gl.createTexture();
+shouldBeNonNull("t");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, t)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(t)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindTexture(gl.TEXTURE_2D, t)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)");
+
+var t2 = gl.createTexture();
+shouldBeNonNull("t2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.activeTexture(gl.TEXTURE0)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, t2)");
+shouldBe("gl.getParameter(gl.TEXTURE_BINDING_2D)", "t2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.activeTexture(gl.TEXTURE1)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, t2)");
+shouldBe("gl.getParameter(gl.TEXTURE_BINDING_2D)", "t2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(t2)");
+shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.activeTexture(gl.TEXTURE0)");
+shouldBeNull("gl.getParameter(gl.TEXTURE_BINDING_2D)");
+
+debug("");
+debug("renderbuffer deletion");
+
+var rbo = gl.createRenderbuffer(), rbo2 = gl.createRenderbuffer(), rbo3 = gl.createRenderbuffer();
+shouldBeNonNull("rbo");
+shouldBeNonNull("rbo2");
+shouldBeNonNull("rbo3");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
+shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rbo");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo)");
+shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rbo");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo)");
+// Deleting a renderbuffer bound to the currently-bound fbo is the same as
+// detaching the renderbuffer from fbo first, then delete the renderbuffer.
+shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+if (contextVersion > 1) {
+ shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+} else {
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+}
+shouldBeFalse("gl.isRenderbuffer(rbo)");
+shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
+shouldBeNull("gl.getParameter(gl.RENDERBUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo2)");
+shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rbo2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo3)");
+shouldBe("gl.getParameter(gl.RENDERBUFFER_BINDING)", "rbo2");
+
+debug("");
+debug("using deleted renderbuffer");
+rbo = gl.createRenderbuffer();
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo)");
+if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ // make backbuffer red
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(1,0,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // make fbo green
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,1,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // Bind backbuffer.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ // delete renderbuffer. It should still be attached to fbo though.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [255,0,0,255], "backbuffer should be red")');
+ // Use fbo that has deleted rbo.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [0,255,0,255], "fbo should be green")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,0,1,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [0,0,255,255], "fbo should be blue")');
+ // Bind backbuffer.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [255,0,0,255], "backbuffer should be red")');
+}
+
+debug("");
+debug("renderbuffer attached twice to same framebuffer");
+rbo = gl.createRenderbuffer();
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo)");
+if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ rbo2 = gl.createRenderbuffer();
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo2)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16)");
+ // attach rbo2 at two attachment points incompatible with it
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, rbo2)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo2)");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rbo2");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rbo2");
+ // fbo can't be complete as rbo2 is attached at incompatible attachment points
+ shouldNotBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ // now we delete rbo2, which detaches it from the two attachment points where it currently is attached
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo2)");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+ // we should now be in the same state as before with only rbo attached, so fbo should be complete again
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rbo");
+}
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+
+
+
+debug("");
+debug("using deleted texture");
+tex = gl.createTexture();
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, tex)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null)");
+if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ // make fbo green
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,1,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // Bind backbuffer.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ // delete texture. It should still be attached to fbo though.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(tex)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255,0,0,255], "backbuffer should be red")');
+ // Use fbo that has deleted texture.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0,255,0,255], "fbo should be green")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,0,1,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0,0,255,255], "fbo should be blue")');
+ // Bind backbuffer.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [255,0,0,255], "backbuffer should be red")');
+}
+
+debug("");
+debug("using deleted renderbuffer");
+rbo = gl.createRenderbuffer();
+shouldBeNonNull("rbo");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo)");
+if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo)");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ // make backbuffer red
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(1,0,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // make fbo green
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,1,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // delete renderbuffer. It should still be attached to fbo2 though.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteRenderbuffer(rbo)");
+ // fbo has no attachments
+ shouldNotBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ // Use fbo2 that has deleted rbo.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [0,255,0,255], "fbo should be green")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,0,1,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [0,0,255,255], "fbo should be blue")');
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "rbo");
+
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ if (contextVersion > 1) {
+ shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+ } else {
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+ }
+ shouldGenerateGLError(gl, gl.NONE, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)");
+ shouldNotBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ // Bind backbuffer.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [255,0,0,255], "backbuffer should be red")');
+}
+
+debug("");
+debug("using deleted texture");
+tex = gl.createTexture();
+shouldBeNonNull("tex");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindTexture(gl.TEXTURE_2D, tex)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null)");
+if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0)");
+ // make fbo green
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,1,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // delete texture. It should still be attached to fbo2 though.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteTexture(tex)");
+ // fbo has no attachments
+ shouldNotBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ // Use fbo that has deleted texture.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2)");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0,255,0,255], "fbo should be green")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,0,1,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0,0,255,255], "fbo should be blue")');
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)", "tex");
+
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ if (contextVersion > 1) {
+ shouldBeNull("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+ } else {
+ shouldGenerateGLError(gl, gl.INVALID_ENUM, "gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME)");
+ }
+ shouldNotBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ // Bind backbuffer.
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [255,0,0,255], "backbuffer should be red")');
+}
+
+debug("");
+debug("buffer deletion");
+
+var buffer = gl.createBuffer();
+shouldBeNonNull("buffer");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
+shouldBe("gl.getParameter(gl.ARRAY_BUFFER_BINDING)", "buffer");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(buffer)");
+shouldBeFalse("gl.isBuffer(buffer)");
+shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer)");
+shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
+
+var buffer2 = gl.createBuffer();
+shouldBeNonNull("buffer2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer2)");
+shouldBe("gl.getParameter(gl.ARRAY_BUFFER_BINDING)", "buffer2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, null)");
+shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(buffer2)");
+shouldBeFalse("gl.isBuffer(buffer2)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ARRAY_BUFFER, buffer2)");
+shouldBeNull("gl.getParameter(gl.ARRAY_BUFFER_BINDING)");
+
+var bufferElement = gl.createBuffer();
+shouldBeNonNull("bufferElement");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferElement)");
+shouldBe("gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING)", "bufferElement");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(bufferElement)");
+shouldBeFalse("gl.isBuffer(bufferElement)");
+shouldBeNull("gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferElement)");
+shouldBeNull("gl.getParameter(gl.ELEMENT_ARRAY_BUFFER_BINDING)");
+
+var b = gl.createBuffer();
+shouldBeNonNull("b");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, b)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(b)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindBuffer(gl.ARRAY_BUFFER, b)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW)");
+
+var b1 = gl.createBuffer();
+shouldBeNonNull("b1");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, b1);");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.enableVertexAttribArray(1);");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.vertexAttribPointer(1, 4, gl.FLOAT, false, 0, 0);");
+var b2 = gl.createBuffer();
+shouldBeNonNull("b2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindBuffer(gl.ARRAY_BUFFER, b2);");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.enableVertexAttribArray(2);");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.vertexAttribPointer(2, 4, gl.FLOAT, false, 0, 0);");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.enableVertexAttribArray(3);");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.vertexAttribPointer(3, 4, gl.FLOAT, false, 0, 0);");
+shouldBe("gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)", "b1");
+shouldBe("gl.getVertexAttrib(2, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)", "b2");
+shouldBe("gl.getVertexAttrib(3, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)", "b2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(b2);");
+shouldBe("gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)", "b1");
+shouldBeNull("gl.getVertexAttrib(2, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)");
+shouldBeNull("gl.getVertexAttrib(3, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteBuffer(b1);");
+shouldBeNull("gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)");
+
+debug("");
+debug("framebuffer deletion");
+
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldBe("gl.getParameter(gl.FRAMEBUFFER_BINDING)", "fbo");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteFramebuffer(fbo)");
+shouldBeFalse("gl.isFramebuffer(fbo)");
+shouldBeNull("gl.getParameter(gl.FRAMEBUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldBeNull("gl.getParameter(gl.FRAMEBUFFER_BINDING)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2)");
+shouldBe("gl.getParameter(gl.FRAMEBUFFER_BINDING)", "fbo2");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteFramebuffer(fbo3)");
+shouldBe("gl.getParameter(gl.FRAMEBUFFER_BINDING)", "fbo2");
+
+fbo = gl.createFramebuffer();
+rbo = gl.createRenderbuffer();
+shouldBeNonNull("fbo");
+shouldBeNonNull("rbo");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindRenderbuffer(gl.RENDERBUFFER, rbo)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16)");
+shouldGenerateGLError(gl, gl.NO_ERROR, "gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo)");
+if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ // set backbuffer to red
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(1,0,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // set framebuffer to green
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, fbo)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,1,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ // check framebuffer
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 16, 16, [0,255,0,255], "fbo should be green")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 16, 16, 1, 1, [0,0,0,0], "outside fbo should be black")');
+ // delete framebuffer. because this was the bound fbo the backbuffer should be active now
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.deleteFramebuffer(fbo)");
+ // check backbuffer
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 300, 150, [255,0,0,255], "backbuffer should be red")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 300, 0, 300, 300, [0,0,0,0], "outside backbuffer should be black")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 150, 300, 300, [0,0,0,0], "outside backbuffer should be black")');
+ // check drawing to backbuffer
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clearColor(0,1,0,1)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.clear(gl.COLOR_BUFFER_BIT)");
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 300, 150, [0,255,0,255], "fbo should be green")');
+ shouldGenerateGLError(gl, gl.NO_ERROR, "gl.bindFramebuffer(gl.FRAMEBUFFER, null)");
+ // check again because many buggy implementations will have bound to the true backbuffer on deleteFramebuffer.
+ shouldGenerateGLError(gl, gl.NO_ERROR, 'wtu.checkCanvasRect(gl, 0, 0, 300, 150, [0,255,0,255], "fbo should be green")');
+}
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html
new file mode 100644
index 0000000000..46be2a8145
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/shader-precision-format.html
@@ -0,0 +1,340 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL shader precision format 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>
+</head>
+<body>
+<canvas id="canvas" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description(document.title);
+debug("Tests that WebGLShaderPrecisionFormat class and getShaderPrecisionFormat work.");
+debug("");
+var gl = wtu.create3DContext("canvas");
+
+function verifyShaderPrecisionFormat(shadertype, precisiontype) {
+ shouldBeTrue('gl.getShaderPrecisionFormat(' + shadertype + ', ' +
+ precisiontype + ') instanceof WebGLShaderPrecisionFormat');
+}
+
+debug("");
+debug("Test that getShaderPrecisionFormat returns a WebGLShaderPrecisionFormat object.");
+debug("");
+
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.LOW_FLOAT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.MEDIUM_FLOAT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.HIGH_FLOAT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.LOW_INT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.MEDIUM_INT');
+verifyShaderPrecisionFormat('gl.VERTEX_SHADER', 'gl.HIGH_INT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.LOW_FLOAT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.MEDIUM_FLOAT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.HIGH_FLOAT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.LOW_INT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.MEDIUM_INT');
+verifyShaderPrecisionFormat('gl.FRAGMENT_SHADER', 'gl.HIGH_INT');
+
+debug("");
+debug("Test that getShaderPrecisionFormat throws an error with invalid parameters.");
+debug("");
+
+wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM, 'gl.getShaderPrecisionFormat(gl.HIGH_INT, gl.VERTEX_SHADER)');
+
+debug("");
+debug("Test that WebGLShaderPrecisionFormat values are sensible.");
+debug("");
+
+// The minimum values are from OpenGL ES Shading Language spec, section 4.5.
+
+var shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 1');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 1');
+shouldBeTrue('shaderPrecisionFormat.precision >= 8');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 14');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 14');
+shouldBeTrue('shaderPrecisionFormat.precision >= 10');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 62');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 62');
+shouldBeTrue('shaderPrecisionFormat.precision >= 16');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_INT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 8');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 8');
+shouldBeTrue('shaderPrecisionFormat.precision == 0');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_INT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 10');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 10');
+shouldBeTrue('shaderPrecisionFormat.precision == 0');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_INT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 16');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 16');
+shouldBeTrue('shaderPrecisionFormat.precision == 0');
+
+var shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 1');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 1');
+shouldBeTrue('shaderPrecisionFormat.precision >= 8');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 14');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 14');
+shouldBeTrue('shaderPrecisionFormat.precision >= 10');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 8');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 8');
+shouldBeTrue('shaderPrecisionFormat.precision == 0');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin >= 10');
+shouldBeTrue('shaderPrecisionFormat.rangeMax >= 10');
+shouldBeTrue('shaderPrecisionFormat.precision == 0');
+
+debug("");
+debug("Test optional highp support in fragment shaders.");
+debug("");
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);
+shouldBeTrue('(shaderPrecisionFormat.rangeMin == 0 && shaderPrecisionFormat.rangeMax == 0 && shaderPrecisionFormat.precision == 0) || (shaderPrecisionFormat.rangeMin >= 62 && shaderPrecisionFormat.rangeMax >= 62 && shaderPrecisionFormat.precision >= 16)');
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT);
+shouldBeTrue('(shaderPrecisionFormat.rangeMin == 0 && shaderPrecisionFormat.rangeMax == 0 && shaderPrecisionFormat.precision == 0) || (shaderPrecisionFormat.rangeMin >= 16 && shaderPrecisionFormat.rangeMax >= 16 && shaderPrecisionFormat.precision == 0)');
+
+debug("");
+debug("Test that getShaderPrecisionFormat returns the same thing every call.");
+debug("");
+
+shaderPrecisionFormat = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT);
+var shaderPrecisionFormat2 = gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.LOW_FLOAT);
+shouldBeTrue('shaderPrecisionFormat.rangeMin == shaderPrecisionFormat2.rangeMin');
+shouldBeTrue('shaderPrecisionFormat.rangeMax == shaderPrecisionFormat2.rangeMax');
+shouldBeTrue('shaderPrecisionFormat.precision == shaderPrecisionFormat2.precision');
+
+debug("");
+debug("Test that specified precision matches rendering results");
+debug("");
+
+function testRenderPrecisionSetup(gl, shaderPair) {
+ const program = wtu.setupProgram(gl, shaderPair);
+
+ // Create a buffer and setup an attribute.
+ // We wouldn't need this except for a bug in Safari and arguably
+ // this should be removed from the test but we can't test the test itself
+ // without until the bug is fixed.
+ // see https://bugs.webkit.org/show_bug.cgi?id=197592
+ {
+ gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
+ gl.bufferData(gl.ARRAY_BUFFER, 1, gl.STATIC_DRAW);
+ const loc = gl.getAttribLocation(program, 'position');
+ gl.enableVertexAttribArray(loc);
+ gl.vertexAttribPointer(loc, 1, gl.UNSIGNED_BYTE, false, 0, 0);
+ }
+
+ gl.useProgram(program);
+
+ return program;
+}
+
+function testRenderPrecision(gl, shaderType, type, precision, expected, msg) {
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.POINTS, 0, 1);
+
+ const pixel = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
+
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, expected, msg, 5);
+}
+
+function testRenderPrecisionFloat(gl, precisionEnum, precision) {
+ function test(gl, shaderPair, shaderType) {
+ const format = gl.getShaderPrecisionFormat(shaderType, precisionEnum);
+ const value = 2 ** format.precision - 1;
+
+ const length = v => Math.sqrt(v.reduce((sum, v) => sum + v * v, 0));
+ const normalize = (v) => {
+ const l = length(v);
+ return v.map(v => v / l);
+ };
+
+ const input = [Math.sqrt(value), Math.sqrt(value), Math.sqrt(value)];
+ const expected = [...normalize(input).map(v => (v * 0.5 + 0.5) * 255 | 0), 255];
+
+ const msg = `${wtu.glEnumToString(gl, shaderType)}: ${precision} float precision: ${format.precision}, rangeMin: ${format.rangeMin}, rangeMax: ${format.rangeMax}`;
+ const program = testRenderPrecisionSetup(gl, shaderPair);
+ const vLocation = gl.getUniformLocation(program, 'v');
+ gl.uniform3fv(vLocation, input);
+ testRenderPrecision(gl, shaderType, 'float', precision, expected, msg);
+ }
+
+ {
+ const vs = `
+ attribute vec4 position;
+ uniform ${precision} vec3 v;
+ varying ${precision} vec4 v_result;
+ void main() {
+ gl_Position = position;
+ gl_PointSize = 1.0;
+ v_result = vec4(normalize(v) * 0.5 + 0.5, 1);
+ }
+ `;
+
+ const fs = `
+ precision ${precision} float;
+ varying ${precision} vec4 v_result;
+ void main() {
+ gl_FragColor = v_result;
+ }
+ `;
+
+ test(gl, [vs, fs], gl.VERTEX_SHADER);
+ }
+
+ {
+ const vs = `
+ attribute vec4 position;
+ void main() {
+ gl_Position = position;
+ gl_PointSize = 1.0;
+ }
+ `;
+
+ const fs = `
+ precision ${precision} float;
+ uniform ${precision} vec3 v;
+ void main() {
+ gl_FragColor = vec4(normalize(v) * 0.5 + 0.5, 1);
+ }
+ `;
+
+ test(gl, [vs, fs], gl.FRAGMENT_SHADER);
+ }
+}
+
+function testRenderPrecisionInt(gl, precisionEnum, precision) {
+ function test(gl, shaderPair, shaderType) {
+ const format = gl.getShaderPrecisionFormat(shaderType, precisionEnum);
+ const value = 1 << (format.rangeMax - 1);
+
+ const input = [value, value, value, value];
+ const expected = [255, 255, 255, 255];
+
+ const msg = `${wtu.glEnumToString(gl, shaderType)}: ${precision} int precision: ${format.precision}, rangeMin: ${format.rangeMin}, rangeMax: ${format.rangeMax}`;
+ const program = testRenderPrecisionSetup(gl, shaderPair);
+ gl.uniform1i(gl.getUniformLocation(program, 'v'), value);
+ gl.uniform1f(gl.getUniformLocation(program, 'f'), value);
+ testRenderPrecision(gl, shaderType, 'int', precision, expected, msg);
+ }
+
+ {
+ const vs = `
+ attribute vec4 position;
+ uniform ${precision} int v;
+ uniform highp float f;
+ varying vec4 v_result;
+
+ void main() {
+ gl_Position = position;
+ gl_PointSize = 1.0;
+ float diff = abs(float(v) - f);
+ bool pass = diff < 1.0;
+ v_result = vec4(pass);
+ }
+ `;
+
+ const fs = `
+ precision mediump float;
+ varying vec4 v_result;
+ void main() {
+ gl_FragColor = v_result;
+ }
+ `;
+ test(gl, [vs, fs], gl.VERTEX_SHADER);
+ }
+
+ {
+ const vs = `
+ attribute vec4 position;
+ void main() {
+ gl_Position = position;
+ gl_PointSize = 1.0;
+ }
+ `;
+
+ const fs = `
+ precision ${precision} float;
+ uniform ${precision} int v;
+ uniform mediump float f;
+
+ void main() {
+ mediump float diff = abs(float(v) - f);
+ bool pass = diff < 1.0;
+ gl_FragColor = vec4(pass);
+ }
+ `;
+
+ test(gl, [vs, fs], gl.FRAGMENT_SHADER);
+ }
+}
+
+// because the canvas can be 16 bit IIRC
+const fb = gl.createFramebuffer(gl.FRAMEBUFFER);
+gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+
+const tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+gl.framebufferTexture2D(
+ gl.FRAMEBUFFER,
+ gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D,
+ tex,
+ 0);
+
+gl.viewport(0, 0, 1, 1);
+
+{
+ testRenderPrecisionFloat(gl, gl.LOW_FLOAT, 'lowp');
+ testRenderPrecisionFloat(gl, gl.MEDIUM_FLOAT, 'mediump');
+
+ const format = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT);
+ if (format.precision !== 0) {
+ testRenderPrecisionFloat(gl, gl.HIGH_FLOAT, 'highp');
+ }
+}
+
+{
+ testRenderPrecisionInt(gl, gl.LOW_INT, 'lowp');
+ testRenderPrecisionInt(gl, gl.MEDIUM_INT, 'mediump');
+
+ const format = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT);
+ if (format.rangeMax !== 0) {
+ testRenderPrecisionInt(gl, gl.HIGH_INT, 'highp');
+ }
+}
+
+finishTest();
+</script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html
new file mode 100644
index 0000000000..bb04f3ba00
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/type-conversion-test.html
@@ -0,0 +1,151 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description("Tests calling WebGL APIs with various types");
+
+var context = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+var shader = wtu.loadStandardVertexShader(context);
+
+assertMsg(program != null, "Program Compiled");
+assertMsg(shader != null, "Shader Compiled");
+
+var loc = context.getUniformLocation(program, "u_modelViewProjMatrix");
+assertMsg(loc != null, "getUniformLocation succeeded");
+
+var buffer = context.createBuffer();
+context.bindBuffer(context.ARRAY_BUFFER, buffer);
+var texture = context.createTexture();
+context.bindTexture(context.TEXTURE_2D, texture);
+context.useProgram(program);
+
+var args = [
+ { type: "number", value: 0 },
+ { type: "number", value: 2 },
+ { type: "string that is NaN", value: "foo", },
+ { type: "string that is number", value: "2", },
+ { type: "null", value: null },
+ { type: "Empty Array", value: [] },
+ { type: "Object", value: {} },
+ { type: "Array of Number", value: [2] },
+ { type: "Array of String", value: ["foo"] },
+ { type: "Array of String that is number", value: ["0"] },
+ { type: "Array of String that is number", value: ["2"] },
+ { type: "TypedArray", value: new Float32Array(1) }
+];
+
+var argument;
+
+for (var i = 0; i < args.length; ++i) {
+ argument = args[i].value;
+ var func1 = shouldBeUndefined;
+ var func2 = shouldBeNonNull;
+ if (argument == 2) {
+ func2 = shouldBeNull;
+ }
+ var func3 = shouldBeNull;
+ debug("");
+ debug("testing type of " + args[i].type + " : value = " + argument);
+ func1("context.bindAttribLocation(program, argument, 'foo')");
+ func1("context.blendColor(argument, argument, argument, argument)");
+ func1("context.bufferData(context.ARRAY_BUFFER, argument, context.STATIC_DRAW)");
+ func1("context.bufferData(context.ARRAY_BUFFER, new Float32Array(10), context.STATIC_DRAW)");
+ func1("context.bufferSubData(context.ARRAY_BUFFER, argument, new Float32Array(2))");
+ func1("context.clear(argument)")
+ func1("context.clearColor(argument, 0, 0, 0)");
+ func1("context.clearColor(0, argument, 0, 0)");
+ func1("context.clearColor(0, 0, argument, 0)");
+ func1("context.clearColor(0, 0, 0, argument)");
+ func1("context.clearDepth(argument)");
+ func1("context.clearStencil(argument)");
+ func1("context.copyTexImage2D(context.TEXTURE_2D, argument, context.RGBA, 0, 0, 1, 1, 0)");
+ func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, argument, 0, 1, 1, 0)");
+ func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, argument, 1, 1, 0)");
+ func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, argument, 1, 0)");
+ func1("context.copyTexImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, 0, 0, argument, 0)");
+ func1("context.copyTexSubImage2D(context.TEXTURE_2D, argument, 0, 0, 0, 0, 0, 0)");
+ func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, argument, 0, 0, 0, 0, 0)");
+ func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, argument, 0, 0, 0, 0)");
+ func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, argument, 0, 0, 0)");
+ func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, argument, 0, 0)");
+ func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, argument, 0)");
+ func1("context.copyTexSubImage2D(context.TEXTURE_2D, 0, 0, 0, 0, 0, 0, argument)");
+ func1("context.depthMask(argument)");
+ func1("context.depthRange(argument, 1)");
+ func1("context.depthRange(0, argument)");
+ func1("context.drawArrays(context.POINTS, argument, 1)");
+ func1("context.drawArrays(context.POINTS, 0, argument)");
+ //func1("context.drawElements(...)");
+ func1("context.enableVertexAttribArray(argument)");
+ func1("context.disableVertexAttribArray(argument)");
+ func2("context.getActiveAttrib(program, argument)");
+ func2("context.getActiveUniform(program, argument)");
+ func3("context.getParameter(argument)");
+ func1("context.lineWidth(argument)");
+ func1("context.polygonOffset(argument, 0)");
+ func1("context.polygonOffset(0, argument)");
+ //func1("context.readPixels(...)");
+ //func1("context.renderbufferStorage(...)");
+ func1("context.sampleCoverage(argument, 0)");
+ func1("context.sampleCoverage(0, argument)");
+ func1("context.scissor(argument, 0, 10, 10)");
+ func1("context.scissor(0, argument, 10, 10)");
+ func1("context.scissor(0, 0, argument, 10)");
+ func1("context.scissor(0, 0, 10, argument)");
+ func1("context.shaderSource(shader, argument)");
+ func1("context.stencilFunc(context.NEVER, argument, 255)");
+ func1("context.stencilFunc(context.NEVER, 0, argument)");
+ //func1("context.stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)");
+ func1("context.stencilMask(argument)");
+ //func1("context.stencilMaskSeparate(context.FRONT, argument);
+ //func1("context.texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, ArrayBufferView pixels)");
+ //func1("context.texParameterf(GLenum target, GLenum pname, GLfloat param)");
+ //func1("context.texParameteri(GLenum target, GLenum pname, GLint param)");
+ //func1("context.texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,GLsizei width, GLsizei height,GLenum format, GLenum type, ArrayBufferView pixels)");
+ func1("context.uniform1i(loc, argument)");
+ func1("context.uniform2i(loc, argument, 0)");
+ func1("context.uniform2i(loc, 0, argument)");
+ func1("context.uniform3i(loc, argument, 0, 0)");
+ func1("context.uniform3i(loc, 0, argument, 0)");
+ func1("context.uniform3i(loc, 0, 0, argument)");
+ func1("context.uniform4i(loc, argument, 0, 0, 0)");
+ func1("context.uniform4i(loc, 0, argument, 0, 0)");
+ func1("context.uniform4i(loc, 0, 0, argument, 0)");
+ func1("context.uniform4i(loc, 0, 0, 0, argument)");
+ func1("context.uniform1f(loc, argument)");
+ func1("context.uniform2f(loc, argument, 0)");
+ func1("context.uniform2f(loc, 0, argument)");
+ func1("context.uniform3f(loc, argument, 0, 0)");
+ func1("context.uniform3f(loc, 0, argument, 0)");
+ func1("context.uniform3f(loc, 0, 0, argument)");
+ func1("context.uniform4f(loc, argument, 0, 0, 0)");
+ func1("context.uniform4f(loc, 0, argument, 0, 0)");
+ func1("context.uniform4f(loc, 0, 0, argument, 0)");
+ func1("context.uniform4f(loc, 0, 0, 0, argument)");
+}
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html
new file mode 100644
index 0000000000..c8f935dd1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/uninitialized-test.html
@@ -0,0 +1,262 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Uninitialized GL Resources Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("Tests to check user code cannot access uninitialized data from GL resources.");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl)
+ testFailed("Context created.");
+else
+ testPassed("Context created.");
+
+function setupTexture(texWidth, texHeight) {
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, texWidth, texHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ // this can be quite undeterministic so to improve odds of seeing uninitialized data write bits
+ // into tex then delete texture then re-create one with same characteristics (driver will likely reuse mem)
+ // with this trick on r59046 WebKit/OSX I get FAIL 100% of the time instead of ~15% of the time.
+
+ var badData = new Uint8Array(texWidth * texHeight * 4);
+ for (var i = 0; i < badData.length; ++i)
+ badData[i] = i % 255;
+
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, texWidth, texHeight, gl.RGBA, gl.UNSIGNED_BYTE, badData);
+ gl.finish(); // make sure it has been uploaded
+
+ gl.deleteTexture(texture);
+ gl.finish(); // make sure it has been deleted
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ return texture;
+}
+
+function checkNonZeroPixels(texture, texWidth, texHeight, skipX, skipY, skipWidth, skipHeight, skipR, skipG, skipB, skipA) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ var fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+
+ var data = new Uint8Array(texWidth * texHeight * 4);
+ gl.readPixels(0, 0, texWidth, texHeight, gl.RGBA, gl.UNSIGNED_BYTE, data);
+
+ var k = 0;
+ for (var y = 0; y < texHeight; ++y) {
+ for (var x = 0; x < texWidth; ++x) {
+ var index = (y * texWidth + x) * 4;
+ if (x >= skipX && x < skipX + skipWidth && y >= skipY && y < skipY + skipHeight) {
+ if (data[index] != skipR || data[index + 1] != skipG || data[index + 2] != skipB || data[index + 3] != skipA) {
+ testFailed("non-zero pixel values are wrong");
+ return;
+ }
+ } else {
+ for (var i = 0; i < 4; ++i) {
+ if (data[index + i] != 0)
+ k++;
+ }
+ }
+ }
+ }
+ if (k) {
+ testFailed("Found " + k + " non-zero bytes");
+ } else {
+ testPassed("All data initialized");
+ }
+}
+
+var width = 512;
+var height = 512;
+
+debug("");
+debug("Reading an uninitialized texture (texImage2D) should succeed with all bytes set to 0.");
+
+var tex = setupTexture(width, height);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+checkNonZeroPixels(tex, width, height, 0, 0, 0, 0, 0, 0, 0, 0);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+debug("Reading a partially initialized texture (texImage2D) should succeed with all uninitialized bytes set to 0 and initialized bytes untouched.");
+
+var tex = setupTexture(width, height);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+var data = new Uint8Array(4);
+var r = 108;
+var g = 72;
+var b = 36;
+var a = 9;
+data[0] = r;
+data[1] = g;
+data[2] = b;
+data[3] = a;
+gl.texSubImage2D(gl.TEXTURE_2D, 0, width/2, height/2, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, data);
+checkNonZeroPixels(tex, width, height, width/2, height/2, 1, 1, r, g, b, a);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+debug("Reading an uninitialized portion of a texture (copyTexImage2D) should succeed with all bytes set to 0.");
+
+var tex = setupTexture(width, height);
+var fbo = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+var rbo = gl.createRenderbuffer();
+gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+var fboWidth = 16;
+var fboHeight = 16;
+gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, fboWidth, fboHeight);
+gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+gl.clearColor(1.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, width, height, 0);
+checkNonZeroPixels(tex, width, height, 0, 0, fboWidth, fboHeight, 255, 0, 0, 255);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+debug("Reading an uninitialized portion of a texture (copyTexImage2D with negative x and y) should succeed with all bytes set to 0.");
+
+var tex = setupTexture(width, height);
+var fbo = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+var rbo = gl.createRenderbuffer();
+gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+var fboWidth = 16;
+var fboHeight = 16;
+gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, fboWidth, fboHeight);
+gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+gl.clearColor(1.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+var x = -8;
+var y = -8;
+gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, x, y, width, height, 0);
+checkNonZeroPixels(tex, width, height, -x, -y, fboWidth, fboHeight, 255, 0, 0, 255);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+debug("Reading an uninitialized portion of a texture (copyTexImage2D from WebGL internal fbo) should succeed with all bytes set to 0.");
+
+var tex = setupTexture(width, height);
+gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+gl.clearColor(0.0, 1.0, 0.0, 0.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, width, height, 0);
+checkNonZeroPixels(tex, width, height, 0, 0, gl.canvas.width, gl.canvas.height, 0, 255, 0, 0);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+debug("Reading an uninitialized portion of a texture (copyTexSubImage2D) should succeed with all bytes set to 0.");
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+var fbo = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+var rbo = gl.createRenderbuffer();
+gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+var fboWidth = 16;
+var fboHeight = 16;
+gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, fboWidth, fboHeight);
+gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+gl.clearColor(1.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, width, height);
+checkNonZeroPixels(tex, width, height, 0, 0, fboWidth, fboHeight, 255, 0, 0, 255);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+debug("Reading an uninitialized portion of a texture (copyTexSubImage2D with negative x and y) should succeed with all bytes set to 0.");
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+var fbo = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+var rbo = gl.createRenderbuffer();
+gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+var fboWidth = 16;
+var fboHeight = 16;
+gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, fboWidth, fboHeight);
+gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rbo);
+shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+gl.clearColor(1.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+var x = -8;
+var y = -8;
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, x, y, width, height);
+checkNonZeroPixels(tex, width, height, -x, -y, fboWidth, fboHeight, 255, 0, 0, 255);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+debug("Reading an uninitialized portion of a texture (copyTexSubImage2D from WebGL internal fbo) should succeed with all bytes set to 0.");
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+gl.clearColor(0.0, 1.0, 0.0, 0.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, width, height);
+checkNonZeroPixels(tex, width, height, 0, 0, canvas.width, canvas.height, 0, 255, 0, 0);
+gl.deleteTexture(tex);
+gl.finish();
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+//TODO: uninitialized vertex array buffer
+//TODO: uninitialized vertex elements buffer
+//TODO: uninitialized framebuffer? (implementations would need to do a GL clear at first binding?)
+//TODO: uninitialized renderbuffer? (implementations would need to do a GL clear at first binding?)
+//TODO: uninitialized uniform arrays?
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific-stencil-settings.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific-stencil-settings.html
new file mode 100644
index 0000000000..770a107dc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific-stencil-settings.html
@@ -0,0 +1,299 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL stencil mask/func front-state-back-state equality 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description("Tests that stencil mask/func are validated correctly when the front state and back state differ.");
+
+var gl;
+
+function checkDrawError(errIfMismatch) {
+ wtu.shouldGenerateGLError(gl, errIfMismatch, "wtu.dummySetProgramAndDrawNothing(gl)");
+}
+
+function setStencilMask(mask) {
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.stencilMaskSeparate(gl.FRONT, " + mask[0] + ")");
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.stencilMaskSeparate(gl.BACK, " + mask[1] + ")");
+}
+
+function testStencilMaskCase(mask, error) {
+ setStencilMask(mask);
+ // If an error is generated, it should be at draw time.
+ checkDrawError(error);
+}
+
+function testStencilMask(errIfMismatch) {
+ testStencilMaskCase([0, 256], gl.NO_ERROR);
+ testStencilMaskCase([1, 256], errIfMismatch);
+ testStencilMaskCase([1, 257], gl.NO_ERROR);
+ testStencilMaskCase([1, 258], errIfMismatch);
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.stencilMask(1023)", "resetting stencilMask");
+}
+
+function setStencilFunc(ref, mask) {
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.stencilFuncSeparate(gl.FRONT, gl.ALWAYS, " + ref[0] + ", " + mask[0] + ")");
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.stencilFuncSeparate(gl.BACK, gl.ALWAYS, " + ref[1] + ", " + mask[1] + ")");
+}
+
+function testStencilFuncCase(ref, mask, error) {
+ setStencilFunc(ref, mask);
+ // If an error is generated, it should be at draw time.
+ checkDrawError(error);
+}
+
+function testStencilFunc(errIfMismatch) {
+ testStencilFuncCase([ 256, 257], [1023, 1023], gl.NO_ERROR);
+ testStencilFuncCase([ 256, 254], [1023, 1023], errIfMismatch);
+
+ testStencilFuncCase([ -1, 0], [1023, 1023], gl.NO_ERROR);
+ testStencilFuncCase([ -1, 254], [1023, 1023], errIfMismatch);
+
+ testStencilFuncCase([ 0, 0], [ 1, 257], gl.NO_ERROR);
+ testStencilFuncCase([ 0, 0], [ 1, 258], errIfMismatch);
+
+ testStencilFuncCase([ 1, 1], [1024, 2048], gl.NO_ERROR);
+ testStencilFuncCase([ 1, 1], [2048, 1024], gl.NO_ERROR);
+
+ testStencilFuncCase([ -1, -1], [1023, 1023], gl.NO_ERROR);
+ testStencilFuncCase([ -1, 0], [1023, 1023], gl.NO_ERROR);
+ testStencilFuncCase([ 0, -1], [1023, 1023], gl.NO_ERROR);
+ testStencilFuncCase([ 0, 0], [1023, 1023], gl.NO_ERROR);
+
+ testStencilFuncCase([ -1, 255], [1023, 1023], errIfMismatch);
+ testStencilFuncCase([ 0, 256], [1023, 1023], errIfMismatch);
+ testStencilFuncCase([ 0, 1024], [1023, 1023], errIfMismatch);
+ testStencilFuncCase([ 1, 257], [1023, 1023], errIfMismatch);
+ testStencilFuncCase([ 255, -1], [1023, 1023], errIfMismatch);
+ testStencilFuncCase([ 256, 0], [1023, 1023], errIfMismatch);
+ testStencilFuncCase([1024, 0], [1023, 1023], errIfMismatch);
+ testStencilFuncCase([ 257, 1], [1023, 1023], errIfMismatch);
+
+ wtu.shouldGenerateGLError(gl, gl.NO_ERROR, "gl.stencilFunc(gl.ALWAYS, 0, 1023)", "resetting stencilFunc");
+}
+
+//
+// Tests of the default framebuffer
+//
+
+debug("");
+
+debug("Testing default framebuffer with { stencil: true }");
+gl = wtu.create3DContext(undefined, { stencil: true });
+{
+ gl.enable(gl.STENCIL_TEST);
+ testStencilMaskCase([1, 256], gl.INVALID_OPERATION);
+ testStencilFuncCase([256, 0], [1023, 1023], gl.INVALID_OPERATION);
+}
+
+debug("Testing default framebuffer with { stencil: false }");
+gl = wtu.create3DContext(undefined, { stencil: false });
+{
+ // with { stencil: false }
+ gl.enable(gl.STENCIL_TEST);
+ testStencilMaskCase([1, 256], gl.NO_ERROR);
+ testStencilFuncCase([256, 0], [1023, 1023], gl.NO_ERROR);
+}
+// (continue using this GL context for the other tests)
+
+//
+// Tests with a framebuffer object
+//
+
+const fb = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+const colorRB = gl.createRenderbuffer();
+gl.bindRenderbuffer(gl.RENDERBUFFER, colorRB);
+gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 1, 1);
+gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRB);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "initial framebuffer setup")
+
+function runWithStencilSettings(haveDepthBuffer, haveStencilBuffer, enableStencilTest, fn) {
+ let rbo = null;
+ let attachment;
+ if (haveDepthBuffer || haveStencilBuffer) {
+ rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+
+ let internalformat;
+ if (haveDepthBuffer && haveStencilBuffer) {
+ internalformat = gl.DEPTH_STENCIL;
+ attachment = gl.DEPTH_STENCIL_ATTACHMENT;
+ } else if (haveDepthBuffer) {
+ internalformat = gl.DEPTH_COMPONENT16;
+ attachment = gl.DEPTH_ATTACHMENT;
+ } else if (haveStencilBuffer) {
+ internalformat = gl.STENCIL_INDEX8;
+ attachment = gl.STENCIL_ATTACHMENT;
+ }
+ gl.renderbufferStorage(gl.RENDERBUFFER, internalformat, 1, 1);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, rbo);
+ }
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "depth/stencil renderbuffer setup")
+
+ if (enableStencilTest) {
+ gl.enable(gl.STENCIL_TEST);
+ } else {
+ gl.disable(gl.STENCIL_TEST);
+ }
+
+ fn();
+
+ if (rbo) {
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, null);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(rbo);
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "depth/stencil renderbuffer cleanup")
+}
+
+function testStencilSettings(haveDepthBuffer, haveStencilBuffer, enableStencilTest, errIfMismatch) {
+ debug("");
+ debug("With depthbuffer=" + haveDepthBuffer +
+ ", stencilbuffer=" + haveStencilBuffer +
+ ", stencilTest=" + enableStencilTest +
+ ", expecting error=" + wtu.glEnumToString(gl, errIfMismatch) +
+ " for mismatching mask or func settings.");
+
+ runWithStencilSettings(haveDepthBuffer, haveStencilBuffer, enableStencilTest, () => {
+ // Errors should be the same for both mask and func, because stencil test
+ // and stencil write are always enabled/disabled in tandem.
+ testStencilMask(errIfMismatch);
+ testStencilFunc(errIfMismatch);
+ });
+}
+
+debug("");
+debug("Base case checks:");
+testStencilMaskCase([0, 0], gl.NO_ERROR);
+testStencilFuncCase([0, 0], [1023, 1023], gl.NO_ERROR);
+
+// haveDepthBuffer
+// | haveStencilBuffer
+// | | enableStencilTest
+// | | | errIfMismatch
+testStencilSettings(false, false, false, gl.NO_ERROR);
+testStencilSettings( true, false, false, gl.NO_ERROR);
+testStencilSettings(false, true, false, gl.NO_ERROR);
+testStencilSettings( true, true, false, gl.NO_ERROR);
+
+testStencilSettings(false, false, true, gl.NO_ERROR);
+testStencilSettings( true, false, true, gl.NO_ERROR);
+testStencilSettings(false, true, true, gl.INVALID_OPERATION);
+testStencilSettings( true, true, true, gl.INVALID_OPERATION);
+
+//
+// Tests to make sure the stencil validation check, if cached, is invalidated correctly.
+//
+
+debug("");
+
+debug("Setup for stencil validation cache invalidation tests");
+setStencilMask([1, 258]);
+setStencilFunc([0, 256], [1023, 1023]);
+
+debug("Test with enabling/disabling stencil test");
+runWithStencilSettings(false, true, false, () => {
+ checkDrawError(gl.NO_ERROR);
+ gl.enable(gl.STENCIL_TEST);
+ checkDrawError(gl.INVALID_OPERATION);
+ gl.disable(gl.STENCIL_TEST);
+ checkDrawError(gl.NO_ERROR);
+});
+
+debug("Test with swapping in a new FBO");
+runWithStencilSettings(false, false, true, () => {
+ // no error with no stencil buffer
+ checkDrawError(gl.NO_ERROR);
+
+ // swap in a new FBO with a stencil buffer
+ const fb2 = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorRB);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorRB);
+ const rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, 1, 1);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ // this draw sholud detect the new fbo state
+ checkDrawError(gl.INVALID_OPERATION);
+
+ gl.deleteFramebuffer(fb2);
+ gl.deleteRenderbuffer(rbo)
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+});
+
+debug("Test with adding a stencil attachment");
+runWithStencilSettings(false, false, true, () => {
+ // no error with no stencil buffer
+ checkDrawError(gl.NO_ERROR);
+
+ // add a stencil attachment
+ const rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, 1, 1);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ // this draw sholud detect the new fbo state
+ checkDrawError(gl.INVALID_OPERATION);
+
+ gl.deleteRenderbuffer(rbo)
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+});
+
+debug("Test with reallocating the DEPTH_STENCIL attachment from depth to depth+stencil");
+runWithStencilSettings(false, false, true, () => {
+ // attach a depth buffer to the DEPTH_STENCIL attachment
+ const rbo = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rbo);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, 1, 1);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, rbo);
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ // this draw is invalid, but it still might trigger caching of the stencil validation
+ checkDrawError(gl.INVALID_FRAMEBUFFER_OPERATION);
+
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, 1, 1);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ // this draw sholud detect the new fbo state
+ checkDrawError(gl.INVALID_OPERATION);
+
+ gl.deleteRenderbuffer(rbo)
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+});
+
+gl.deleteFramebuffer(fb);
+gl.deleteRenderbuffer(colorRB);
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html b/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html
new file mode 100644
index 0000000000..a4cdc8c782
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/misc/webgl-specific.html
@@ -0,0 +1,91 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLES2 difference 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description("Tests the few differences between WebGL and GLES2");
+
+var gl = wtu.create3DContext();
+var program = wtu.loadStandardProgram(gl);
+gl.useProgram(program);
+var vertexObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Setup should succeed");
+
+debug("");
+debug("Verify that constant color and constant alpha cannot be used together as source and destination factors in the blend function");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.CONSTANT_COLOR, gl.CONSTANT_ALPHA)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.ONE_MINUS_CONSTANT_COLOR, gl.CONSTANT_ALPHA)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.CONSTANT_ALPHA, gl.CONSTANT_COLOR)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.ONE_MINUS_CONSTANT_ALPHA, gl.CONSTANT_COLOR)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFunc(gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR)");
+
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.CONSTANT_COLOR, gl.CONSTANT_ALPHA, gl.ONE, gl.ZERO)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_COLOR, gl.CONSTANT_ALPHA, gl.ONE, gl.ZERO)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE, gl.ZERO)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE, gl.ZERO)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.CONSTANT_ALPHA, gl.CONSTANT_COLOR, gl.ONE, gl.ZERO)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE, gl.ZERO)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_ALPHA, gl.CONSTANT_COLOR, gl.ONE, gl.ZERO)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.blendFuncSeparate(gl.ONE_MINUS_CONSTANT_ALPHA, gl.ONE_MINUS_CONSTANT_COLOR, gl.ONE, gl.ZERO)");
+
+debug("");
+debug("Verify that in depthRange zNear <= zFar");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.depthRange(20, 10)");
+
+debug("");
+debug("Verify that *LENGTH are undefined");
+shouldBeUndefined(gl.INFO_LOG_LENGTH);
+shouldBeUndefined(gl.SHADER_SOURCE_LENGTH);
+shouldBeUndefined(gl.ACTIVE_UNIFORM_MAX_LENGTH);
+shouldBeUndefined(gl.ACTIVE_ATTRIB_MAX_LENGTH);
+shouldBeUndefined(gl.ACTIVE_ATTRIBUTE_MAX_LENGTH);
+
+debug("");
+debug("Verify that UNPACK_COLORSPACE_CONVERSION_WEBGL is supported");
+shouldBe("gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL)", "gl.BROWSER_DEFAULT_WEBGL");
+gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
+shouldBe("gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL)", "gl.NONE");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "set/get UNPACK_COLORSPACE_CONVERSION_WEBGL should generate no error");
+
+debug("");
+debug("Verify that drawingBufferWidth and drawingBufferHeights are implemented");
+shouldBeTrue("gl.drawingBufferWidth >= 0 && gl.drawingBufferHeight >= 0");
+
+debug("");
+debug("Verify that bindAttribLocation rejects names start with webgl_ or _webgl_");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindAttribLocation(program, 0, 'webgl_a')");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION, "gl.bindAttribLocation(program, 0, '_webgl_a')");
+
+debug("");
+debug("Verify that NaN line width is not accepted");
+wtu.shouldGenerateGLError(gl, gl.INVALID_VALUE, "gl.lineWidth(NaN)");
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt
new file mode 100644
index 0000000000..f202776ac5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/00_test_list.txt
@@ -0,0 +1,54 @@
+conformance/constants.html
+conformance/getContext.html
+conformance/methods.html
+conformance/quickCheckAPI-A.html
+conformance/quickCheckAPI-B1.html
+conformance/quickCheckAPI-B2.html
+conformance/quickCheckAPI-B3.html
+conformance/quickCheckAPI-B4.html
+conformance/quickCheckAPI-C.html
+conformance/quickCheckAPI-D_G.html
+conformance/quickCheckAPI-G_I.html
+conformance/quickCheckAPI-L_S.html
+conformance/quickCheckAPI-S_V.html
+conformance/webGLArrays.html
+functions/bindBuffer.html
+functions/bindBufferBadArgs.html
+functions/bindFramebufferLeaveNonZero.html
+functions/bufferData.html
+functions/bufferDataBadArgs.html
+functions/bufferSubData.html
+functions/bufferSubDataBadArgs.html
+functions/copyTexImage2D.html
+functions/copyTexImage2DBadArgs.html
+functions/copyTexSubImage2D.html
+functions/copyTexSubImage2DBadArgs.html
+functions/deleteBufferBadArgs.html
+functions/drawArrays.html
+functions/drawElements.html
+functions/isTests.html
+--min-version 1.0.2 functions/isTestsBadArgs.html
+functions/readPixels.html
+functions/readPixelsBadArgs.html
+functions/texImage2D.html
+functions/texImage2DBadArgs.html
+functions/texImage2DHTML.html
+functions/texImage2DHTMLBadArgs.html
+functions/texSubImage2D.html
+functions/texSubImage2DBadArgs.html
+functions/texSubImage2DHTML.html
+functions/texSubImage2DHTMLBadArgs.html
+functions/uniformf.html
+functions/uniformfBadArgs.html
+functions/uniformfArrayLen1.html
+functions/uniformi.html
+functions/uniformiBadArgs.html
+functions/uniformMatrix.html
+functions/uniformMatrixBadArgs.html
+functions/vertexAttrib.html
+functions/vertexAttribBadArgs.html
+functions/vertexAttribPointer.html
+functions/vertexAttribPointerBadArgs.html
+glsl/arrayOutOfBounds.html
+glsl/uniformOutOfBounds.html
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/README.md b/dom/canvas/test/webgl-conf/checkout/conformance/more/README.md
new file mode 100644
index 0000000000..01937147f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/README.md
@@ -0,0 +1,53 @@
+Tests for the WebGL canvas context
+==================================
+
+These tests are intended to serve the following purposes:
+
+ * Assert spec conformance
+ * Check the safety of the GL binding (bounds checking, same origin policy)
+ * Provide performance numbers for developers
+
+
+Running the tests
+-----------------
+
+ 1. <a href="http://learningwebgl.com/blog/?p=11">Install a browser with WebGL support</a>
+ 2. Run <code>ruby gen_tests.rb</code> if you have modified the tests.
+ 3. Run <code>ruby test_server.rb</code> if you want to get test run output to test_server's stdout (especially useful for finding out which test crashed your browser.)
+ 4. Open all_tests.html in your browser.
+
+
+Want to contribute?
+-------------------
+
+ 1. Fork this repo
+ 2. Run <code>gen_tests.rb</code>
+ 3. Look into templates/ to see which functions lack tests (also see <a href="../raw/master/methods.txt">methods.txt</a> and <a href="http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/canvas/nsICanvasRenderingContextWebGL.idl">nsICanvasRenderingContextWebGL.idl</a>):
+ 1. copy methodName.html to functions/methodName.html and write tests that test the results of valid inputs.
+ 2. copy methodNameBadArgs.html to functions/methodNameBadArgs.html and write tests to assert that invalid inputs throw exceptions.
+ 3. If your test causes a segfault, add the following to the top of the script tag: <code>Tests.autorun = false; Tests.message = "Caution: this may crash your browser";</code>
+ 4. For each performance test:
+ 1. Write a performance/myTestName.html and set <code>Tests.autorun = false;</code>
+ 5. If you have a test that you would like to run over the whole API or want to generate tests programmatically, add them to gen_tests.rb or write your own script.
+ 6. Create a commit for each file. (E.g. <code>for f in $(git status | grep -e "^#\\s*functions/\\S*$" | sed "s/^#\s*//"); do git add $f; git commit -m $f; done</code>)
+ 7. Send me a pull request.
+ 8. Congratulations, you're now a contributor!
+
+
+For more information on WebGL:
+
+ * <a href="http://planet-webgl.org">Planet WebGL</a>
+ * <a href="http://learningwebgl.com">Learning WebGL</a>
+ * <a href="http://www.khronos.org/message_boards/viewforum.php?f=34">WebGL on Khronos Message Boards</a>
+
+Developer links:
+
+ * <a href="https://bugzilla.mozilla.org/buglist.cgi?quicksearch=webgl">WebGL on Mozilla Bugzilla</a>
+ * <a href="https://bugzilla.webkit.org/buglist.cgi?quicksearch=webgl">WebGL on WebKit Bugzilla</a>
+ * <a href="http://code.google.com/p/chromium/issues/list?q=label:3D-WebGL">WebGL on Chromium Bugzilla</a>
+
+What's the stuff in apigen?
+
+ There are some Python scripts in the apigen/ directory that generate C++ based on the API definition files (gl2.h, api_modifications.txt, valid_args.txt.) The generated code is Mozilla XPCOM functions that check their args against the valid GLES 2.0 constants (as they were written on the man pages.) There's also some wackier stuff for checking copyTexImage2D and copyTexSubImage2D image dimensions against viewport dimensions.
+
+ If you can use it to generate code for your WebGL implementation, it might save you 1500 lines of typing and testing. The last time I used it was summer 2009 to generate a patch for Canvas 3D, so it's likely somewhat out of date.
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html
new file mode 100644
index 0000000000..d089c716f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests.html
@@ -0,0 +1,378 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+ <title>OpenGL ES 2.0 &lt;canvas&gt; context tests</title>
+ <style type="text/css">
+ h2 { display: inline; font-size: 1em; margin-bottom: 0.2em; }
+ iframe { display: inline; border: 1px solid black; overflow: hidden;}
+ </style>
+ <script type="application/javascript">
+ function loadTest(id, url) {
+ document.getElementById(id).src = url;
+ }
+ function seqLoader() {
+ var iframes = document.getElementsByTagName('iframe');
+ for (var i=0; i<iframes.length; i++) {
+ iframes[i].addEventListener('load', (function(j) {
+ return function() {
+ var e = document.getElementById((j+1)+'_link');
+ if (e) loadTest(j+1, e.href);
+ }
+ })(i), false);
+ }
+ var e = document.getElementById('0_link');
+ if (e) loadTest(0, e.href);
+ }
+ </script>
+</head>
+<body onload="seqLoader()">
+
+ <div>
+ <iframe src="conformance/badArgsArityLessThanArgc.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/badArgsArityLessThanArgc.html">conformance/badArgsArityLessThanArgc.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="conformance/constants.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/constants.html">conformance/constants.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="conformance/fuzzTheAPI.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/fuzzTheAPI.html">conformance/fuzzTheAPI.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="conformance/getContext.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/getContext.html">conformance/getContext.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="conformance/methods.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/methods.html">conformance/methods.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="conformance/quickCheckAPI.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/quickCheckAPI.html">conformance/quickCheckAPI.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="conformance/quickCheckAPIBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/quickCheckAPIBadArgs.html">conformance/quickCheckAPIBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="conformance/webGLArrays.html" width="110" height="42"></iframe>
+ <h2><a href="conformance/webGLArrays.html">conformance/webGLArrays.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/bindBuffer.html" width="110" height="42"></iframe>
+ <h2><a href="functions/bindBuffer.html">functions/bindBuffer.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/bindBufferBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/bindBufferBadArgs.html">functions/bindBufferBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/bindFramebufferLeaveNonZero.html" width="110" height="42"></iframe>
+ <h2><a href="functions/bindFramebufferLeaveNonZero.html">functions/bindFramebufferLeaveNonZero.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/bufferData.html" width="110" height="42"></iframe>
+ <h2><a href="functions/bufferData.html">functions/bufferData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/bufferDataBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/bufferDataBadArgs.html">functions/bufferDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/bufferSubData.html" width="110" height="42"></iframe>
+ <h2><a href="functions/bufferSubData.html">functions/bufferSubData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/bufferSubDataBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/bufferSubDataBadArgs.html">functions/bufferSubDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/copyTexImage2D.html" width="110" height="42"></iframe>
+ <h2><a href="functions/copyTexImage2D.html">functions/copyTexImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/copyTexImage2DBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/copyTexImage2DBadArgs.html">functions/copyTexImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/copyTexSubImage2D.html" width="110" height="42"></iframe>
+ <h2><a href="functions/copyTexSubImage2D.html">functions/copyTexSubImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/copyTexSubImage2DBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/copyTexSubImage2DBadArgs.html">functions/copyTexSubImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/deleteBufferBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/deleteBufferBadArgs.html">functions/deleteBufferBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/drawArrays.html" width="110" height="42"></iframe>
+ <h2><a href="functions/drawArrays.html">functions/drawArrays.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/drawArraysOutOfBounds.html" width="110" height="42"></iframe>
+ <h2><a href="functions/drawArraysOutOfBounds.html">functions/drawArraysOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/drawElements.html" width="110" height="42"></iframe>
+ <h2><a href="functions/drawElements.html">functions/drawElements.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/drawElementsBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/drawElementsBadArgs.html">functions/drawElementsBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/getImageData.html" width="110" height="42"></iframe>
+ <h2><a href="functions/getImageData.html">functions/getImageData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/getImageDataBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/getImageDataBadArgs.html">functions/getImageDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/isTests.html" width="110" height="42"></iframe>
+ <h2><a href="functions/isTests.html">functions/isTests.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/linkProgramBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/linkProgramBadArgs.html">functions/linkProgramBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/readPixels.html" width="110" height="42"></iframe>
+ <h2><a href="functions/readPixels.html">functions/readPixels.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/readPixelsBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/readPixelsBadArgs.html">functions/readPixelsBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texImage2D.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texImage2D.html">functions/texImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texImage2DBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texImage2DBadArgs.html">functions/texImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texImage2DHTML.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texImage2DHTML.html">functions/texImage2DHTML.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texImage2DHTMLBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texImage2DHTMLBadArgs.html">functions/texImage2DHTMLBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texSubImage2D.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texSubImage2D.html">functions/texSubImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texSubImage2DBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texSubImage2DBadArgs.html">functions/texSubImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texSubImage2DHTML.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texSubImage2DHTML.html">functions/texSubImage2DHTML.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/texSubImage2DHTMLBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/texSubImage2DHTMLBadArgs.html">functions/texSubImage2DHTMLBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/uniformMatrix.html" width="110" height="42"></iframe>
+ <h2><a href="functions/uniformMatrix.html">functions/uniformMatrix.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/uniformMatrixBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/uniformMatrixBadArgs.html">functions/uniformMatrixBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/uniformf.html" width="110" height="42"></iframe>
+ <h2><a href="functions/uniformf.html">functions/uniformf.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/uniformfBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/uniformfBadArgs.html">functions/uniformfBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/uniformi.html" width="110" height="42"></iframe>
+ <h2><a href="functions/uniformi.html">functions/uniformi.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/uniformiBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/uniformiBadArgs.html">functions/uniformiBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/vertexAttrib.html" width="110" height="42"></iframe>
+ <h2><a href="functions/vertexAttrib.html">functions/vertexAttrib.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/vertexAttribBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/vertexAttribBadArgs.html">functions/vertexAttribBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/vertexAttribPointer.html" width="110" height="42"></iframe>
+ <h2><a href="functions/vertexAttribPointer.html">functions/vertexAttribPointer.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="functions/vertexAttribPointerBadArgs.html" width="110" height="42"></iframe>
+ <h2><a href="functions/vertexAttribPointerBadArgs.html">functions/vertexAttribPointerBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="performance/CPUvsGPU.html" width="110" height="42"></iframe>
+ <h2><a href="performance/CPUvsGPU.html">performance/CPUvsGPU.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="performance/bandwidth.html" width="110" height="42"></iframe>
+ <h2><a href="performance/bandwidth.html">performance/bandwidth.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="performance/jsGCPause.html" width="110" height="42"></iframe>
+ <h2><a href="performance/jsGCPause.html">performance/jsGCPause.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="performance/jsMatrixMult.html" width="110" height="42"></iframe>
+ <h2><a href="performance/jsMatrixMult.html">performance/jsMatrixMult.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="performance/jsToGLOverhead.html" width="110" height="42"></iframe>
+ <h2><a href="performance/jsToGLOverhead.html">performance/jsToGLOverhead.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="glsl/arrayOutOfBounds.html" width="110" height="42"></iframe>
+ <h2><a href="glsl/arrayOutOfBounds.html">glsl/arrayOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="glsl/longLoops.html" width="110" height="42"></iframe>
+ <h2><a href="glsl/longLoops.html">glsl/longLoops.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="glsl/uniformOutOfBounds.html" width="110" height="42"></iframe>
+ <h2><a href="glsl/uniformOutOfBounds.html">glsl/uniformOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe src="glsl/unusedAttribsUniforms.html" width="110" height="42"></iframe>
+ <h2><a href="glsl/unusedAttribsUniforms.html">glsl/unusedAttribsUniforms.html</a></h2>
+ </div>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html
new file mode 100644
index 0000000000..0ec563b028
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_linkonly.html
@@ -0,0 +1,378 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+ <title>OpenGL ES 2.0 &lt;canvas&gt; context tests</title>
+ <style type="text/css">
+ h2 { display: inline; font-size: 1em; margin-bottom: 0.2em; }
+ iframe { display: inline; border: 1px solid black; overflow: hidden;}
+ </style>
+ <script type="application/javascript">
+ function loadTest(id, url) {
+ document.getElementById(id).src = url;
+ }
+ function seqLoader() {
+ var iframes = document.getElementsByTagName('iframe');
+ for (var i=0; i<iframes.length; i++) {
+ iframes[i].addEventListener('load', (function(j) {
+ return function() {
+ var e = document.getElementById((j+1)+'_link');
+ if (e) loadTest(j+1, e.href);
+ }
+ })(i), false);
+ }
+ var e = document.getElementById('0_link');
+ if (e) loadTest(0, e.href);
+ }
+ </script>
+</head>
+<body onload="seqLoader()">
+
+ <div>
+ <iframe id="0" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(0, 'conformance/badArgsArityLessThanArgc.html');return false" href="conformance/badArgsArityLessThanArgc.html">conformance/badArgsArityLessThanArgc.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="1" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(1, 'conformance/constants.html');return false" href="conformance/constants.html">conformance/constants.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="2" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(2, 'conformance/fuzzTheAPI.html');return false" href="conformance/fuzzTheAPI.html">conformance/fuzzTheAPI.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="3" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(3, 'conformance/getContext.html');return false" href="conformance/getContext.html">conformance/getContext.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="4" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(4, 'conformance/methods.html');return false" href="conformance/methods.html">conformance/methods.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="5" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(5, 'conformance/quickCheckAPI.html');return false" href="conformance/quickCheckAPI.html">conformance/quickCheckAPI.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="6" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(6, 'conformance/quickCheckAPIBadArgs.html');return false" href="conformance/quickCheckAPIBadArgs.html">conformance/quickCheckAPIBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="7" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(7, 'conformance/webGLArrays.html');return false" href="conformance/webGLArrays.html">conformance/webGLArrays.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="8" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(8, 'functions/bindBuffer.html');return false" href="functions/bindBuffer.html">functions/bindBuffer.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="9" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(9, 'functions/bindBufferBadArgs.html');return false" href="functions/bindBufferBadArgs.html">functions/bindBufferBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="10" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(10, 'functions/bindFramebufferLeaveNonZero.html');return false" href="functions/bindFramebufferLeaveNonZero.html">functions/bindFramebufferLeaveNonZero.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="11" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(11, 'functions/bufferData.html');return false" href="functions/bufferData.html">functions/bufferData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="12" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(12, 'functions/bufferDataBadArgs.html');return false" href="functions/bufferDataBadArgs.html">functions/bufferDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="13" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(13, 'functions/bufferSubData.html');return false" href="functions/bufferSubData.html">functions/bufferSubData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="14" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(14, 'functions/bufferSubDataBadArgs.html');return false" href="functions/bufferSubDataBadArgs.html">functions/bufferSubDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="15" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(15, 'functions/copyTexImage2D.html');return false" href="functions/copyTexImage2D.html">functions/copyTexImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="16" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(16, 'functions/copyTexImage2DBadArgs.html');return false" href="functions/copyTexImage2DBadArgs.html">functions/copyTexImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="17" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(17, 'functions/copyTexSubImage2D.html');return false" href="functions/copyTexSubImage2D.html">functions/copyTexSubImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="18" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(18, 'functions/copyTexSubImage2DBadArgs.html');return false" href="functions/copyTexSubImage2DBadArgs.html">functions/copyTexSubImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="19" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(19, 'functions/deleteBufferBadArgs.html');return false" href="functions/deleteBufferBadArgs.html">functions/deleteBufferBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="20" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(20, 'functions/drawArrays.html');return false" href="functions/drawArrays.html">functions/drawArrays.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="21" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(21, 'functions/drawArraysOutOfBounds.html');return false" href="functions/drawArraysOutOfBounds.html">functions/drawArraysOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="22" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(22, 'functions/drawElements.html');return false" href="functions/drawElements.html">functions/drawElements.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="23" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(23, 'functions/drawElementsBadArgs.html');return false" href="functions/drawElementsBadArgs.html">functions/drawElementsBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="24" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(24, 'functions/getImageData.html');return false" href="functions/getImageData.html">functions/getImageData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="25" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(25, 'functions/getImageDataBadArgs.html');return false" href="functions/getImageDataBadArgs.html">functions/getImageDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="26" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(26, 'functions/isTests.html');return false" href="functions/isTests.html">functions/isTests.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="27" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(27, 'functions/linkProgramBadArgs.html');return false" href="functions/linkProgramBadArgs.html">functions/linkProgramBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="28" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(28, 'functions/readPixels.html');return false" href="functions/readPixels.html">functions/readPixels.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="29" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(29, 'functions/readPixelsBadArgs.html');return false" href="functions/readPixelsBadArgs.html">functions/readPixelsBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="30" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(30, 'functions/texImage2D.html');return false" href="functions/texImage2D.html">functions/texImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="31" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(31, 'functions/texImage2DBadArgs.html');return false" href="functions/texImage2DBadArgs.html">functions/texImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="32" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(32, 'functions/texImage2DHTML.html');return false" href="functions/texImage2DHTML.html">functions/texImage2DHTML.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="33" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(33, 'functions/texImage2DHTMLBadArgs.html');return false" href="functions/texImage2DHTMLBadArgs.html">functions/texImage2DHTMLBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="34" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(34, 'functions/texSubImage2D.html');return false" href="functions/texSubImage2D.html">functions/texSubImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="35" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(35, 'functions/texSubImage2DBadArgs.html');return false" href="functions/texSubImage2DBadArgs.html">functions/texSubImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="36" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(36, 'functions/texSubImage2DHTML.html');return false" href="functions/texSubImage2DHTML.html">functions/texSubImage2DHTML.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="37" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(37, 'functions/texSubImage2DHTMLBadArgs.html');return false" href="functions/texSubImage2DHTMLBadArgs.html">functions/texSubImage2DHTMLBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="38" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(38, 'functions/uniformMatrix.html');return false" href="functions/uniformMatrix.html">functions/uniformMatrix.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="39" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(39, 'functions/uniformMatrixBadArgs.html');return false" href="functions/uniformMatrixBadArgs.html">functions/uniformMatrixBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="40" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(40, 'functions/uniformf.html');return false" href="functions/uniformf.html">functions/uniformf.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="41" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(41, 'functions/uniformfBadArgs.html');return false" href="functions/uniformfBadArgs.html">functions/uniformfBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="42" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(42, 'functions/uniformi.html');return false" href="functions/uniformi.html">functions/uniformi.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="43" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(43, 'functions/uniformiBadArgs.html');return false" href="functions/uniformiBadArgs.html">functions/uniformiBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="44" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(44, 'functions/vertexAttrib.html');return false" href="functions/vertexAttrib.html">functions/vertexAttrib.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="45" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(45, 'functions/vertexAttribBadArgs.html');return false" href="functions/vertexAttribBadArgs.html">functions/vertexAttribBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="46" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(46, 'functions/vertexAttribPointer.html');return false" href="functions/vertexAttribPointer.html">functions/vertexAttribPointer.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="47" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(47, 'functions/vertexAttribPointerBadArgs.html');return false" href="functions/vertexAttribPointerBadArgs.html">functions/vertexAttribPointerBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="48" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(48, 'performance/CPUvsGPU.html');return false" href="performance/CPUvsGPU.html">performance/CPUvsGPU.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="49" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(49, 'performance/bandwidth.html');return false" href="performance/bandwidth.html">performance/bandwidth.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="50" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(50, 'performance/jsGCPause.html');return false" href="performance/jsGCPause.html">performance/jsGCPause.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="51" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(51, 'performance/jsMatrixMult.html');return false" href="performance/jsMatrixMult.html">performance/jsMatrixMult.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="52" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(52, 'performance/jsToGLOverhead.html');return false" href="performance/jsToGLOverhead.html">performance/jsToGLOverhead.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="53" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(53, 'glsl/arrayOutOfBounds.html');return false" href="glsl/arrayOutOfBounds.html">glsl/arrayOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="54" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(54, 'glsl/longLoops.html');return false" href="glsl/longLoops.html">glsl/longLoops.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="55" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(55, 'glsl/uniformOutOfBounds.html');return false" href="glsl/uniformOutOfBounds.html">glsl/uniformOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="56" width="110" height="42"></iframe>
+ <h2><a onclick="loadTest(56, 'glsl/unusedAttribsUniforms.html');return false" href="glsl/unusedAttribsUniforms.html">glsl/unusedAttribsUniforms.html</a></h2>
+ </div>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html
new file mode 100644
index 0000000000..5ebf8382ba
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/all_tests_sequential.html
@@ -0,0 +1,378 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+ <title>OpenGL ES 2.0 &lt;canvas&gt; context tests</title>
+ <style type="text/css">
+ h2 { display: inline; font-size: 1em; margin-bottom: 0.2em; }
+ iframe { display: inline; border: 1px solid black; overflow: hidden;}
+ </style>
+ <script type="application/javascript">
+ function loadTest(id, url) {
+ document.getElementById(id).src = url;
+ }
+ function seqLoader() {
+ var iframes = document.getElementsByTagName('iframe');
+ for (var i=0; i<iframes.length; i++) {
+ iframes[i].addEventListener('load', (function(j) {
+ return function() {
+ var e = document.getElementById((j+1)+'_link');
+ if (e) loadTest(j+1, e.href);
+ }
+ })(i), false);
+ }
+ var e = document.getElementById('0_link');
+ if (e) loadTest(0, e.href);
+ }
+ </script>
+</head>
+<body onload="seqLoader()">
+
+ <div>
+ <iframe id="0" width="110" height="42"></iframe>
+ <h2><a id="0_link" href="conformance/badArgsArityLessThanArgc.html">conformance/badArgsArityLessThanArgc.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="1" width="110" height="42"></iframe>
+ <h2><a id="1_link" href="conformance/constants.html">conformance/constants.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="2" width="110" height="42"></iframe>
+ <h2><a id="2_link" href="conformance/fuzzTheAPI.html">conformance/fuzzTheAPI.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="3" width="110" height="42"></iframe>
+ <h2><a id="3_link" href="conformance/getContext.html">conformance/getContext.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="4" width="110" height="42"></iframe>
+ <h2><a id="4_link" href="conformance/methods.html">conformance/methods.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="5" width="110" height="42"></iframe>
+ <h2><a id="5_link" href="conformance/quickCheckAPI.html">conformance/quickCheckAPI.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="6" width="110" height="42"></iframe>
+ <h2><a id="6_link" href="conformance/quickCheckAPIBadArgs.html">conformance/quickCheckAPIBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="7" width="110" height="42"></iframe>
+ <h2><a id="7_link" href="conformance/webGLArrays.html">conformance/webGLArrays.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="8" width="110" height="42"></iframe>
+ <h2><a id="8_link" href="functions/bindBuffer.html">functions/bindBuffer.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="9" width="110" height="42"></iframe>
+ <h2><a id="9_link" href="functions/bindBufferBadArgs.html">functions/bindBufferBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="10" width="110" height="42"></iframe>
+ <h2><a id="10_link" href="functions/bindFramebufferLeaveNonZero.html">functions/bindFramebufferLeaveNonZero.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="11" width="110" height="42"></iframe>
+ <h2><a id="11_link" href="functions/bufferData.html">functions/bufferData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="12" width="110" height="42"></iframe>
+ <h2><a id="12_link" href="functions/bufferDataBadArgs.html">functions/bufferDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="13" width="110" height="42"></iframe>
+ <h2><a id="13_link" href="functions/bufferSubData.html">functions/bufferSubData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="14" width="110" height="42"></iframe>
+ <h2><a id="14_link" href="functions/bufferSubDataBadArgs.html">functions/bufferSubDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="15" width="110" height="42"></iframe>
+ <h2><a id="15_link" href="functions/copyTexImage2D.html">functions/copyTexImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="16" width="110" height="42"></iframe>
+ <h2><a id="16_link" href="functions/copyTexImage2DBadArgs.html">functions/copyTexImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="17" width="110" height="42"></iframe>
+ <h2><a id="17_link" href="functions/copyTexSubImage2D.html">functions/copyTexSubImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="18" width="110" height="42"></iframe>
+ <h2><a id="18_link" href="functions/copyTexSubImage2DBadArgs.html">functions/copyTexSubImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="19" width="110" height="42"></iframe>
+ <h2><a id="19_link" href="functions/deleteBufferBadArgs.html">functions/deleteBufferBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="20" width="110" height="42"></iframe>
+ <h2><a id="20_link" href="functions/drawArrays.html">functions/drawArrays.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="21" width="110" height="42"></iframe>
+ <h2><a id="21_link" href="functions/drawArraysOutOfBounds.html">functions/drawArraysOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="22" width="110" height="42"></iframe>
+ <h2><a id="22_link" href="functions/drawElements.html">functions/drawElements.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="23" width="110" height="42"></iframe>
+ <h2><a id="23_link" href="functions/drawElementsBadArgs.html">functions/drawElementsBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="24" width="110" height="42"></iframe>
+ <h2><a id="24_link" href="functions/getImageData.html">functions/getImageData.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="25" width="110" height="42"></iframe>
+ <h2><a id="25_link" href="functions/getImageDataBadArgs.html">functions/getImageDataBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="26" width="110" height="42"></iframe>
+ <h2><a id="26_link" href="functions/isTests.html">functions/isTests.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="27" width="110" height="42"></iframe>
+ <h2><a id="27_link" href="functions/linkProgramBadArgs.html">functions/linkProgramBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="28" width="110" height="42"></iframe>
+ <h2><a id="28_link" href="functions/readPixels.html">functions/readPixels.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="29" width="110" height="42"></iframe>
+ <h2><a id="29_link" href="functions/readPixelsBadArgs.html">functions/readPixelsBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="30" width="110" height="42"></iframe>
+ <h2><a id="30_link" href="functions/texImage2D.html">functions/texImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="31" width="110" height="42"></iframe>
+ <h2><a id="31_link" href="functions/texImage2DBadArgs.html">functions/texImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="32" width="110" height="42"></iframe>
+ <h2><a id="32_link" href="functions/texImage2DHTML.html">functions/texImage2DHTML.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="33" width="110" height="42"></iframe>
+ <h2><a id="33_link" href="functions/texImage2DHTMLBadArgs.html">functions/texImage2DHTMLBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="34" width="110" height="42"></iframe>
+ <h2><a id="34_link" href="functions/texSubImage2D.html">functions/texSubImage2D.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="35" width="110" height="42"></iframe>
+ <h2><a id="35_link" href="functions/texSubImage2DBadArgs.html">functions/texSubImage2DBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="36" width="110" height="42"></iframe>
+ <h2><a id="36_link" href="functions/texSubImage2DHTML.html">functions/texSubImage2DHTML.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="37" width="110" height="42"></iframe>
+ <h2><a id="37_link" href="functions/texSubImage2DHTMLBadArgs.html">functions/texSubImage2DHTMLBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="38" width="110" height="42"></iframe>
+ <h2><a id="38_link" href="functions/uniformMatrix.html">functions/uniformMatrix.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="39" width="110" height="42"></iframe>
+ <h2><a id="39_link" href="functions/uniformMatrixBadArgs.html">functions/uniformMatrixBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="40" width="110" height="42"></iframe>
+ <h2><a id="40_link" href="functions/uniformf.html">functions/uniformf.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="41" width="110" height="42"></iframe>
+ <h2><a id="41_link" href="functions/uniformfBadArgs.html">functions/uniformfBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="42" width="110" height="42"></iframe>
+ <h2><a id="42_link" href="functions/uniformi.html">functions/uniformi.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="43" width="110" height="42"></iframe>
+ <h2><a id="43_link" href="functions/uniformiBadArgs.html">functions/uniformiBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="44" width="110" height="42"></iframe>
+ <h2><a id="44_link" href="functions/vertexAttrib.html">functions/vertexAttrib.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="45" width="110" height="42"></iframe>
+ <h2><a id="45_link" href="functions/vertexAttribBadArgs.html">functions/vertexAttribBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="46" width="110" height="42"></iframe>
+ <h2><a id="46_link" href="functions/vertexAttribPointer.html">functions/vertexAttribPointer.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="47" width="110" height="42"></iframe>
+ <h2><a id="47_link" href="functions/vertexAttribPointerBadArgs.html">functions/vertexAttribPointerBadArgs.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="48" width="110" height="42"></iframe>
+ <h2><a id="48_link" href="performance/CPUvsGPU.html">performance/CPUvsGPU.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="49" width="110" height="42"></iframe>
+ <h2><a id="49_link" href="performance/bandwidth.html">performance/bandwidth.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="50" width="110" height="42"></iframe>
+ <h2><a id="50_link" href="performance/jsGCPause.html">performance/jsGCPause.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="51" width="110" height="42"></iframe>
+ <h2><a id="51_link" href="performance/jsMatrixMult.html">performance/jsMatrixMult.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="52" width="110" height="42"></iframe>
+ <h2><a id="52_link" href="performance/jsToGLOverhead.html">performance/jsToGLOverhead.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="53" width="110" height="42"></iframe>
+ <h2><a id="53_link" href="glsl/arrayOutOfBounds.html">glsl/arrayOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="54" width="110" height="42"></iframe>
+ <h2><a id="54_link" href="glsl/longLoops.html">glsl/longLoops.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="55" width="110" height="42"></iframe>
+ <h2><a id="55_link" href="glsl/uniformOutOfBounds.html">glsl/uniformOutOfBounds.html</a></h2>
+ </div>
+
+
+ <div>
+ <iframe id="56" width="110" height="42"></iframe>
+ <h2><a id="56_link" href="glsl/unusedAttribsUniforms.html">glsl/unusedAttribsUniforms.html</a></h2>
+ </div>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js
new file mode 100644
index 0000000000..c3e301ce14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-A.js
@@ -0,0 +1,69 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// A
+
+ activeTexture : {
+ generate : function() { return [textureUnit.random()]; },
+ checkArgValidity : function(t) { return textureUnit.has(t); },
+ teardown : function() { GL.activeTexture(GL.TEXTURE0); }
+ },
+ attachShader : {
+ generate : function() {
+ var p = GL.createProgram();
+ var sh = GL.createShader(shaderType.random());
+ return [p, sh];
+ },
+ checkArgValidity : function(p, sh) {
+ return GL.isProgram(p) && GL.isShader(sh) && !GL.getAttachedShaders(p).has(sh);
+ },
+ cleanup : function(p, sh) {
+ try {GL.detachShader(p,sh);} catch(e) {}
+ try {GL.deleteProgram(p);} catch(e) {}
+ try {GL.deleteShader(sh);} catch(e) {}
+ }
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B1.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B1.js
new file mode 100644
index 0000000000..04f394be02
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B1.js
@@ -0,0 +1,61 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// B-1
+
+ bindAttribLocation : {
+ generate : function() {
+ var program = GL.createProgram();
+ return [program, randomVertexAttribute(), randomName()];
+ },
+ checkArgValidity : function(program, index, name) {
+ return GL.isProgram(program) && isVertexAttribute(index) && isValidName(name);
+ },
+ cleanup : function(program, index, name) {
+ try { GL.deleteProgram(program); } catch(e) {}
+ }
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B2.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B2.js
new file mode 100644
index 0000000000..f366c3d8f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B2.js
@@ -0,0 +1,154 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// B-2
+
+ bindBuffer : {
+ generate : function(buf) {
+ return [bufferTarget.random(), GL.createBuffer()];
+ },
+ checkArgValidity : function(target, buf) {
+ if (!bufferTarget.has(target))
+ return false;
+ GL.bindBuffer(target, buf);
+ return GL.isBuffer(buf);
+ },
+ cleanup : function(t, buf, m) {
+ GL.deleteBuffer(buf);
+ }
+ },
+ bindFramebuffer : {
+ generate : function() {
+ return [GL.FRAMEBUFFER, Math.random() > 0.5 ? null : GL.createFramebuffer()];
+ },
+ checkArgValidity : function(target, fbo) {
+ if (target != GL.FRAMEBUFFER)
+ return false;
+ if (fbo != null)
+ GL.bindFramebuffer(target, fbo);
+ return (fbo == null || GL.isFramebuffer(fbo));
+ },
+ cleanup : function(target, fbo) {
+ GL.bindFramebuffer(target, null);
+ if (fbo)
+ GL.deleteFramebuffer(fbo);
+ }
+ },
+ bindRenderbuffer : {
+ generate : function() {
+ return [GL.RENDERBUFFER, Math.random() > 0.5 ? null : GL.createRenderbuffer()];
+ },
+ checkArgValidity : function(target, rbo) {
+ if (target != GL.RENDERBUFFER)
+ return false;
+ if (rbo != null)
+ GL.bindRenderbuffer(target, rbo);
+ return (rbo == null || GL.isRenderbuffer(rbo));
+ },
+ cleanup : function(target, rbo) {
+ GL.bindRenderbuffer(target, null);
+ if (rbo)
+ GL.deleteRenderbuffer(rbo);
+ }
+ },
+ bindTexture : {
+ generate : function() {
+ return [bindTextureTarget.random(), Math.random() > 0.5 ? null : GL.createTexture()];
+ },
+ checkArgValidity : function(target, o) {
+ if (!bindTextureTarget.has(target))
+ return false;
+ if (o != null)
+ GL.bindTexture(target, o);
+ return (o == null || GL.isTexture(o));
+ },
+ cleanup : function(target, o) {
+ GL.bindTexture(target, null);
+ if (o)
+ GL.deleteTexture(o);
+ }
+ },
+ blendColor : {
+ generate : function() { return randomColor(); },
+ teardown : function() { GL.blendColor(0,0,0,0); }
+ },
+ blendEquation : {
+ generate : function() { return [blendEquationMode.random()]; },
+ checkArgValidity : function(o) { return blendEquationMode.has(o); },
+ teardown : function() { GL.blendEquation(GL.FUNC_ADD); }
+ },
+ blendEquationSeparate : {
+ generate : function() {
+ return [blendEquationMode.random(), blendEquationMode.random()];
+ },
+ checkArgValidity : function(o,p) {
+ return blendEquationMode.has(o) && blendEquationMode.has(p);
+ },
+ teardown : function() { GL.blendEquationSeparate(GL.FUNC_ADD, GL.FUNC_ADD); }
+ },
+ blendFunc : {
+ generate : function() {
+ return [blendFuncSfactor.random(), blendFuncDfactor.random()];
+ },
+ checkArgValidity : function(s,d) {
+ return blendFuncSfactor.has(s) && blendFuncDfactor.has(d);
+ },
+ teardown : function() { GL.blendFunc(GL.ONE, GL.ZERO); }
+ },
+ blendFuncSeparate : {
+ generate : function() {
+ return [blendFuncSfactor.random(), blendFuncDfactor.random(),
+ blendFuncSfactor.random(), blendFuncDfactor.random()];
+ },
+ checkArgValidity : function(s,d,as,ad) {
+ return blendFuncSfactor.has(s) && blendFuncDfactor.has(d) &&
+ blendFuncSfactor.has(as) && blendFuncDfactor.has(ad) ;
+ },
+ teardown : function() {
+ GL.blendFuncSeparate(GL.ONE, GL.ZERO, GL.ONE, GL.ZERO);
+ }
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js
new file mode 100644
index 0000000000..2a4796d914
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B3.js
@@ -0,0 +1,68 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// B-3
+
+ bufferData : {
+ setup : function() {
+ var buf = GL.createBuffer();
+ var ebuf = GL.createBuffer();
+ GL.bindBuffer(GL.ARRAY_BUFFER, buf);
+ GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, ebuf);
+ return [buf, ebuf];
+ },
+ generate : function(buf, ebuf) {
+ return [bufferTarget.random(), randomBufferData(), bufferMode.random()];
+ },
+ checkArgValidity : function(target, bufData, mode) {
+ return bufferTarget.has(target) && isBufferData(bufData) && bufferMode.has(mode);
+ },
+ teardown : function(buf, ebuf) {
+ GL.deleteBuffer(buf);
+ GL.deleteBuffer(ebuf);
+ },
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B4.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B4.js
new file mode 100644
index 0000000000..4c1ca7d8b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-B4.js
@@ -0,0 +1,71 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// B-4
+
+ bufferSubData : {
+ setup : function() {
+ var buf = GL.createBuffer();
+ var ebuf = GL.createBuffer();
+ GL.bindBuffer(GL.ARRAY_BUFFER, buf);
+ GL.bufferData(GL.ARRAY_BUFFER, 256, GL.STATIC_DRAW);
+ GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, ebuf);
+ GL.bufferData(GL.ELEMENT_ARRAY_BUFFER, 256, GL.STATIC_DRAW);
+ return [buf, ebuf];
+ },
+ generate : function(buf, ebuf) {
+ var d = randomBufferSubData(256);
+ return [bufferTarget.random(), d.offset, d.data];
+ },
+ checkArgValidity : function(target, offset, data) {
+ return bufferTarget.has(target) && offset >= 0 && data.byteLength >= 0 && offset + data.byteLength <= 256;
+ },
+ teardown : function(buf, ebuf) {
+ GL.deleteBuffer(buf);
+ GL.deleteBuffer(ebuf);
+ },
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js
new file mode 100644
index 0000000000..fbe1c2a5c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-C.js
@@ -0,0 +1,119 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// C
+
+ checkFramebufferStatus : {
+ generate : function() {
+ return [Math.random() > 0.5 ? null : GL.createFramebuffer()];
+ },
+ checkArgValidity : function(fbo) {
+ if (fbo != null)
+ GL.bindFramebuffer(GL.FRAMEBUFFER, fbo);
+ return fbo == null || GL.isFramebuffer(fbo);
+ },
+ cleanup : function(fbo){
+ GL.bindFramebuffer(GL.FRAMEBUFFER, null);
+ if (fbo != null)
+ try{ GL.deleteFramebuffer(fbo); } catch(e) {}
+ }
+ },
+ clear : {
+ generate : function() { return [clearMask.random()]; },
+ checkArgValidity : function(mask) { return clearMask.has(mask); }
+ },
+ clearColor : {
+ generate : function() { return randomColor(); },
+ teardown : function() { GL.clearColor(0,0,0,0); }
+ },
+ clearDepth : {
+ generate : function() { return [Math.random()]; },
+ teardown : function() { GL.clearDepth(1); }
+ },
+ clearStencil : {
+ generate : function() { return [randomStencil()]; },
+ teardown : function() { GL.clearStencil(0); }
+ },
+ colorMask : {
+ generate : function() {
+ return [randomBool(), randomBool(), randomBool(), randomBool()];
+ },
+ teardown : function() { GL.colorMask(true, true, true, true); }
+ },
+ compileShader : {}, // FIXME
+ copyTexImage2D : {}, // FIXME
+ copyTexSubImage2D : {}, // FIXME
+ createBuffer : {
+ generate : function() { return []; },
+ returnValueCleanup : function(o) { GL.deleteBuffer(o); }
+ },
+ createFramebuffer : {
+ generate : function() { return []; },
+ returnValueCleanup : function(o) { GL.deleteFramebuffer(o); }
+ },
+ createProgram : {
+ generate : function() { return []; },
+ returnValueCleanup : function(o) { GL.deleteProgram(o); }
+ },
+ createRenderbuffer : {
+ generate : function() { return []; },
+ returnValueCleanup : function(o) { GL.deleteRenderbuffer(o); }
+ },
+ createShader : {
+ generate : function() { return [shaderType.random()]; },
+ checkArgValidity : function(t) { return shaderType.has(t); },
+ returnValueCleanup : function(o) { GL.deleteShader(o); }
+ },
+ createTexture : {
+ generate : function() { return []; },
+ returnValueCleanup : function(o) { GL.deleteTexture(o); }
+ },
+ cullFace : {
+ generate : function() { return [cullFace.random()]; },
+ checkArgValidity : function(f) { return cullFace.has(f); },
+ teardown : function() { GL.cullFace(GL.BACK); }
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js
new file mode 100644
index 0000000000..00e602002f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-D_G.js
@@ -0,0 +1,235 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// D
+
+ deleteBuffer : {
+ generate : function() { return [GL.createBuffer()]; },
+ checkArgValidity : function(o) {
+ GL.bindBuffer(GL.ARRAY_BUFFER, o);
+ return GL.isBuffer(o);
+ },
+ cleanup : function(o) {
+ GL.bindBuffer(GL.ARRAY_BUFFER, null);
+ try { GL.deleteBuffer(o); } catch(e) {}
+ }
+ },
+ deleteFramebuffer : {
+ generate : function() { return [GL.createFramebuffer()]; },
+ checkArgValidity : function(o) {
+ GL.bindFramebuffer(GL.FRAMEBUFFER, o);
+ return GL.isFramebuffer(o);
+ },
+ cleanup : function(o) {
+ GL.bindFramebuffer(GL.FRAMEBUFFER, null);
+ try { GL.deleteFramebuffer(o); } catch(e) {}
+ }
+ },
+ deleteProgram : {
+ generate : function() { return [GL.createProgram()]; },
+ checkArgValidity : function(o) { return GL.isProgram(o); },
+ cleanup : function(o) { try { GL.deleteProgram(o); } catch(e) {} }
+ },
+ deleteRenderbuffer : {
+ generate : function() { return [GL.createRenderbuffer()]; },
+ checkArgValidity : function(o) {
+ GL.bindRenderbuffer(GL.RENDERBUFFER, o);
+ return GL.isRenderbuffer(o);
+ },
+ cleanup : function(o) {
+ GL.bindRenderbuffer(GL.RENDERBUFFER, null);
+ try { GL.deleteRenderbuffer(o); } catch(e) {}
+ }
+ },
+ deleteShader : {
+ generate : function() { return [GL.createShader(shaderType.random())]; },
+ checkArgValidity : function(o) { return GL.isShader(o); },
+ cleanup : function(o) { try { GL.deleteShader(o); } catch(e) {} }
+ },
+ deleteTexture : {
+ generate : function() { return [GL.createTexture()]; },
+ checkArgValidity : function(o) {
+ GL.bindTexture(GL.TEXTURE_2D, o);
+ return GL.isTexture(o);
+ },
+ cleanup : function(o) {
+ GL.bindTexture(GL.TEXTURE_2D, null);
+ try { GL.deleteTexture(o); } catch(e) {}
+ }
+ },
+ depthFunc : {
+ generate : function() { return [depthFuncFunc.random()]; },
+ checkArgValidity : function(f) { return depthFuncFunc.has(f); },
+ teardown : function() { GL.depthFunc(GL.LESS); }
+ },
+ depthMask : {
+ generate : function() { return [randomBool()]; },
+ teardown : function() { GL.depthFunc(GL.TRUE); }
+ },
+ depthRange : {
+ generate : function() { return [Math.random(), Math.random()]; },
+ teardown : function() { GL.depthRange(0, 1); }
+ },
+ detachShader : {
+ generate : function() {
+ var p = GL.createProgram();
+ var sh = GL.createShader(shaderType.random());
+ GL.attachShader(p, sh);
+ return [p, sh];
+ },
+ checkArgValidity : function(p, sh) {
+ return GL.isProgram(p) && GL.isShader(sh) && GL.getAttachedShaders(p).has(sh);
+ },
+ cleanup : function(p, sh) {
+ try {GL.deleteProgram(p);} catch(e) {}
+ try {GL.deleteShader(sh);} catch(e) {}
+ }
+ },
+ disable : {
+ generate : function() { return [enableCap.random()]; },
+ checkArgValidity : function(c) { return enableCap.has(c); },
+ cleanup : function(c) { if (c == GL.DITHER) GL.enable(c); }
+ },
+ disableVertexAttribArray : {
+ generate : function() { return [randomVertexAttribute()]; },
+ checkArgValidity : function(v) { return isVertexAttribute(v); }
+ },
+ drawArrays : {}, // FIXME
+ drawElements : {}, // FIXME
+
+// E
+
+ enable : {
+ generate : function() { return [enableCap.random()]; },
+ checkArgValidity : function(c) { return enableCap.has(c); },
+ cleanup : function(c) { if (c != GL.DITHER) GL.disable(c); }
+ },
+ enableVertexAttribArray : {
+ generate : function() { return [randomVertexAttribute()]; },
+ checkArgValidity : function(v) { return isVertexAttribute(castToInt(v)); },
+ cleanup : function(v) { GL.disableVertexAttribArray(v); }
+ },
+
+// F
+
+ finish : {
+ generate : function() { return []; }
+ },
+ flush : {
+ generate : function() { return []; }
+ },
+ framebufferRenderbuffer : {}, // FIXME
+ framebufferTexture2D : {}, // FIXME
+ frontFace : {
+ generate : function() { return [frontFaceMode.random()]; },
+ checkArgValidity : function(c) { return frontFaceMode.has(c); },
+ cleanup : function(c) { GL.frontFace(GL.CCW); }
+ },
+
+// G-1
+
+ generateMipmap : {
+ setup : function() {
+ var tex = GL.createTexture();
+ var tex2 = GL.createTexture();
+ GL.bindTexture(GL.TEXTURE_2D, tex);
+ GL.bindTexture(GL.TEXTURE_CUBE_MAP, tex2);
+ var pix = new Uint8Array(16*16*4);
+ GL.texImage2D(GL.TEXTURE_2D, 0, GL.RGBA, 16, 16, 0, GL.RGBA, GL.UNSIGNED_BYTE, pix);
+ GL.texImage2D(GL.TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL.RGBA, 16, 16, 0, GL.RGBA, GL.UNSIGNED_BYTE, pix);
+ GL.texImage2D(GL.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, GL.RGBA, 16, 16, 0, GL.RGBA, GL.UNSIGNED_BYTE, pix);
+ GL.texImage2D(GL.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, GL.RGBA, 16, 16, 0, GL.RGBA, GL.UNSIGNED_BYTE, pix);
+ GL.texImage2D(GL.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, GL.RGBA, 16, 16, 0, GL.RGBA, GL.UNSIGNED_BYTE, pix);
+ GL.texImage2D(GL.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, GL.RGBA, 16, 16, 0, GL.RGBA, GL.UNSIGNED_BYTE, pix);
+ GL.texImage2D(GL.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, GL.RGBA, 16, 16, 0, GL.RGBA, GL.UNSIGNED_BYTE, pix);
+ },
+ generate : function() { return [bindTextureTarget.random()]; },
+ checkArgValidity : function(t) { return bindTextureTarget.has(t); },
+ teardown : function(tex, tex2) {
+ GL.bindTexture(GL.TEXTURE_2D, null);
+ GL.bindTexture(GL.TEXTURE_CUBE_MAP, null);
+ GL.deleteTexture(tex);
+ GL.deleteTexture(tex2);
+ }
+ },
+ getActiveAttrib : {
+ /* FIXME the queried attrib needs to be an active one
+ generate : function() {
+ var program = GL.createProgram();
+ return [program, randomVertexAttribute()];
+ },
+ checkArgValidity : function(program, index) {
+ return GL.isProgram(program) && isVertexAttribute(index);
+ },
+ cleanup : function(program, index) {
+ GL.deleteProgram(program);
+ }
+ */
+ },
+ getActiveUniform : {}, // FIXME
+ getAttachedShaders : {
+ setup : function() {
+ var program = GL.createProgram();
+ var s1 = GL.createShader(GL.VERTEX_SHADER);
+ var s2 = GL.createShader(GL.FRAGMENT_SHADER);
+ GL.attachShader(program, s1);
+ GL.attachShader(program, s2);
+ return [program, s1, s2];
+ },
+ generate : function(program, s1, s2) {
+ return [program]
+ },
+ checkArgValidity : function(program) {
+ return GL.isProgram(program);
+ },
+ teardown : function(program, s1, s2) {
+ GL.deleteProgram(program);
+ GL.deleteShader(s1);
+ GL.deleteShader(s2);
+ }
+ }
+
+};
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-G_I.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-G_I.js
new file mode 100644
index 0000000000..6aa2474241
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-G_I.js
@@ -0,0 +1,124 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// G-2
+
+ getAttribLocation : {
+ generate : function() {
+ var program = GL.createProgram();
+ var name = randomName();
+ GL.bindAttribLocation(program, randomVertexAttribute(), name);
+ return [program, name];
+ },
+ checkArgValidity : function(program, name) {
+ return GL.isProgram(program) && isValidName(name);
+ },
+ cleanup : function(program, name) {
+ try { GL.deleteProgram(program); } catch(e) {}
+ }
+ },/*
+ getParameter : {
+ generate : function() { return [getParameterPname.random()]; },
+ checkArgValidity : function(p) { return getParameterPname.has(p); }
+ },
+ getBufferParameter : {}, // FIXME
+ getError : {
+ generate : function() { return []; }
+ },
+ getFramebufferAttachmentParameter : {}, // FIXME
+ getProgramParameter : {}, // FIXME
+ getProgramInfoLog : {}, // FIXME
+ getRenderbufferParameter : {}, // FIXME
+ getShaderParameter : {}, // FIXME
+ getShaderInfoLog : {}, // FIXME
+ getShaderSource : {}, // FIXME
+ getTexParameter : {}, // FIXME
+ getUniform : {}, // FIXME
+ getUniformLocation : {}, // FIXME
+ getVertexAttrib : {}, // FIXME
+ getVertexAttribOffset : {}, // FIXME
+
+// H
+
+ hint : {
+ generate : function() { return [GL.GENERATE_MIPMAP_HINT, mipmapHint.random()]; },
+ checkValidArgs : function(h, m) {
+ return h == GL.GENERATE_MIPMAP_HINT && mipmapHint.has(m);
+ },
+ teardown : function(){ GL.hint(GL.GENERATE_MIPMAP_HINT, GL.DONT_CARE); }
+ },
+
+// I
+
+ isBuffer : {
+ generate : function() { return [GL.createBuffer()]; },
+ cleanup : function(o) { try { GL.deleteBuffer(o); } catch(e) {} }
+ },
+ isEnabled : {
+ generate : function() { return [enableCap.random()]; },
+ checkArgValidity : function(c) { return enableCap.has(c); }
+ },
+ isFramebuffer : {
+ generate : function() { return [GL.createFramebuffer()]; },
+ cleanup : function(o) { try { GL.deleteFramebuffer(o); } catch(e) {} }
+ },
+ isProgram : {
+ generate : function() { return [GL.createProgram()]; },
+ cleanup : function(o) { try { GL.deleteProgram(o); } catch(e) {} }
+ },
+ isRenderbuffer : {
+ generate : function() { return [GL.createRenderbuffer()]; },
+ cleanup : function(o) { try { GL.deleteRenderbuffer(o); } catch(e) {} }
+ },
+ isShader : {
+ generate : function() { return [GL.createShader(shaderType.random())]; },
+ cleanup : function(o) { try { GL.deleteShader(o); } catch(e) {} }
+ },
+ isTexture : {
+ generate : function() { return [GL.createTexture()]; },
+ cleanup : function(o) { try { GL.deleteTexture(o); } catch(e) {} }
+ }*/
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-L_S.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-L_S.js
new file mode 100644
index 0000000000..d3cdb3e67a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-L_S.js
@@ -0,0 +1,122 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// L
+
+ lineWidth : {
+ generate : function() { return [randomLineWidth()]; },
+ teardown : function() { GL.lineWidth(1); }
+ },
+ linkProgram : {}, // FIXME
+
+// P
+ pixelStorei : {
+ generate : function() {
+ return [pixelStoreiPname.random(), pixelStoreiParam.random()];
+ },
+ checkArgValidity : function(pname, param) {
+ return pixelStoreiPname.has(pname) && pixelStoreiParam.has(param);
+ },
+ teardown : function() {
+ GL.pixelStorei(GL.PACK_ALIGNMENT, 4);
+ GL.pixelStorei(GL.UNPACK_ALIGNMENT, 4);
+ }
+ },
+ polygonOffset : {
+ generate : function() { return [randomFloat(), randomFloat()]; },
+ teardown : function() { GL.polygonOffset(0,0); }
+ },
+
+// R
+
+ readPixels : {}, // FIXME
+ renderbufferStorage : {}, // FIXME
+
+// S-1
+
+ sampleCoverage : {
+ generate : function() { return [randomFloatFromRange(0,1), randomBool()] },
+ teardown : function() { GL.sampleCoverage(1, false); }
+ },
+ scissor : {
+ generate : function() {
+ return [randomInt(3000)-1500, randomInt(3000)-1500, randomIntFromRange(0,3000), randomIntFromRange(0,3000)];
+ },
+ checkArgValidity : function(x,y,w,h) {
+ return castToInt(w) >= 0 && castToInt(h) >= 0;
+ },
+ teardown : function() {
+ GL.scissor(0,0,GL.canvas.width, GL.canvas.height);
+ }
+ },
+ shaderSource : {}, // FIXME
+ stencilFunc : {
+ generate : function(){
+ return [stencilFuncFunc.random(), randomInt(MaxStencilValue), randomInt(0xffffffff)];
+ },
+ checkArgValidity : function(func, ref, mask) {
+ return stencilFuncFunc.has(func) && castToInt(ref) >= 0 && castToInt(ref) < MaxStencilValue;
+ },
+ teardown : function() {
+ GL.stencilFunc(GL.ALWAYS, 0, 0xffffffff);
+ }
+ },
+ stencilFuncSeparate : {
+ generate : function(){
+ return [cullFace.random(), stencilFuncFunc.random(), randomInt(MaxStencilValue), randomInt(0xffffffff)];
+ },
+ checkArgValidity : function(face, func, ref, mask) {
+ return cullFace.has(face) && stencilFuncFunc.has(func) && castToInt(ref) >= 0 && castToInt(ref) < MaxStencilValue;
+ },
+ teardown : function() {
+ GL.stencilFunc(GL.ALWAYS, 0, 0xffffffff);
+ }
+ },
+ stencilMask : {
+ generate : function() { return [randomInt(0xffffffff)]; },
+ teardown : function() { GL.stencilMask(0xffffffff); }
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js
new file mode 100644
index 0000000000..d08310001c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/argGenerators-S_V.js
@@ -0,0 +1,212 @@
+/*
+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.
+*/
+
+// ArgGenerators contains argument generators for WebGL functions.
+// The argument generators are used for running random tests against the WebGL
+// functions.
+//
+// ArgGenerators is an object consisting of functionName : argGen -properties.
+//
+// functionName is a WebGL context function name and the argGen is an argument
+// generator object that encapsulates the requirements to run
+// randomly generated tests on the WebGL function.
+//
+// An argGen object has the following methods:
+// - setup -- set up state for testing the GL function, returns values
+// that need cleanup in teardown. Run once before entering a
+// test loop.
+// - teardown -- do cleanup on setup's return values after testing is complete
+// - generate -- generate a valid set of random arguments for the GL function
+// - returnValueCleanup -- do cleanup on value returned by the tested GL function
+// - cleanup -- do cleanup on generated arguments from generate
+// - checkArgValidity -- check if passed args are valid. Has a call signature
+// that matches generate's return value. Returns true
+// if args are valid, false if not.
+//
+// Example test loop that demonstrates how the function args and return
+// values flow together:
+//
+// var setupArgs = argGen.setup();
+// for (var i=0; i<numberOfTests; i++) {
+// var generatedArgs = argGen.generate.apply(argGen, setupArgs);
+// var validArgs = argGen.checkArgValidity.apply(argGen, generatedArgs);
+// var rv = call the GL function with generatedArgs;
+// argGen.returnValueCleanup(rv);
+// argGen.cleanup.apply(argGen, generatedArgs);
+// }
+// argGen.teardown.apply(argGen, setupArgs);
+//
+ArgGenerators = {
+
+// GL functions in alphabetical order
+
+// S-2
+
+ stencilMaskSeparate : {
+ generate : function() { return [cullFace.random(), randomInt(0xffffffff)]; },
+ checkArgValidity : function(face, mask) {
+ return cullFace.has(face);
+ },
+ teardown : function() { GL.stencilMask(0xffffffff); }
+ },
+ stencilOp : {
+ generate : function() {
+ return [stencilOp.random(), stencilOp.random(), stencilOp.random()];
+ },
+ checkArgValidity : function(sfail, dpfail, dppass) {
+ return stencilOp.has(sfail) && stencilOp.has(dpfail) && stencilOp.has(dppass);
+ },
+ teardown : function() { GL.stencilOp(GL.KEEP, GL.KEEP, GL.KEEP); }
+ },
+ stencilOpSeparate : {
+ generate : function() {
+ return [cullFace.random(), stencilOp.random(), stencilOp.random(), stencilOp.random()];
+ },
+ checkArgValidity : function(face, sfail, dpfail, dppass) {
+ return cullFace.has(face) && stencilOp.has(sfail) &&
+ stencilOp.has(dpfail) && stencilOp.has(dppass);
+ },
+ teardown : function() { GL.stencilOp(GL.KEEP, GL.KEEP, GL.KEEP); }
+ },
+
+// T
+ texImage2D : {
+ noAlreadyTriedCheck : true, // Object.toSource is very slow here
+ setup : function() {
+ var tex = GL.createTexture();
+ var tex2 = GL.createTexture();
+ GL.bindTexture(GL.TEXTURE_2D, tex);
+ GL.bindTexture(GL.TEXTURE_CUBE_MAP, tex2);
+ return [tex, tex2];
+ },
+ generate : function() {
+ var format = texImageFormat.random();
+ if (Math.random() < 0.5) {
+ var img = randomImage(16,16);
+ var a = [ texImageTarget.random(), 0, format, format, GL.UNSIGNED_BYTE, img ];
+ return a;
+ } else {
+ var pix = null;
+ if (Math.random > 0.5) {
+ pix = new Uint8Array(16*16*4);
+ }
+ return [
+ texImageTarget.random(), 0,
+ format, 16, 16, 0,
+ format, GL.UNSIGNED_BYTE, pix
+ ];
+ }
+ },
+ checkArgValidity : function(target, level, internalformat, width, height, border, format, type, data) {
+ // or : function(target, level, internalformat, format, type, image)
+ if (!texImageTarget.has(target) || castToInt(level) < 0)
+ return false;
+ if (arguments.length <= 6) {
+ var xformat = width;
+ var xtype = height;
+ var ximage = border;
+ if ((ximage instanceof HTMLImageElement ||
+ ximage instanceof HTMLVideoElement ||
+ ximage instanceof HTMLCanvasElement ||
+ ximage instanceof ImageData) &&
+ texImageInternalFormat.has(internalformat) &&
+ texImageFormat.has(xformat) &&
+ texImageType.has(xtype) &&
+ internalformat == xformat)
+ return true;
+ return false;
+ }
+ var w = castToInt(width), h = castToInt(height), b = castToInt(border);
+ return texImageInternalFormat.has(internalformat) && w >= 0 && h >= 0 &&
+ b == 0 && (data == null || data.byteLength == w*h*4) &&
+ texImageFormat.has(format) && texImageType.has(type)
+ && internalformat == format;
+ },
+ teardown : function(tex, tex2) {
+ GL.bindTexture(GL.TEXTURE_2D, null);
+ GL.bindTexture(GL.TEXTURE_CUBE_MAP, null);
+ GL.deleteTexture(tex);
+ GL.deleteTexture(tex2);
+ }
+ },
+ texParameterf : {
+ generate : function() {
+ var pname = texParameterPname.random();
+ var param = texParameterParam[pname].random();
+ return [bindTextureTarget.random(), pname, param];
+ },
+ checkArgValidity : function(target, pname, param) {
+ if (!bindTextureTarget.has(target))
+ return false;
+ if (!texParameterPname.has(pname))
+ return false;
+ return texParameterParam[pname].has(param);
+ }
+ },
+ texParameteri : {
+ generate : function() {
+ var pname = texParameterPname.random();
+ var param = texParameterParam[pname].random();
+ return [bindTextureTarget.random(), pname, param];
+ },
+ checkArgValidity : function(target, pname, param) {
+ if (!bindTextureTarget.has(target))
+ return false;
+ if (!texParameterPname.has(pname))
+ return false;
+ return texParameterParam[pname].has(param);
+ }
+ },
+ texSubImage2D : {}, // FIXME
+
+// U
+
+ uniform1f : {}, // FIXME
+ uniform1fv : {}, // FIXME
+ uniform1i : {}, // FIXME
+ uniform1iv : {}, // FIXME
+ uniform2f : {}, // FIXME
+ uniform2fv : {}, // FIXME
+ uniform2i : {}, // FIXME
+ uniform2iv : {}, // FIXME
+ uniform3f : {}, // FIXME
+ uniform3fv : {}, // FIXME
+ uniform3i : {}, // FIXME
+ uniform3iv : {}, // FIXME
+ uniform4f : {}, // FIXME
+ uniform4fv : {}, // FIXME
+ uniform4i : {}, // FIXME
+ uniform4iv : {}, // FIXME
+ uniformMatrix2fv : {}, // FIXME
+ uniformMatrix3fv : {}, // FIXME
+ uniformMatrix4fv : {}, // FIXME
+ useProgram : {}, // FIXME
+
+// V
+
+ validateProgram : {}, // FIXME
+ vertexAttrib1f : {}, // FIXME
+ vertexAttrib1fv : {}, // FIXME
+ vertexAttrib2f : {}, // FIXME
+ vertexAttrib2fv : {}, // FIXME
+ vertexAttrib3f : {}, // FIXME
+ vertexAttrib3fv : {}, // FIXME
+ vertexAttrib4f : {}, // FIXME
+ vertexAttrib4fv : {}, // FIXME
+ vertexAttribPointer : {}, // FIXME
+ viewport : {
+ generate : function() {
+ return [randomInt(3000)-1500, randomInt(3000)-1500, randomIntFromRange(0,3000), randomIntFromRange(0,3000)];
+ },
+ checkArgValidity : function(x,y,w,h) {
+ return castToInt(w) >= 0 && castToInt(h) >= 0;
+ },
+ teardown : function() {
+ GL.viewport(0,0,GL.canvas.width, GL.canvas.height);
+ }
+ }
+
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html
new file mode 100644
index 0000000000..5ee9727a6e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/badArgsArityLessThanArgc.html
@@ -0,0 +1,576 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+/*
+ The following tests are generated from
+ http://www.khronos.org/registry/gles/api/2.0/gl2.h
+ and api_modifications.txt
+*/
+Tests.test_activeTexture = function(gl) {
+ assertFail(function(){ gl.activeTexture(); });
+}
+Tests.test_attachShader = function(gl) {
+ assertFail(function(){ gl.attachShader(); });
+ assertFail(function(){ gl.attachShader(0); });
+}
+Tests.test_bindAttribLocation = function(gl) {
+ assertFail(function(){ gl.bindAttribLocation(); });
+ assertFail(function(){ gl.bindAttribLocation(0); });
+ assertFail(function(){ gl.bindAttribLocation(0,0); });
+}
+Tests.test_bindBuffer = function(gl) {
+ assertFail(function(){ gl.bindBuffer(); });
+ assertFail(function(){ gl.bindBuffer(0); });
+}
+Tests.test_bindFramebuffer = function(gl) {
+ assertFail(function(){ gl.bindFramebuffer(); });
+ assertFail(function(){ gl.bindFramebuffer(0); });
+}
+Tests.test_bindRenderbuffer = function(gl) {
+ assertFail(function(){ gl.bindRenderbuffer(); });
+ assertFail(function(){ gl.bindRenderbuffer(0); });
+}
+Tests.test_bindTexture = function(gl) {
+ assertFail(function(){ gl.bindTexture(); });
+ assertFail(function(){ gl.bindTexture(0); });
+}
+Tests.test_blendColor = function(gl) {
+ assertFail(function(){ gl.blendColor(); });
+ assertFail(function(){ gl.blendColor(0); });
+ assertFail(function(){ gl.blendColor(0,0); });
+ assertFail(function(){ gl.blendColor(0,0,0); });
+}
+Tests.test_blendEquation = function(gl) {
+ assertFail(function(){ gl.blendEquation(); });
+}
+Tests.test_blendEquationSeparate = function(gl) {
+ assertFail(function(){ gl.blendEquationSeparate(); });
+ assertFail(function(){ gl.blendEquationSeparate(0); });
+}
+Tests.test_blendFunc = function(gl) {
+ assertFail(function(){ gl.blendFunc(); });
+ assertFail(function(){ gl.blendFunc(0); });
+}
+Tests.test_blendFuncSeparate = function(gl) {
+ assertFail(function(){ gl.blendFuncSeparate(); });
+ assertFail(function(){ gl.blendFuncSeparate(0); });
+ assertFail(function(){ gl.blendFuncSeparate(0,0); });
+ assertFail(function(){ gl.blendFuncSeparate(0,0,0); });
+}
+Tests.test_bufferData = function(gl) {
+ assertFail(function(){ gl.bufferData(); });
+ assertFail(function(){ gl.bufferData(0); });
+ assertFail(function(){ gl.bufferData(0,0); });
+}
+Tests.test_bufferSubData = function(gl) {
+ assertFail(function(){ gl.bufferSubData(); });
+ assertFail(function(){ gl.bufferSubData(0); });
+ assertFail(function(){ gl.bufferSubData(0,0); });
+}
+Tests.test_checkFramebufferStatus = function(gl) {
+ assertFail(function(){ gl.checkFramebufferStatus(); });
+}
+Tests.test_clear = function(gl) {
+ assertFail(function(){ gl.clear(); });
+}
+Tests.test_clearColor = function(gl) {
+ assertFail(function(){ gl.clearColor(); });
+ assertFail(function(){ gl.clearColor(0); });
+ assertFail(function(){ gl.clearColor(0,0); });
+ assertFail(function(){ gl.clearColor(0,0,0); });
+}
+Tests.test_clearDepth = function(gl) {
+ assertFail(function(){ gl.clearDepth(); });
+}
+Tests.test_clearStencil = function(gl) {
+ assertFail(function(){ gl.clearStencil(); });
+}
+Tests.test_colorMask = function(gl) {
+ assertFail(function(){ gl.colorMask(); });
+ assertFail(function(){ gl.colorMask(0); });
+ assertFail(function(){ gl.colorMask(0,0); });
+ assertFail(function(){ gl.colorMask(0,0,0); });
+}
+Tests.test_compileShader = function(gl) {
+ assertFail(function(){ gl.compileShader(); });
+}
+Tests.test_copyTexImage2D = function(gl) {
+ assertFail(function(){ gl.copyTexImage2D(); });
+ assertFail(function(){ gl.copyTexImage2D(0); });
+ assertFail(function(){ gl.copyTexImage2D(0,0); });
+ assertFail(function(){ gl.copyTexImage2D(0,0,0); });
+ assertFail(function(){ gl.copyTexImage2D(0,0,0,0); });
+ assertFail(function(){ gl.copyTexImage2D(0,0,0,0,0); });
+ assertFail(function(){ gl.copyTexImage2D(0,0,0,0,0,0); });
+ assertFail(function(){ gl.copyTexImage2D(0,0,0,0,0,0,0); });
+}
+Tests.test_copyTexSubImage2D = function(gl) {
+ assertFail(function(){ gl.copyTexSubImage2D(); });
+ assertFail(function(){ gl.copyTexSubImage2D(0); });
+ assertFail(function(){ gl.copyTexSubImage2D(0,0); });
+ assertFail(function(){ gl.copyTexSubImage2D(0,0,0); });
+ assertFail(function(){ gl.copyTexSubImage2D(0,0,0,0); });
+ assertFail(function(){ gl.copyTexSubImage2D(0,0,0,0,0); });
+ assertFail(function(){ gl.copyTexSubImage2D(0,0,0,0,0,0); });
+ assertFail(function(){ gl.copyTexSubImage2D(0,0,0,0,0,0,0); });
+}
+Tests.test_createProgram = function(gl) {
+}
+Tests.test_createShader = function(gl) {
+ assertFail(function(){ gl.createShader(); });
+}
+Tests.test_cullFace = function(gl) {
+ assertFail(function(){ gl.cullFace(); });
+}
+Tests.test_deleteBuffer = function(gl) {
+ assertFail(function(){ gl.deleteBuffer(); });
+}
+Tests.test_deleteFramebuffer = function(gl) {
+ assertFail(function(){ gl.deleteFramebuffer(); });
+}
+Tests.test_deleteProgram = function(gl) {
+ assertFail(function(){ gl.deleteProgram(); });
+}
+Tests.test_deleteRenderbuffer = function(gl) {
+ assertFail(function(){ gl.deleteRenderbuffer(); });
+}
+Tests.test_deleteShader = function(gl) {
+ assertFail(function(){ gl.deleteShader(); });
+}
+Tests.test_deleteTexture = function(gl) {
+ assertFail(function(){ gl.deleteTexture(); });
+}
+Tests.test_depthFunc = function(gl) {
+ assertFail(function(){ gl.depthFunc(); });
+}
+Tests.test_depthMask = function(gl) {
+ assertFail(function(){ gl.depthMask(); });
+}
+Tests.test_depthRange = function(gl) {
+ assertFail(function(){ gl.depthRange(); });
+ assertFail(function(){ gl.depthRange(0); });
+}
+Tests.test_detachShader = function(gl) {
+ assertFail(function(){ gl.detachShader(); });
+ assertFail(function(){ gl.detachShader(0); });
+}
+Tests.test_disable = function(gl) {
+ assertFail(function(){ gl.disable(); });
+}
+Tests.test_disableVertexAttribArray = function(gl) {
+ assertFail(function(){ gl.disableVertexAttribArray(); });
+}
+Tests.test_drawArrays = function(gl) {
+ assertFail(function(){ gl.drawArrays(); });
+ assertFail(function(){ gl.drawArrays(0); });
+ assertFail(function(){ gl.drawArrays(0,0); });
+}
+Tests.test_drawElements = function(gl) {
+ assertFail(function(){ gl.drawElements(); });
+ assertFail(function(){ gl.drawElements(0); });
+ assertFail(function(){ gl.drawElements(0,0); });
+ assertFail(function(){ gl.drawElements(0,0,0); });
+}
+Tests.test_enable = function(gl) {
+ assertFail(function(){ gl.enable(); });
+}
+Tests.test_enableVertexAttribArray = function(gl) {
+ assertFail(function(){ gl.enableVertexAttribArray(); });
+}
+Tests.test_finish = function(gl) {
+}
+Tests.test_flush = function(gl) {
+}
+Tests.test_framebufferRenderbuffer = function(gl) {
+ assertFail(function(){ gl.framebufferRenderbuffer(); });
+ assertFail(function(){ gl.framebufferRenderbuffer(0); });
+ assertFail(function(){ gl.framebufferRenderbuffer(0,0); });
+ assertFail(function(){ gl.framebufferRenderbuffer(0,0,0); });
+}
+Tests.test_framebufferTexture2D = function(gl) {
+ assertFail(function(){ gl.framebufferTexture2D(); });
+ assertFail(function(){ gl.framebufferTexture2D(0); });
+ assertFail(function(){ gl.framebufferTexture2D(0,0); });
+ assertFail(function(){ gl.framebufferTexture2D(0,0,0); });
+ assertFail(function(){ gl.framebufferTexture2D(0,0,0,0); });
+}
+Tests.test_frontFace = function(gl) {
+ assertFail(function(){ gl.frontFace(); });
+}
+Tests.test_createBuffer = function(gl) {
+}
+Tests.test_generateMipmap = function(gl) {
+ assertFail(function(){ gl.generateMipmap(); });
+}
+Tests.test_createFramebuffer = function(gl) {
+}
+Tests.test_createRenderbuffer = function(gl) {
+}
+Tests.test_createTexture = function(gl) {
+}
+Tests.test_getActiveAttrib = function(gl) {
+ assertFail(function(){ gl.getActiveAttrib(); });
+ assertFail(function(){ gl.getActiveAttrib(0); });
+}
+Tests.test_getActiveUniform = function(gl) {
+ assertFail(function(){ gl.getActiveUniform(); });
+ assertFail(function(){ gl.getActiveUniform(0); });
+}
+Tests.test_getAttachedShaders = function(gl) {
+ assertFail(function(){ gl.getAttachedShaders(); });
+}
+Tests.test_getAttribLocation = function(gl) {
+ assertFail(function(){ gl.getAttribLocation(); });
+ assertFail(function(){ gl.getAttribLocation(0); });
+}
+Tests.test_getBufferParameteri = function(gl) {
+ assertFail(function(){ gl.getBufferParameteri(); });
+ assertFail(function(){ gl.getBufferParameteri(0); });
+}
+Tests.test_getError = function(gl) {
+}
+Tests.test_getFramebufferAttachmentParameteri = function(gl) {
+ assertFail(function(){ gl.getFramebufferAttachmentParameteri(); });
+ assertFail(function(){ gl.getFramebufferAttachmentParameteri(0); });
+ assertFail(function(){ gl.getFramebufferAttachmentParameteri(0,0); });
+}
+Tests.test_getProgramInfoLog = function(gl) {
+ assertFail(function(){ gl.getProgramInfoLog(); });
+}
+Tests.test_getRenderbufferParameteri = function(gl) {
+ assertFail(function(){ gl.getRenderbufferParameteri(); });
+ assertFail(function(){ gl.getRenderbufferParameteri(0); });
+}
+Tests.test_getShaderInfoLog = function(gl) {
+ assertFail(function(){ gl.getShaderInfoLog(); });
+}
+Tests.test_getShaderSource = function(gl) {
+ assertFail(function(){ gl.getShaderSource(); });
+}
+Tests.test_getUniformLocation = function(gl) {
+ assertFail(function(){ gl.getUniformLocation(); });
+ assertFail(function(){ gl.getUniformLocation(0); });
+}
+Tests.test_hint = function(gl) {
+ assertFail(function(){ gl.hint(); });
+ assertFail(function(){ gl.hint(0); });
+}
+Tests.test_isBuffer = function(gl) {
+ assertFail(function(){ gl.isBuffer(); });
+}
+Tests.test_isEnabled = function(gl) {
+ assertFail(function(){ gl.isEnabled(); });
+}
+Tests.test_isFramebuffer = function(gl) {
+ assertFail(function(){ gl.isFramebuffer(); });
+}
+Tests.test_isProgram = function(gl) {
+ assertFail(function(){ gl.isProgram(); });
+}
+Tests.test_isRenderbuffer = function(gl) {
+ assertFail(function(){ gl.isRenderbuffer(); });
+}
+Tests.test_isShader = function(gl) {
+ assertFail(function(){ gl.isShader(); });
+}
+Tests.test_isTexture = function(gl) {
+ assertFail(function(){ gl.isTexture(); });
+}
+Tests.test_lineWidth = function(gl) {
+ assertFail(function(){ gl.lineWidth(); });
+}
+Tests.test_linkProgram = function(gl) {
+ assertFail(function(){ gl.linkProgram(); });
+}
+Tests.test_polygonOffset = function(gl) {
+ assertFail(function(){ gl.polygonOffset(); });
+ assertFail(function(){ gl.polygonOffset(0); });
+}
+Tests.test_readPixels = function(gl) {
+ assertFail(function(){ gl.readPixels(); });
+ assertFail(function(){ gl.readPixels(0); });
+ assertFail(function(){ gl.readPixels(0,0); });
+ assertFail(function(){ gl.readPixels(0,0,0); });
+ assertFail(function(){ gl.readPixels(0,0,0,0); });
+ assertFail(function(){ gl.readPixels(0,0,0,0,0); });
+}
+Tests.test_renderbufferStorage = function(gl) {
+ assertFail(function(){ gl.renderbufferStorage(); });
+ assertFail(function(){ gl.renderbufferStorage(0); });
+ assertFail(function(){ gl.renderbufferStorage(0,0); });
+ assertFail(function(){ gl.renderbufferStorage(0,0,0); });
+}
+Tests.test_sampleCoverage = function(gl) {
+ assertFail(function(){ gl.sampleCoverage(); });
+ assertFail(function(){ gl.sampleCoverage(0); });
+}
+Tests.test_scissor = function(gl) {
+ assertFail(function(){ gl.scissor(); });
+ assertFail(function(){ gl.scissor(0); });
+ assertFail(function(){ gl.scissor(0,0); });
+ assertFail(function(){ gl.scissor(0,0,0); });
+}
+Tests.test_shaderSource = function(gl) {
+ assertFail(function(){ gl.shaderSource(); });
+ assertFail(function(){ gl.shaderSource(0); });
+}
+Tests.test_stencilFunc = function(gl) {
+ assertFail(function(){ gl.stencilFunc(); });
+ assertFail(function(){ gl.stencilFunc(0); });
+ assertFail(function(){ gl.stencilFunc(0,0); });
+}
+Tests.test_stencilFuncSeparate = function(gl) {
+ assertFail(function(){ gl.stencilFuncSeparate(); });
+ assertFail(function(){ gl.stencilFuncSeparate(0); });
+ assertFail(function(){ gl.stencilFuncSeparate(0,0); });
+ assertFail(function(){ gl.stencilFuncSeparate(0,0,0); });
+}
+Tests.test_stencilMask = function(gl) {
+ assertFail(function(){ gl.stencilMask(); });
+}
+Tests.test_stencilMaskSeparate = function(gl) {
+ assertFail(function(){ gl.stencilMaskSeparate(); });
+ assertFail(function(){ gl.stencilMaskSeparate(0); });
+}
+Tests.test_stencilOp = function(gl) {
+ assertFail(function(){ gl.stencilOp(); });
+ assertFail(function(){ gl.stencilOp(0); });
+ assertFail(function(){ gl.stencilOp(0,0); });
+}
+Tests.test_stencilOpSeparate = function(gl) {
+ assertFail(function(){ gl.stencilOpSeparate(); });
+ assertFail(function(){ gl.stencilOpSeparate(0); });
+ assertFail(function(){ gl.stencilOpSeparate(0,0); });
+ assertFail(function(){ gl.stencilOpSeparate(0,0,0); });
+}
+Tests.test_texImage2D = function(gl) {
+ assertFail(function(){ gl.texImage2D(); });
+ assertFail(function(){ gl.texImage2D(0); });
+ assertFail(function(){ gl.texImage2D(0,0); });
+}
+Tests.test_texParameteri = function(gl) {
+ assertFail(function(){ gl.texParameteri(); });
+ assertFail(function(){ gl.texParameteri(0); });
+ assertFail(function(){ gl.texParameteri(0,0); });
+}
+Tests.test_texSubImage2D = function(gl) {
+ assertFail(function(){ gl.texSubImage2D(); });
+ assertFail(function(){ gl.texSubImage2D(0); });
+ assertFail(function(){ gl.texSubImage2D(0,0); });
+ assertFail(function(){ gl.texSubImage2D(0,0,0); });
+ assertFail(function(){ gl.texSubImage2D(0,0,0,0); });
+ assertFail(function(){ gl.texSubImage2D(0,0,0,0,0); });
+ assertFail(function(){ gl.texSubImage2D(0,0,0,0,0,0); });
+ assertFail(function(){ gl.texSubImage2D(0,0,0,0,0,0,0); });
+ assertFail(function(){ gl.texSubImage2D(0,0,0,0,0,0,0,0); });
+}
+Tests.test_uniform1f = function(gl) {
+ assertFail(function(){ gl.uniform1f(); });
+ assertFail(function(){ gl.uniform1f(0); });
+}
+Tests.test_uniform1fv = function(gl) {
+ assertFail(function(){ gl.uniform1fv(); });
+ assertFail(function(){ gl.uniform1fv(0); });
+}
+Tests.test_uniform1i = function(gl) {
+ assertFail(function(){ gl.uniform1i(); });
+ assertFail(function(){ gl.uniform1i(0); });
+}
+Tests.test_uniform1iv = function(gl) {
+ assertFail(function(){ gl.uniform1iv(); });
+ assertFail(function(){ gl.uniform1iv(0); });
+}
+Tests.test_uniform2f = function(gl) {
+ assertFail(function(){ gl.uniform2f(); });
+ assertFail(function(){ gl.uniform2f(0); });
+ assertFail(function(){ gl.uniform2f(0,0); });
+}
+Tests.test_uniform2fv = function(gl) {
+ assertFail(function(){ gl.uniform2fv(); });
+ assertFail(function(){ gl.uniform2fv(0); });
+}
+Tests.test_uniform2i = function(gl) {
+ assertFail(function(){ gl.uniform2i(); });
+ assertFail(function(){ gl.uniform2i(0); });
+ assertFail(function(){ gl.uniform2i(0,0); });
+}
+Tests.test_uniform2iv = function(gl) {
+ assertFail(function(){ gl.uniform2iv(); });
+ assertFail(function(){ gl.uniform2iv(0); });
+}
+Tests.test_uniform3f = function(gl) {
+ assertFail(function(){ gl.uniform3f(); });
+ assertFail(function(){ gl.uniform3f(0); });
+ assertFail(function(){ gl.uniform3f(0,0); });
+ assertFail(function(){ gl.uniform3f(0,0,0); });
+}
+Tests.test_uniform3fv = function(gl) {
+ assertFail(function(){ gl.uniform3fv(); });
+ assertFail(function(){ gl.uniform3fv(0); });
+}
+Tests.test_uniform3i = function(gl) {
+ assertFail(function(){ gl.uniform3i(); });
+ assertFail(function(){ gl.uniform3i(0); });
+ assertFail(function(){ gl.uniform3i(0,0); });
+ assertFail(function(){ gl.uniform3i(0,0,0); });
+}
+Tests.test_uniform3iv = function(gl) {
+ assertFail(function(){ gl.uniform3iv(); });
+ assertFail(function(){ gl.uniform3iv(0); });
+}
+Tests.test_uniform4f = function(gl) {
+ assertFail(function(){ gl.uniform4f(); });
+ assertFail(function(){ gl.uniform4f(0); });
+ assertFail(function(){ gl.uniform4f(0,0); });
+ assertFail(function(){ gl.uniform4f(0,0,0); });
+ assertFail(function(){ gl.uniform4f(0,0,0,0); });
+}
+Tests.test_uniform4fv = function(gl) {
+ assertFail(function(){ gl.uniform4fv(); });
+ assertFail(function(){ gl.uniform4fv(0); });
+}
+Tests.test_uniform4i = function(gl) {
+ assertFail(function(){ gl.uniform4i(); });
+ assertFail(function(){ gl.uniform4i(0); });
+ assertFail(function(){ gl.uniform4i(0,0); });
+ assertFail(function(){ gl.uniform4i(0,0,0); });
+ assertFail(function(){ gl.uniform4i(0,0,0,0); });
+}
+Tests.test_uniform4iv = function(gl) {
+ assertFail(function(){ gl.uniform4iv(); });
+ assertFail(function(){ gl.uniform4iv(0); });
+}
+Tests.test_uniformMatrix2fv = function(gl) {
+ assertFail(function(){ gl.uniformMatrix2fv(); });
+ assertFail(function(){ gl.uniformMatrix2fv(0); });
+ assertFail(function(){ gl.uniformMatrix2fv(0,0); });
+}
+Tests.test_uniformMatrix3fv = function(gl) {
+ assertFail(function(){ gl.uniformMatrix3fv(); });
+ assertFail(function(){ gl.uniformMatrix3fv(0); });
+ assertFail(function(){ gl.uniformMatrix3fv(0,0); });
+}
+Tests.test_uniformMatrix4fv = function(gl) {
+ assertFail(function(){ gl.uniformMatrix4fv(); });
+ assertFail(function(){ gl.uniformMatrix4fv(0); });
+ assertFail(function(){ gl.uniformMatrix4fv(0,0); });
+}
+Tests.test_useProgram = function(gl) {
+ assertFail(function(){ gl.useProgram(); });
+}
+Tests.test_validateProgram = function(gl) {
+ assertFail(function(){ gl.validateProgram(); });
+}
+Tests.test_vertexAttrib1f = function(gl) {
+ assertFail(function(){ gl.vertexAttrib1f(); });
+ assertFail(function(){ gl.vertexAttrib1f(0); });
+}
+Tests.test_vertexAttrib1fv = function(gl) {
+ assertFail(function(){ gl.vertexAttrib1fv(); });
+ assertFail(function(){ gl.vertexAttrib1fv(0); });
+}
+Tests.test_vertexAttrib2f = function(gl) {
+ assertFail(function(){ gl.vertexAttrib2f(); });
+ assertFail(function(){ gl.vertexAttrib2f(0); });
+ assertFail(function(){ gl.vertexAttrib2f(0,0); });
+}
+Tests.test_vertexAttrib2fv = function(gl) {
+ assertFail(function(){ gl.vertexAttrib2fv(); });
+ assertFail(function(){ gl.vertexAttrib2fv(0); });
+}
+Tests.test_vertexAttrib3f = function(gl) {
+ assertFail(function(){ gl.vertexAttrib3f(); });
+ assertFail(function(){ gl.vertexAttrib3f(0); });
+ assertFail(function(){ gl.vertexAttrib3f(0,0); });
+ assertFail(function(){ gl.vertexAttrib3f(0,0,0); });
+}
+Tests.test_vertexAttrib3fv = function(gl) {
+ assertFail(function(){ gl.vertexAttrib3fv(); });
+ assertFail(function(){ gl.vertexAttrib3fv(0); });
+}
+Tests.test_vertexAttrib4f = function(gl) {
+ assertFail(function(){ gl.vertexAttrib4f(); });
+ assertFail(function(){ gl.vertexAttrib4f(0); });
+ assertFail(function(){ gl.vertexAttrib4f(0,0); });
+ assertFail(function(){ gl.vertexAttrib4f(0,0,0); });
+ assertFail(function(){ gl.vertexAttrib4f(0,0,0,0); });
+}
+Tests.test_vertexAttrib4fv = function(gl) {
+ assertFail(function(){ gl.vertexAttrib4fv(); });
+ assertFail(function(){ gl.vertexAttrib4fv(0); });
+}
+Tests.test_vertexAttribPointer = function(gl) {
+ assertFail(function(){ gl.vertexAttribPointer(); });
+ assertFail(function(){ gl.vertexAttribPointer(0); });
+ assertFail(function(){ gl.vertexAttribPointer(0,0); });
+ assertFail(function(){ gl.vertexAttribPointer(0,0,0); });
+ assertFail(function(){ gl.vertexAttribPointer(0,0,0,0); });
+ assertFail(function(){ gl.vertexAttribPointer(0,0,0,0,0); });
+}
+Tests.test_viewport = function(gl) {
+ assertFail(function(){ gl.viewport(); });
+ assertFail(function(){ gl.viewport(0); });
+ assertFail(function(){ gl.viewport(0,0); });
+ assertFail(function(){ gl.viewport(0,0,0); });
+}
+Tests.test_currentArrayBufferBinding = function(gl) {
+}
+Tests.test_currentElementArrayBufferBinding = function(gl) {
+}
+Tests.test_currentFramebufferBinding = function(gl) {
+}
+Tests.test_currentRenderbufferBinding = function(gl) {
+}
+Tests.test_currentTextureBinding2D = function(gl) {
+}
+Tests.test_currentTextureBindingCubeMap = function(gl) {
+}
+Tests.test_currentProgram = function(gl) {
+}
+Tests.test_getParameter = function(gl) {
+ assertFail(function(){ gl.getParameter(); });
+}
+Tests.test_getProgramParameter = function(gl) {
+ assertFail(function(){ gl.getProgramParameter(); });
+ assertFail(function(){ gl.getProgramParameter(0); });
+}
+Tests.test_getShaderParameter = function(gl) {
+ assertFail(function(){ gl.getShaderParameter(); });
+ assertFail(function(){ gl.getShaderParameter(0); });
+}
+Tests.test_getTexParameteri = function(gl) {
+ assertFail(function(){ gl.getTexParameteri(); });
+ assertFail(function(){ gl.getTexParameteri(0); });
+}
+Tests.test_getUniformi = function(gl) {
+ assertFail(function(){ gl.getUniformi(); });
+ assertFail(function(){ gl.getUniformi(0); });
+}
+Tests.test_getVertexAttribi = function(gl) {
+ assertFail(function(){ gl.getVertexAttribi(); });
+ assertFail(function(){ gl.getVertexAttribi(0); });
+}
+Tests.test_present = function(gl) {
+}
+Tests.startUnit = function() {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html
new file mode 100644
index 0000000000..61997afae6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/constants.html
@@ -0,0 +1,350 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+/*
+ The following tests are generated from
+ http://www.khronos.org/registry/gles/api/2.0/gl2.h
+ and api_modifications.txt
+*/
+var constants = {
+DEPTH_BUFFER_BIT : 0x00000100,
+STENCIL_BUFFER_BIT : 0x00000400,
+COLOR_BUFFER_BIT : 0x00004000,
+POINTS : 0x0000,
+LINES : 0x0001,
+LINE_LOOP : 0x0002,
+LINE_STRIP : 0x0003,
+TRIANGLES : 0x0004,
+TRIANGLE_STRIP : 0x0005,
+TRIANGLE_FAN : 0x0006,
+ZERO : 0,
+ONE : 1,
+SRC_COLOR : 0x0300,
+ONE_MINUS_SRC_COLOR : 0x0301,
+SRC_ALPHA : 0x0302,
+ONE_MINUS_SRC_ALPHA : 0x0303,
+DST_ALPHA : 0x0304,
+ONE_MINUS_DST_ALPHA : 0x0305,
+DST_COLOR : 0x0306,
+ONE_MINUS_DST_COLOR : 0x0307,
+SRC_ALPHA_SATURATE : 0x0308,
+FUNC_ADD : 0x8006,
+BLEND_EQUATION : 0x8009,
+BLEND_EQUATION_RGB : 0x8009,
+BLEND_EQUATION_ALPHA : 0x883D,
+FUNC_SUBTRACT : 0x800A,
+FUNC_REVERSE_SUBTRACT : 0x800B,
+BLEND_DST_RGB : 0x80C8,
+BLEND_SRC_RGB : 0x80C9,
+BLEND_DST_ALPHA : 0x80CA,
+BLEND_SRC_ALPHA : 0x80CB,
+CONSTANT_COLOR : 0x8001,
+ONE_MINUS_CONSTANT_COLOR : 0x8002,
+CONSTANT_ALPHA : 0x8003,
+ONE_MINUS_CONSTANT_ALPHA : 0x8004,
+BLEND_COLOR : 0x8005,
+ARRAY_BUFFER : 0x8892,
+ELEMENT_ARRAY_BUFFER : 0x8893,
+ARRAY_BUFFER_BINDING : 0x8894,
+ELEMENT_ARRAY_BUFFER_BINDING : 0x8895,
+STREAM_DRAW : 0x88E0,
+STATIC_DRAW : 0x88E4,
+DYNAMIC_DRAW : 0x88E8,
+BUFFER_SIZE : 0x8764,
+BUFFER_USAGE : 0x8765,
+CURRENT_VERTEX_ATTRIB : 0x8626,
+FRONT : 0x0404,
+BACK : 0x0405,
+FRONT_AND_BACK : 0x0408,
+TEXTURE_2D : 0x0DE1,
+CULL_FACE : 0x0B44,
+BLEND : 0x0BE2,
+DITHER : 0x0BD0,
+STENCIL_TEST : 0x0B90,
+DEPTH_TEST : 0x0B71,
+SCISSOR_TEST : 0x0C11,
+POLYGON_OFFSET_FILL : 0x8037,
+SAMPLE_ALPHA_TO_COVERAGE : 0x809E,
+SAMPLE_COVERAGE : 0x80A0,
+NO_ERROR : 0,
+INVALID_ENUM : 0x0500,
+INVALID_VALUE : 0x0501,
+INVALID_OPERATION : 0x0502,
+OUT_OF_MEMORY : 0x0505,
+CW : 0x0900,
+CCW : 0x0901,
+LINE_WIDTH : 0x0B21,
+ALIASED_POINT_SIZE_RANGE : 0x846D,
+ALIASED_LINE_WIDTH_RANGE : 0x846E,
+CULL_FACE_MODE : 0x0B45,
+FRONT_FACE : 0x0B46,
+DEPTH_RANGE : 0x0B70,
+DEPTH_WRITEMASK : 0x0B72,
+DEPTH_CLEAR_VALUE : 0x0B73,
+DEPTH_FUNC : 0x0B74,
+STENCIL_CLEAR_VALUE : 0x0B91,
+STENCIL_FUNC : 0x0B92,
+STENCIL_FAIL : 0x0B94,
+STENCIL_PASS_DEPTH_FAIL : 0x0B95,
+STENCIL_PASS_DEPTH_PASS : 0x0B96,
+STENCIL_REF : 0x0B97,
+STENCIL_VALUE_MASK : 0x0B93,
+STENCIL_WRITEMASK : 0x0B98,
+STENCIL_BACK_FUNC : 0x8800,
+STENCIL_BACK_FAIL : 0x8801,
+STENCIL_BACK_PASS_DEPTH_FAIL : 0x8802,
+STENCIL_BACK_PASS_DEPTH_PASS : 0x8803,
+STENCIL_BACK_REF : 0x8CA3,
+STENCIL_BACK_VALUE_MASK : 0x8CA4,
+STENCIL_BACK_WRITEMASK : 0x8CA5,
+VIEWPORT : 0x0BA2,
+SCISSOR_BOX : 0x0C10,
+COLOR_CLEAR_VALUE : 0x0C22,
+COLOR_WRITEMASK : 0x0C23,
+UNPACK_ALIGNMENT : 0x0CF5,
+PACK_ALIGNMENT : 0x0D05,
+MAX_TEXTURE_SIZE : 0x0D33,
+MAX_VIEWPORT_DIMS : 0x0D3A,
+SUBPIXEL_BITS : 0x0D50,
+RED_BITS : 0x0D52,
+GREEN_BITS : 0x0D53,
+BLUE_BITS : 0x0D54,
+ALPHA_BITS : 0x0D55,
+DEPTH_BITS : 0x0D56,
+STENCIL_BITS : 0x0D57,
+POLYGON_OFFSET_UNITS : 0x2A00,
+POLYGON_OFFSET_FACTOR : 0x8038,
+TEXTURE_BINDING_2D : 0x8069,
+SAMPLE_BUFFERS : 0x80A8,
+SAMPLES : 0x80A9,
+SAMPLE_COVERAGE_VALUE : 0x80AA,
+SAMPLE_COVERAGE_INVERT : 0x80AB,
+COMPRESSED_TEXTURE_FORMATS : 0x86A3,
+DONT_CARE : 0x1100,
+FASTEST : 0x1101,
+NICEST : 0x1102,
+GENERATE_MIPMAP_HINT : 0x8192,
+BYTE : 0x1400,
+UNSIGNED_BYTE : 0x1401,
+SHORT : 0x1402,
+UNSIGNED_SHORT : 0x1403,
+INT : 0x1404,
+UNSIGNED_INT : 0x1405,
+FLOAT : 0x1406,
+//FIXED : 0x140C,
+DEPTH_COMPONENT : 0x1902,
+ALPHA : 0x1906,
+RGB : 0x1907,
+RGBA : 0x1908,
+LUMINANCE : 0x1909,
+LUMINANCE_ALPHA : 0x190A,
+UNSIGNED_SHORT_4_4_4_4 : 0x8033,
+UNSIGNED_SHORT_5_5_5_1 : 0x8034,
+UNSIGNED_SHORT_5_6_5 : 0x8363,
+FRAGMENT_SHADER : 0x8B30,
+VERTEX_SHADER : 0x8B31,
+MAX_VERTEX_ATTRIBS : 0x8869,
+MAX_VERTEX_UNIFORM_VECTORS : 0x8DFB,
+MAX_VARYING_VECTORS : 0x8DFC,
+MAX_COMBINED_TEXTURE_IMAGE_UNITS : 0x8B4D,
+MAX_VERTEX_TEXTURE_IMAGE_UNITS : 0x8B4C,
+MAX_TEXTURE_IMAGE_UNITS : 0x8872,
+MAX_FRAGMENT_UNIFORM_VECTORS : 0x8DFD,
+SHADER_TYPE : 0x8B4F,
+DELETE_STATUS : 0x8B80,
+LINK_STATUS : 0x8B82,
+VALIDATE_STATUS : 0x8B83,
+ATTACHED_SHADERS : 0x8B85,
+ACTIVE_UNIFORMS : 0x8B86,
+ACTIVE_ATTRIBUTES : 0x8B89,
+SHADING_LANGUAGE_VERSION : 0x8B8C,
+CURRENT_PROGRAM : 0x8B8D,
+NEVER : 0x0200,
+LESS : 0x0201,
+EQUAL : 0x0202,
+LEQUAL : 0x0203,
+GREATER : 0x0204,
+NOTEQUAL : 0x0205,
+GEQUAL : 0x0206,
+ALWAYS : 0x0207,
+KEEP : 0x1E00,
+REPLACE : 0x1E01,
+INCR : 0x1E02,
+DECR : 0x1E03,
+INVERT : 0x150A,
+INCR_WRAP : 0x8507,
+DECR_WRAP : 0x8508,
+VENDOR : 0x1F00,
+RENDERER : 0x1F01,
+VERSION : 0x1F02,
+//EXTENSIONS : 0x1F03,
+NEAREST : 0x2600,
+LINEAR : 0x2601,
+NEAREST_MIPMAP_NEAREST : 0x2700,
+LINEAR_MIPMAP_NEAREST : 0x2701,
+NEAREST_MIPMAP_LINEAR : 0x2702,
+LINEAR_MIPMAP_LINEAR : 0x2703,
+TEXTURE_MAG_FILTER : 0x2800,
+TEXTURE_MIN_FILTER : 0x2801,
+TEXTURE_WRAP_S : 0x2802,
+TEXTURE_WRAP_T : 0x2803,
+TEXTURE : 0x1702,
+TEXTURE_CUBE_MAP : 0x8513,
+TEXTURE_BINDING_CUBE_MAP : 0x8514,
+TEXTURE_CUBE_MAP_POSITIVE_X : 0x8515,
+TEXTURE_CUBE_MAP_NEGATIVE_X : 0x8516,
+TEXTURE_CUBE_MAP_POSITIVE_Y : 0x8517,
+TEXTURE_CUBE_MAP_NEGATIVE_Y : 0x8518,
+TEXTURE_CUBE_MAP_POSITIVE_Z : 0x8519,
+TEXTURE_CUBE_MAP_NEGATIVE_Z : 0x851A,
+MAX_CUBE_MAP_TEXTURE_SIZE : 0x851C,
+TEXTURE0 : 0x84C0,
+TEXTURE1 : 0x84C1,
+TEXTURE2 : 0x84C2,
+TEXTURE3 : 0x84C3,
+TEXTURE4 : 0x84C4,
+TEXTURE5 : 0x84C5,
+TEXTURE6 : 0x84C6,
+TEXTURE7 : 0x84C7,
+TEXTURE8 : 0x84C8,
+TEXTURE9 : 0x84C9,
+TEXTURE10 : 0x84CA,
+TEXTURE11 : 0x84CB,
+TEXTURE12 : 0x84CC,
+TEXTURE13 : 0x84CD,
+TEXTURE14 : 0x84CE,
+TEXTURE15 : 0x84CF,
+TEXTURE16 : 0x84D0,
+TEXTURE17 : 0x84D1,
+TEXTURE18 : 0x84D2,
+TEXTURE19 : 0x84D3,
+TEXTURE20 : 0x84D4,
+TEXTURE21 : 0x84D5,
+TEXTURE22 : 0x84D6,
+TEXTURE23 : 0x84D7,
+TEXTURE24 : 0x84D8,
+TEXTURE25 : 0x84D9,
+TEXTURE26 : 0x84DA,
+TEXTURE27 : 0x84DB,
+TEXTURE28 : 0x84DC,
+TEXTURE29 : 0x84DD,
+TEXTURE30 : 0x84DE,
+TEXTURE31 : 0x84DF,
+ACTIVE_TEXTURE : 0x84E0,
+REPEAT : 0x2901,
+CLAMP_TO_EDGE : 0x812F,
+MIRRORED_REPEAT : 0x8370,
+FLOAT_VEC2 : 0x8B50,
+FLOAT_VEC3 : 0x8B51,
+FLOAT_VEC4 : 0x8B52,
+INT_VEC2 : 0x8B53,
+INT_VEC3 : 0x8B54,
+INT_VEC4 : 0x8B55,
+BOOL : 0x8B56,
+BOOL_VEC2 : 0x8B57,
+BOOL_VEC3 : 0x8B58,
+BOOL_VEC4 : 0x8B59,
+FLOAT_MAT2 : 0x8B5A,
+FLOAT_MAT3 : 0x8B5B,
+FLOAT_MAT4 : 0x8B5C,
+SAMPLER_2D : 0x8B5E,
+SAMPLER_CUBE : 0x8B60,
+VERTEX_ATTRIB_ARRAY_ENABLED : 0x8622,
+VERTEX_ATTRIB_ARRAY_SIZE : 0x8623,
+VERTEX_ATTRIB_ARRAY_STRIDE : 0x8624,
+VERTEX_ATTRIB_ARRAY_TYPE : 0x8625,
+VERTEX_ATTRIB_ARRAY_NORMALIZED : 0x886A,
+VERTEX_ATTRIB_ARRAY_POINTER : 0x8645,
+VERTEX_ATTRIB_ARRAY_BUFFER_BINDING : 0x889F,
+//IMPLEMENTATION_COLOR_READ_TYPE : 0x8B9A,
+//IMPLEMENTATION_COLOR_READ_FORMAT : 0x8B9B,
+COMPILE_STATUS : 0x8B81,
+//SHADER_COMPILER : 0x8DFA,
+LOW_FLOAT : 0x8DF0,
+MEDIUM_FLOAT : 0x8DF1,
+HIGH_FLOAT : 0x8DF2,
+LOW_INT : 0x8DF3,
+MEDIUM_INT : 0x8DF4,
+HIGH_INT : 0x8DF5,
+FRAMEBUFFER : 0x8D40,
+RENDERBUFFER : 0x8D41,
+RGBA4 : 0x8056,
+RGB5_A1 : 0x8057,
+RGB565 : 0x8D62,
+DEPTH_COMPONENT16 : 0x81A5,
+STENCIL_INDEX8 : 0x8D48,
+DEPTH_STENCIL : 0x84F9,
+RENDERBUFFER_WIDTH : 0x8D42,
+RENDERBUFFER_HEIGHT : 0x8D43,
+RENDERBUFFER_INTERNAL_FORMAT : 0x8D44,
+RENDERBUFFER_RED_SIZE : 0x8D50,
+RENDERBUFFER_GREEN_SIZE : 0x8D51,
+RENDERBUFFER_BLUE_SIZE : 0x8D52,
+RENDERBUFFER_ALPHA_SIZE : 0x8D53,
+RENDERBUFFER_DEPTH_SIZE : 0x8D54,
+RENDERBUFFER_STENCIL_SIZE : 0x8D55,
+FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE : 0x8CD0,
+FRAMEBUFFER_ATTACHMENT_OBJECT_NAME : 0x8CD1,
+FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL : 0x8CD2,
+FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE : 0x8CD3,
+COLOR_ATTACHMENT0 : 0x8CE0,
+DEPTH_ATTACHMENT : 0x8D00,
+STENCIL_ATTACHMENT : 0x8D20,
+DEPTH_STENCIL_ATTACHMENT : 0x821A,
+NONE : 0,
+FRAMEBUFFER_COMPLETE : 0x8CD5,
+FRAMEBUFFER_INCOMPLETE_ATTACHMENT : 0x8CD6,
+FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : 0x8CD7,
+FRAMEBUFFER_INCOMPLETE_DIMENSIONS : 0x8CD9,
+FRAMEBUFFER_UNSUPPORTED : 0x8CDD,
+FRAMEBUFFER_BINDING : 0x8CA6,
+RENDERBUFFER_BINDING : 0x8CA7,
+MAX_RENDERBUFFER_SIZE : 0x84E8,
+INVALID_FRAMEBUFFER_OPERATION : 0x0506,
+//FALSE : 0,
+//TRUE : 1,
+UNPACK_FLIP_Y_WEBGL : 0x9240,
+UNPACK_PREMULTIPLY_ALPHA_WEBGL : 0x9241
+}
+
+Tests.testOES20Constants = function(gl) {
+ for (var i in constants) {
+ assertProperty(gl, i) &&
+ assertEquals(i, gl[i], constants[i]);
+ }
+ var extended = false;
+ for (var i in gl) {
+ if (i.match(/^[A-Z_]+$/) && constants[i] == null) {
+ if (!extended) {
+ extended = true;
+ var h = document.createElement('h3');
+ h.textContent = "Also found the following extra constants";
+ __testLog__.appendChild(h);
+ }
+ log(i);
+ }
+ }
+}
+
+Tests.startUnit = function() {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html
new file mode 100644
index 0000000000..c1090aeb4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/fuzzTheAPI.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+
+<script type="application/javascript">
+
+Tests.autorun = false;
+Tests.message = "This will fuzz the API with random inputs for a [long] while."
+
+
+function randomCall(testProgress, gl, m, arities) {
+ doTestNotify(m);
+ var argcs = {};
+ var foundArity = false;
+ if (arities == null) {
+ testProgress.textContent += " 500 random arity calls on " + m + "\n";
+ for (var i=0; i<50; i++) {
+ for (var j=0; j<10; j++) {
+ var args = generateRandomArgs(j);
+// doTestNotify(m + ": " + args.toSource());
+ try {
+ gl[m].apply(gl, args);
+ argcs[j] = true;
+ foundArity = true;
+ } catch (e) {
+ }
+ }
+ }
+ for (var j in argcs) {
+ testProgress.textContent += "200 arity " + j + " calls on " + m + "\n";
+ for (var i=0; i<200; i++) {
+ var args = generateRandomArgs(j);
+// doTestNotify(m + ": " + args.toSource());
+ try {
+ gl[m].apply(gl, args);
+ argcs[j] = true;
+ } catch (e) {
+ }
+ }
+ }
+ } else {
+ for (var k=0; k<arities.length; k++) {
+ var j = arities[k];
+ testProgress.textContent += "500 arity " + j + " calls on " + m + "\n";
+ for (var i=0; i<500; i++) {
+ var args = generateRandomArgs(j);
+// doTestNotify(m + ": " + args.toSource());
+ try {
+ gl[m].apply(gl, args);
+ } catch (e) {
+ }
+ }
+ }
+ }
+// doTestNotify(m+"--OK");
+}
+
+Tests.testGetGLWeb20 = function() {
+ var testProgress = document.getElementById('testProgress');
+ var funcnames = document.getElementById('funcnames').value.split(",");
+ var canvas = document.getElementById('glweb20');
+ var gl;
+ assertOk(function(){gl = getGLContext(canvas);});
+ var funcs = [];
+ for (var i=0; i<funcnames.length; i++) {
+ var fn = funcnames[i];
+ fn = fn.replace(/^\s+|\s+$/g, '');
+ if (fn.length > 0)
+ funcs.push(fn);
+ }
+ if (funcs.length == 0) {
+ for (var m in gl)
+ try{if (typeof gl[m] == 'function')
+ funcs.push(m);}catch(e){}
+ }
+ var idx = 0;
+ var count = 0;
+ var limit = 1000;
+ var iv1;
+ var iv2;
+ iv1 = setInterval(function(){
+ if (idx >= funcs.length) {
+ iv2 = setInterval(function(){
+ if (count >= limit) {
+ clearInterval(iv2);
+ return false;
+ }
+ count++;
+ var f = Math.floor(Math.random() * funcs.length);
+ randomCall(testProgress, gl, funcs[f]);
+ }, 50);
+ clearInterval(iv1);
+ return false;
+ }
+ randomCall(testProgress, gl, funcs[idx]);
+ idx++;
+ }, 50);
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="glweb20" width="16" height="16"></canvas>
+ <p>Optional: Enter a comma-separated list of functions to fuzz (leave blank for full API)</p>
+ <input type="text" size="40" id="funcnames" value="">
+ <pre id="testProgress"></pre>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html
new file mode 100644
index 0000000000..14c0559123
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/getContext.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+
+<script type="application/javascript">
+
+Tests.testGetWebGL = function() {
+ var canvas = document.getElementById('webgl');
+ var gl;
+ assertOk(function(){gl = getGLContext(canvas)});
+ assertEquals("ctx.canvas === canvas", gl.canvas, canvas);
+ assertOk(function(){g2d = canvas.getContext('2d')});
+ assert("Should get a null 2d context after getting webgl context", g2d === null);
+}
+
+Tests.testGet2D = function() {
+ var canvas = document.getElementById('2d');
+ var g2d;
+ var gl;
+ assertOk(function(){g2d = canvas.getContext('2d')});
+ assertOk(function(){gl = getGLContext(canvas)});
+ assert("Should get a null WebGL context after getting 2D context", gl === null);
+}
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+ <canvas id="2d" width="1" height="1"></canvas>
+ <canvas id="webgl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html
new file mode 100644
index 0000000000..d6d14bd827
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/methods.html
@@ -0,0 +1,180 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+/*
+ The following tests are generated from
+ http://www.khronos.org/registry/gles/api/2.0/gl2.h
+ and api_modifications.txt
+*/
+var methods = ['canvas',
+"activeTexture",
+"attachShader",
+"bindAttribLocation",
+"bindBuffer",
+"bindFramebuffer",
+"bindRenderbuffer",
+"bindTexture",
+"blendColor",
+"blendEquation",
+"blendEquationSeparate",
+"blendFunc",
+"blendFuncSeparate",
+"bufferData",
+"bufferSubData",
+"checkFramebufferStatus",
+"clear",
+"clearColor",
+"clearDepth",
+"clearStencil",
+"colorMask",
+"compileShader",
+"copyTexImage2D",
+"copyTexSubImage2D",
+"createProgram",
+"createShader",
+"cullFace",
+"deleteBuffer",
+"deleteFramebuffer",
+"deleteProgram",
+"deleteRenderbuffer",
+"deleteShader",
+"deleteTexture",
+"depthFunc",
+"depthMask",
+"depthRange",
+"detachShader",
+"disable",
+"disableVertexAttribArray",
+"drawArrays",
+"drawElements",
+"enable",
+"enableVertexAttribArray",
+"finish",
+"flush",
+"framebufferRenderbuffer",
+"framebufferTexture2D",
+"frontFace",
+"createBuffer",
+"generateMipmap",
+"createFramebuffer",
+"createRenderbuffer",
+"createTexture",
+"getActiveAttrib",
+"getActiveUniform",
+"getAttachedShaders",
+"getAttribLocation",
+"getBufferParameter",
+"getError",
+"getExtension",
+"getSupportedExtensions",
+"getFramebufferAttachmentParameter",
+"getProgramInfoLog",
+"getRenderbufferParameter",
+"getShaderInfoLog",
+"getShaderSource",
+"getUniformLocation",
+"hint",
+"isBuffer",
+"isContextLost",
+"isEnabled",
+"isFramebuffer",
+"isProgram",
+"isRenderbuffer",
+"isShader",
+"isTexture",
+"lineWidth",
+"linkProgram",
+"polygonOffset",
+"readPixels",
+"renderbufferStorage",
+"sampleCoverage",
+"scissor",
+"shaderSource",
+"stencilFunc",
+"stencilFuncSeparate",
+"stencilMask",
+"stencilMaskSeparate",
+"stencilOp",
+"stencilOpSeparate",
+"texImage2D",
+"texParameteri",
+"texSubImage2D",
+"uniform1f",
+"uniform1fv",
+"uniform1i",
+"uniform1iv",
+"uniform2f",
+"uniform2fv",
+"uniform2i",
+"uniform2iv",
+"uniform3f",
+"uniform3fv",
+"uniform3i",
+"uniform3iv",
+"uniform4f",
+"uniform4fv",
+"uniform4i",
+"uniform4iv",
+"uniformMatrix2fv",
+"uniformMatrix3fv",
+"uniformMatrix4fv",
+"useProgram",
+"validateProgram",
+"vertexAttrib1f",
+"vertexAttrib1fv",
+"vertexAttrib2f",
+"vertexAttrib2fv",
+"vertexAttrib3f",
+"vertexAttrib3fv",
+"vertexAttrib4f",
+"vertexAttrib4fv",
+"vertexAttribPointer",
+"viewport",
+"getParameter",
+"getProgramParameter",
+"getShaderParameter",
+"getTexParameter",
+"getUniform",
+"getVertexAttrib"
+]
+
+Tests.testOES20Methods = function(gl) {
+ for (var i=0; i<methods.length; i++) {
+ assertProperty(gl, methods[i]);
+ }
+ var extended = false;
+ for (var i in gl) {
+ if (i.match(/^[a-z_]+$/) && methods.indexOf(i) == -1) {
+ if (!extended) {
+ extended = true;
+ var h = document.createElement('h3');
+ h.textContent = "Also found the following extra properties";
+ __testLog__.appendChild(h);
+ }
+ log(i);
+ }
+ }
+}
+
+Tests.startUnit = function() {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html
new file mode 100644
index 0000000000..fe453457c3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-A.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-A.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html
new file mode 100644
index 0000000000..6d34f27795
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B1.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-B1.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html
new file mode 100644
index 0000000000..2a1ddd9bd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B2.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-B2.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html
new file mode 100644
index 0000000000..08e85dbc04
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B3.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-B3.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html
new file mode 100644
index 0000000000..9ee5228e78
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-B4.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-B4.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html
new file mode 100644
index 0000000000..3717e41e77
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-C.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-C.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html
new file mode 100644
index 0000000000..c692db331b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-D_G.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-D_G.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html
new file mode 100644
index 0000000000..1f474892fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-G_I.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-G_I.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html
new file mode 100644
index 0000000000..698e1c93d9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-L_S.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-L_S.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html
new file mode 100644
index 0000000000..84e60151e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI-S_V.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+<script type="application/javascript" src="argGenerators-S_V.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators work
+// when called with randomly generated valid arguments
+Tests.testValidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ if (!gen.noAlreadyTriedCheck) {
+ var src = Object.toSource(args);
+ if (alreadyTriedArgs[src])
+ return true;
+
+ alreadyTriedArgs[src] = true;
+ }
+ var ok = false;
+ // if we have an validity checker, assert that the generated args are valid
+ if (gen.checkArgValidity)
+ assert("Valid args: "+name+"("+argsToString(args)+")",
+ gen.checkArgValidity.apply(gen, args));
+ var rv;
+ // assert that GL function works when called with valid args
+ assertOk("This should work: "+name+"("+argsToString(args)+")",
+ function(){rv = GL[name].apply(GL, args); ok = true;});
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup)
+ assertOk("Cleaning up return value after "+name+"("+argsToString(args)+")",
+ function() { gen.returnValueCleanup(rv); });
+ return ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js
new file mode 100644
index 0000000000..50e74963e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPI.js
@@ -0,0 +1,414 @@
+/*
+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.
+*/
+
+/*
+ QuickCheck tests for WebGL:
+
+ 1. Write a valid arg generator for each function
+ 1.1. Write valid arg predicates to use with random generator:
+ if value passes generator, accept it as valid.
+ 1.2. Often needs initializing and cleanup:
+ setup - generate - cleanup
+ gl.createBuffer - test(bindBufferGenerator) - gl.deleteBuffer
+
+ 2. Write an invalid arg generator
+ 2.1. Take valid args, modify an arg until the args no longer pass
+ checkArgValidity.
+ 2.2. Repeat for all args.
+
+ 3. Test functions using the generators
+ 3.1. Args generated with the valid arg generator should pass
+ assertOk(f(args))
+ 3.2. Args generated with the invalid arg generator should pass
+ assertFail(f(args))
+*/
+var GLcanvas = document.createElement('canvas');
+var canvas2D = document.createElement('canvas');
+GLcanvas.width = GLcanvas.height = 256;
+GL = getGLContext(GLcanvas);
+Array.from = function(o) {
+ var a = [];
+ for (var i=0; i<o.length; i++)
+ a.push(o[i]);
+ return a;
+}
+Array.prototype.has = function(v) { return this.indexOf(v) != -1; }
+Array.prototype.random = function() { return this[randomInt(this.length)]; }
+
+castToInt = function(o) {
+ if (typeof o == 'number')
+ return isNaN(o) ? 0 : Math.floor(o);
+ if (o == true) return 1;
+ return 0;
+};
+
+// Creates a constant checker / generator from its arguments.
+//
+// E.g. if you want a constant checker for the constants 1, 2, and 3, you
+// would do the following:
+//
+// var cc = constCheck(1,2,3);
+// var randomConst = cc.random();
+// if (cc.has(randomConst))
+// console.log("randomConst is included in cc's constants");
+//
+constCheck = function() {
+ var a = Array.from(arguments);
+ a.has = function(v) { return this.indexOf(castToInt(v)) != -1; };
+ return a;
+}
+
+bindTextureTarget = constCheck(GL.TEXTURE_2D, GL.TEXTURE_CUBE_MAP);
+blendEquationMode = constCheck(GL.FUNC_ADD, GL.FUNC_SUBTRACT, GL.FUNC_REVERSE_SUBTRACT);
+blendFuncSfactor = constCheck(
+ 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
+);
+blendFuncDfactor = constCheck(
+ 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
+);
+bufferTarget = constCheck(GL.ARRAY_BUFFER, GL.ELEMENT_ARRAY_BUFFER);
+bufferMode = constCheck(GL.STREAM_DRAW, GL.STATIC_DRAW, GL.DYNAMIC_DRAW);
+clearMask = constCheck(
+ GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT | GL.STENCIL_BUFFER_BIT,
+ GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT,
+ GL.COLOR_BUFFER_BIT | GL.STENCIL_BUFFER_BIT,
+ GL.DEPTH_BUFFER_BIT | GL.STENCIL_BUFFER_BIT,
+ GL.COLOR_BUFFER_BIT, GL.DEPTH_BUFFER_BIT, GL.STENCIL_BUFFER_BIT, 0
+);
+cullFace = constCheck(GL.FRONT, GL.BACK, GL.FRONT_AND_BACK);
+depthFuncFunc = constCheck(
+ GL.NEVER, GL.LESS, GL.EQUAL, GL.LEQUAL, GL.GREATER, GL.NOTEQUAL,
+ GL.GEQUAL, GL.ALWAYS
+);
+stencilFuncFunc = depthFuncFunc;
+enableCap = constCheck(
+ GL.BLEND, GL.CULL_FACE, GL.DEPTH_TEST, GL.DITHER, GL.POLYGON_OFFSET_FILL,
+ GL.SAMPLE_ALPHA_TO_COVERAGE, GL.SAMPLE_COVERAGE, GL.SCISSOR_TEST,
+ GL.STENCIL_TEST
+);
+frontFaceMode = constCheck(GL.CCW, GL.CW);
+getParameterPname = constCheck(
+ GL.ACTIVE_TEXTURE || "GL.ACTIVE_TEXTURE",
+ GL.ALIASED_LINE_WIDTH_RANGE || "GL.ALIASED_LINE_WIDTH_RANGE",
+ GL.ALIASED_POINT_SIZE_RANGE || "GL.ALIASED_POINT_SIZE_RANGE",
+ GL.ALPHA_BITS || "GL.ALPHA_BITS",
+ GL.ARRAY_BUFFER_BINDING || "GL.ARRAY_BUFFER_BINDING",
+ GL.BLEND || "GL.BLEND",
+ GL.BLEND_COLOR || "GL.BLEND_COLOR",
+ GL.BLEND_DST_ALPHA || "GL.BLEND_DST_ALPHA",
+ GL.BLEND_DST_RGB || "GL.BLEND_DST_RGB",
+ GL.BLEND_EQUATION_ALPHA || "GL.BLEND_EQUATION_ALPHA",
+ GL.BLEND_EQUATION_RGB || "GL.BLEND_EQUATION_RGB",
+ GL.BLEND_SRC_ALPHA || "GL.BLEND_SRC_ALPHA",
+ GL.BLEND_SRC_RGB || "GL.BLEND_SRC_RGB",
+ GL.BLUE_BITS || "GL.BLUE_BITS",
+ GL.COLOR_CLEAR_VALUE || "GL.COLOR_CLEAR_VALUE",
+ GL.COLOR_WRITEMASK || "GL.COLOR_WRITEMASK",
+ GL.COMPRESSED_TEXTURE_FORMATS || "GL.COMPRESSED_TEXTURE_FORMATS",
+ GL.CULL_FACE || "GL.CULL_FACE",
+ GL.CULL_FACE_MODE || "GL.CULL_FACE_MODE",
+ GL.CURRENT_PROGRAM || "GL.CURRENT_PROGRAM",
+ GL.DEPTH_BITS || "GL.DEPTH_BITS",
+ GL.DEPTH_CLEAR_VALUE || "GL.DEPTH_CLEAR_VALUE",
+ GL.DEPTH_FUNC || "GL.DEPTH_FUNC",
+ GL.DEPTH_RANGE || "GL.DEPTH_RANGE",
+ GL.DEPTH_TEST || "GL.DEPTH_TEST",
+ GL.DEPTH_WRITEMASK || "GL.DEPTH_WRITEMASK",
+ GL.DITHER || "GL.DITHER",
+ GL.ELEMENT_ARRAY_BUFFER_BINDING || "GL.ELEMENT_ARRAY_BUFFER_BINDING",
+ GL.FRAMEBUFFER_BINDING || "GL.FRAMEBUFFER_BINDING",
+ GL.FRONT_FACE || "GL.FRONT_FACE",
+ GL.GENERATE_MIPMAP_HINT || "GL.GENERATE_MIPMAP_HINT",
+ GL.GREEN_BITS || "GL.GREEN_BITS",
+ GL.LINE_WIDTH || "GL.LINE_WIDTH",
+ GL.MAX_COMBINED_TEXTURE_IMAGE_UNITS || "GL.MAX_COMBINED_TEXTURE_IMAGE_UNITS",
+ GL.MAX_CUBE_MAP_TEXTURE_SIZE || "GL.MAX_CUBE_MAP_TEXTURE_SIZE",
+ GL.MAX_FRAGMENT_UNIFORM_VECTORS || "GL.MAX_FRAGMENT_UNIFORM_VECTORS",
+ GL.MAX_RENDERBUFFER_SIZE || "GL.MAX_RENDERBUFFER_SIZE",
+ GL.MAX_TEXTURE_IMAGE_UNITS || "GL.MAX_TEXTURE_IMAGE_UNITS",
+ GL.MAX_TEXTURE_SIZE || "GL.MAX_TEXTURE_SIZE",
+ GL.MAX_VARYING_VECTORS || "GL.MAX_VARYING_VECTORS",
+ GL.MAX_VERTEX_ATTRIBS || "GL.MAX_VERTEX_ATTRIBS",
+ GL.MAX_VERTEX_TEXTURE_IMAGE_UNITS || "GL.MAX_VERTEX_TEXTURE_IMAGE_UNITS",
+ GL.MAX_VERTEX_UNIFORM_VECTORS || "GL.MAX_VERTEX_UNIFORM_VECTORS",
+ GL.MAX_VIEWPORT_DIMS || "GL.MAX_VIEWPORT_DIMS",
+ GL.PACK_ALIGNMENT || "GL.PACK_ALIGNMENT",
+ GL.POLYGON_OFFSET_FACTOR || "GL.POLYGON_OFFSET_FACTOR",
+ GL.POLYGON_OFFSET_FILL || "GL.POLYGON_OFFSET_FILL",
+ GL.POLYGON_OFFSET_UNITS || "GL.POLYGON_OFFSET_UNITS",
+ GL.RED_BITS || "GL.RED_BITS",
+ GL.RENDERBUFFER_BINDING || "GL.RENDERBUFFER_BINDING",
+ GL.SAMPLE_BUFFERS || "GL.SAMPLE_BUFFERS",
+ GL.SAMPLE_COVERAGE_INVERT || "GL.SAMPLE_COVERAGE_INVERT",
+ GL.SAMPLE_COVERAGE_VALUE || "GL.SAMPLE_COVERAGE_VALUE",
+ GL.SAMPLES || "GL.SAMPLES",
+ GL.SCISSOR_BOX || "GL.SCISSOR_BOX",
+ GL.SCISSOR_TEST || "GL.SCISSOR_TEST",
+ GL.STENCIL_BACK_FAIL || "GL.STENCIL_BACK_FAIL",
+ GL.STENCIL_BACK_FUNC || "GL.STENCIL_BACK_FUNC",
+ GL.STENCIL_BACK_PASS_DEPTH_FAIL || "GL.STENCIL_BACK_PASS_DEPTH_FAIL",
+ GL.STENCIL_BACK_PASS_DEPTH_PASS || "GL.STENCIL_BACK_PASS_DEPTH_PASS",
+ GL.STENCIL_BACK_REF || "GL.STENCIL_BACK_REF",
+ GL.STENCIL_BACK_VALUE_MASK || "GL.STENCIL_BACK_VALUE_MASK",
+ GL.STENCIL_BACK_WRITEMASK || "GL.STENCIL_BACK_WRITEMASK",
+ GL.STENCIL_BITS || "GL.STENCIL_BITS",
+ GL.STENCIL_CLEAR_VALUE || "GL.STENCIL_CLEAR_VALUE",
+ GL.STENCIL_FAIL || "GL.STENCIL_FAIL",
+ GL.STENCIL_FUNC || "GL.STENCIL_FUNC",
+ GL.STENCIL_PASS_DEPTH_FAIL || "GL.STENCIL_PASS_DEPTH_FAIL",
+ GL.STENCIL_PASS_DEPTH_PASS || "GL.STENCIL_PASS_DEPTH_PASS",
+ GL.STENCIL_REF || "GL.STENCIL_REF",
+ GL.STENCIL_TEST || "GL.STENCIL_TEST",
+ GL.STENCIL_VALUE_MASK || "GL.STENCIL_VALUE_MASK",
+ GL.STENCIL_WRITEMASK || "GL.STENCIL_WRITEMASK",
+ GL.SUBPIXEL_BITS || "GL.SUBPIXEL_BITS",
+ GL.TEXTURE_BINDING_2D || "GL.TEXTURE_BINDING_2D",
+ GL.TEXTURE_BINDING_CUBE_MAP || "GL.TEXTURE_BINDING_CUBE_MAP",
+ GL.UNPACK_ALIGNMENT || "GL.UNPACK_ALIGNMENT",
+ GL.VIEWPORT || "GL.VIEWPORT"
+);
+mipmapHint = constCheck(GL.FASTEST, GL.NICEST, GL.DONT_CARE);
+pixelStoreiPname = constCheck(GL.PACK_ALIGNMENT, GL.UNPACK_ALIGNMENT);
+pixelStoreiParam = constCheck(1,2,4,8);
+shaderType = constCheck(GL.VERTEX_SHADER, GL.FRAGMENT_SHADER);
+stencilOp = constCheck(GL.KEEP, GL.ZERO, GL.REPLACE, GL.INCR, GL.INCR_WRAP,
+ GL.DECR, GL.DECR_WRAP, GL.INVERT);
+texImageTarget = constCheck(
+ GL.TEXTURE_2D,
+ 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
+);
+texImageInternalFormat = constCheck(
+ GL.ALPHA,
+ GL.LUMINANCE,
+ GL.LUMINANCE_ALPHA,
+ GL.RGB,
+ GL.RGBA
+);
+texImageFormat = constCheck(
+ GL.ALPHA,
+ GL.LUMINANCE,
+ GL.LUMINANCE_ALPHA,
+ GL.RGB,
+ GL.RGBA
+);
+texImageType = constCheck(GL.UNSIGNED_BYTE);
+texParameterPname = constCheck(
+ GL.TEXTURE_MIN_FILTER, GL.TEXTURE_MAG_FILTER,
+ GL.TEXTURE_WRAP_S, GL.TEXTURE_WRAP_T);
+texParameterParam = {};
+texParameterParam[GL.TEXTURE_MIN_FILTER] = constCheck(
+ GL.NEAREST, GL.LINEAR, GL.NEAREST_MIPMAP_NEAREST, GL.LINEAR_MIPMAP_NEAREST,
+ GL.NEAREST_MIPMAP_LINEAR, GL.LINEAR_MIPMAP_LINEAR);
+texParameterParam[GL.TEXTURE_MAG_FILTER] = constCheck(GL.NEAREST, GL.LINEAR);
+texParameterParam[GL.TEXTURE_WRAP_S] = constCheck(
+ GL.CLAMP_TO_EDGE, GL.MIRRORED_REPEAT, GL.REPEAT);
+texParameterParam[GL.TEXTURE_WRAP_T] = texParameterParam[GL.TEXTURE_WRAP_S];
+textureUnit = constCheck.apply(this, (function(){
+ var textureUnits = [];
+ var texUnits = GL.getParameter(GL.MAX_TEXTURE_IMAGE_UNITS);
+ for (var i=0; i<texUnits; i++) textureUnits.push(GL['TEXTURE'+i]);
+ return textureUnits;
+})());
+
+var StencilBits = GL.getParameter(GL.STENCIL_BITS);
+var MaxStencilValue = 1 << StencilBits;
+
+var MaxVertexAttribs = GL.getParameter(GL.MAX_VERTEX_ATTRIBS);
+var LineWidthRange = GL.getParameter(GL.ALIASED_LINE_WIDTH_RANGE);
+
+// Returns true if bufData can be passed to GL.bufferData
+isBufferData = function(bufData) {
+ if (typeof bufData == 'number')
+ return bufData >= 0;
+ if (bufData instanceof ArrayBuffer)
+ return true;
+ return WebGLArrayTypes.some(function(t) {
+ return bufData instanceof t;
+ });
+};
+
+isVertexAttribute = function(idx) {
+ if (typeof idx != 'number') return false;
+ return idx >= 0 && idx < MaxVertexAttribs;
+};
+
+isValidName = function(name) {
+ if (typeof name != 'string') return false;
+ for (var i=0; i<name.length; i++) {
+ var c = name.charCodeAt(i);
+ if (c & 0x00FF == 0 || c & 0xFF00 == 0) {
+ return false;
+ }
+ }
+ return true;
+};
+
+WebGLArrayTypes = [
+ Float32Array,
+ Int32Array,
+ Int16Array,
+ Int8Array,
+ Uint32Array,
+ Uint16Array,
+ Uint8Array
+];
+webGLArrayContentGenerators = [randomLength, randomSmallIntArray];
+randomWebGLArray = function() {
+ var t = WebGLArrayTypes.random();
+ return new t(webGLArrayContentGenerators.random()());
+};
+
+randomArrayBuffer = function(buflen) {
+ if (buflen == null) buflen = 256;
+ var len = randomInt(buflen)+1;
+ var rv;
+ try {
+ rv = new ArrayBuffer(len);
+ } catch(e) {
+ log("Error creating ArrayBuffer with length " + len);
+ throw(e);
+ }
+ return rv;
+};
+
+bufferDataGenerators = [randomLength, randomWebGLArray, randomArrayBuffer];
+randomBufferData = function() {
+ return bufferDataGenerators.random()();
+};
+
+randomSmallWebGLArray = function(buflen) {
+ var t = WebGLArrayTypes.random();
+ return new t(randomInt(buflen/4)+1);
+};
+
+bufferSubDataGenerators = [randomSmallWebGLArray, randomArrayBuffer];
+randomBufferSubData = function(buflen) {
+ var data = bufferSubDataGenerators.random()(buflen);
+ var offset = randomInt(buflen - data.byteLength);
+ return {data:data, offset:offset};
+};
+
+randomColor = function() {
+ return [Math.random(), Math.random(), Math.random(), Math.random()];
+};
+
+randomName = function() {
+ var arr = [];
+ var len = randomLength()+1;
+ for (var i=0; i<len; i++) {
+ var l = randomInt(255)+1;
+ var h = randomInt(255)+1;
+ var c = (h << 8) | l;
+ arr.push(String.fromCharCode(c));
+ }
+ return arr.join('');
+};
+randomVertexAttribute = function() {
+ return randomInt(MaxVertexAttribs);
+};
+
+randomBool = function() { return Math.random() > 0.5; };
+
+randomStencil = function() {
+ return randomInt(MaxStencilValue);
+};
+
+randomLineWidth = function() {
+ var lo = LineWidthRange[0],
+ hi = LineWidthRange[1];
+ return randomFloatFromRange(lo, hi);
+};
+
+randomImage = function(w,h) {
+ var img;
+ var r = Math.random();
+ if (r < 0.25) {
+ img = document.createElement('canvas');
+ img.width = w; img.height = h;
+ img.getContext('2d').fillRect(0,0,w,h);
+ } else if (r < 0.5) {
+ img = document.createElement('video');
+ img.muted = true;
+ img.width = w; img.height = h;
+ } else if (r < 0.75) {
+ img = document.createElement('img');
+ img.width = w; img.height = h;
+ } else {
+ img = canvas2D.getContext('2d').createImageData(w,h);
+ }
+ return img
+};
+
+mutateArgs = function(args) {
+ var mutateCount = randomIntFromRange(1, args.length);
+ var newArgs = Array.from(args);
+ for (var i=0; i<mutateCount; i++) {
+ var idx = randomInt(args.length);
+ newArgs[idx] = generateRandomArg(idx, args.length);
+ }
+ return newArgs;
+};
+
+// Calls testFunction numberOfTests times with arguments generated by
+// argGen.generate() (or empty arguments if no generate present).
+//
+// The arguments testFunction is called with are the generated args,
+// the argGen, and what argGen.setup() returned or [] if argGen has not setup
+// method. I.e. testFunction(generatedArgs, argGen, setupVars).
+//
+argGeneratorTestRunner = function(argGen, testFunction, numberOfTests) {
+ // do argument generator setup if needed
+ var setupVars = argGen.setup ? argGen.setup() : [];
+ var error;
+ for (var i=0; i<numberOfTests; i++) {
+ var failed = false;
+ // generate arguments if argGen has a generate method
+ var generatedArgs = argGen.generate ? argGen.generate.apply(argGen, setupVars) : [];
+ try {
+ // call testFunction with the generated args
+ testFunction.call(this, generatedArgs, argGen, setupVars);
+ } catch (e) {
+ failed = true;
+ error = e;
+ }
+ // if argGen needs cleanup for generated args, do it here
+ if (argGen.cleanup)
+ argGen.cleanup.apply(argGen, generatedArgs);
+ if (failed) break;
+ }
+ // if argGen needs to do a final cleanup for setupVars, do it here
+ if (argGen.teardown)
+ argGen.teardown.apply(argGen, setupVars);
+ if (error) throw(error);
+};
+
+// TODO: Remove this
+// WebKit or at least Chrome is really slow at laying out strings with
+// unprintable characters. Without this tests can take 30-90 seconds.
+// With this they're instant.
+sanitize = function(str) {
+ var newStr = [];
+ for (var ii = 0; ii < str.length; ++ii) {
+ var c = str.charCodeAt(ii);
+ newStr.push((c > 31 && c < 128) ? str[ii] : "?");
+ }
+ return newStr.join('');
+};
+
+argsToString = function(args) {
+ return sanitize(args.map(function(a){return Object.toSource(a)}).join(","));
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html
new file mode 100644
index 0000000000..fb65bf2ad1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/quickCheckAPIBadArgs.html
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="quickCheckAPI.js"></script>
+
+<script type="application/javascript">
+
+// Test that all GL functions specified in ArgGenerators fail
+// when called with randomly generated invalid arguments
+// Works only on tests with checkArgValidity defined
+Tests.testInvalidArgs = function() {
+ var randomTestCount = 100;
+ for (var name in ArgGenerators) {
+ try {
+ if (!GL[name])
+ throw (new Error(name + " is missing from the WebGL context"));
+ var argGen = ArgGenerators[name];
+ var alreadyTriedArgs = {};
+ if (!argGen.generate || !argGen.checkArgValidity) continue;
+ // test each GL function with randomTestCount randomly generated valid args
+ argGeneratorTestRunner(argGen, function(args, gen, setupVars) {
+ var mutatedArgs;
+ var foundArgs = false;
+ for (var j=0; j<100; j++) {
+ mutatedArgs = mutateArgs(args);
+ var validArgs = false;
+ try {
+ validArgs = gen.checkArgValidity.apply(gen, mutatedArgs);
+ } catch(e) {}
+ if (!validArgs) {
+ if (gen.noAlreadyTriedCheck) {
+ foundArgs = true;
+ break; // found new invalid args
+ }
+ var src = Object.toSource(mutatedArgs);
+ if (!alreadyTriedArgs[src]) {
+ alreadyTriedArgs[src] = true;
+ foundArgs = true;
+ break; // found new invalid args
+ }
+ }
+ }
+ if (!foundArgs)
+ return true;
+ var ok = false;
+ var rv;
+ // assert that GL function fails when called with invalid args
+ assertFail("This should fail: "+name+"("+argsToString(mutatedArgs)+")",
+ function(){
+ GL.getError(); // clear off existing error
+ rv = GL[name].apply(GL, mutatedArgs);
+ throwError(GL, name);
+ ok = true;
+ });
+ // if we need to cleanup the return value, do it here
+ // e.g. calling gl.deleteBuffer(rv) after testing gl.createBuffer() above
+ if (gen.returnValueCleanup && rv != null) {
+ assertOk("Cleaning up return value after "+name+"("+argsToString(mutatedArgs)+")",
+ function() { gen.returnValueCleanup(rv); });
+ }
+ GL.getError();
+ return !ok;
+ }, argGen.testCount || randomTestCount);
+ } catch(e) {
+ testFailed(name, e.name, formatError(e));
+ }
+ }
+}
+
+</script>
+<style>canvas{position:absolute;}</style>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html
new file mode 100644
index 0000000000..bd3eba036d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/conformance/webGLArrays.html
@@ -0,0 +1,165 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+
+<script type="application/javascript">
+
+function assertIdxs(name, arr, length) {
+// assertOk(name+": Read with negative idx should work", function(){ return arr[-1] });
+// assertOk(name+": Read with too large idx should work", function(){ return arr[length] });
+// assertOk(name+": Write with negative idx should work", function(){ arr[-1] = 0 });
+// assertOk(name+": Write with too large idx should work", function(){ arr[length] = 0 });
+// arr[0] = 2;
+// assertEquals(name+": Test that write worked", 2, arr[0]);
+// assertOk(name+": Write with bad value should work", function(){ arr[0] = {x:"foo"} });
+// assertEquals(name+": Test that bad write didn't work", 2, arr[0]);
+ assertOk(name+": Read and writes with OK idxs should work", function(){
+ for (var i=0; i<length; i++) arr[i] = i + 1;
+ for (var i=0; i<length; i++) arr[i] = arr[i] + 1;
+ for (var i=0; i<length; i++) assertEquals(name+": Test that reads and writes work", i+2, arr[i]);
+ });
+}
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ prog = new Shader(gl, 'vert', 'frag');
+ prog.use();
+ prog.uniform4f('c', 255, 0, 0, 255);
+ va = prog.attrib('Vertex');
+ buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ return [gl];
+}
+
+Tests.endUnit = function() {
+ prog.destroy();
+}
+
+Tests.testCreateFromArray = function() {
+ var a = new Float32Array([1,2,3,4,5,6]);
+ assertIdxs('Float', a, 6);
+ var a = new Int32Array([1,2,3,4,5,6]);
+ assertIdxs('Int', a, 6);
+ var a = new Int16Array([1,2,3,4,5,6]);
+ assertIdxs('Short', a, 6);
+ var a = new Int8Array([1,2,3,4,5,6]);
+ assertIdxs('Byte', a, 6);
+ var a = new Uint32Array([1,2,3,4,5,6]);
+ assertIdxs('UInt', a, 6);
+ var a = new Uint16Array([1,2,3,4,5,6]);
+ assertIdxs('UShort', a, 6);
+ var a = new Uint8Array([1,2,3,4,5,6]);
+ assertIdxs('UByte', a, 6);
+}
+Tests.testCreateFromCount = function() {
+ var a = new Float32Array(6);
+ assertIdxs('Float', a, 6);
+ var a = new Int32Array(6);
+ assertIdxs('Int', a, 6);
+ var a = new Int16Array(6);
+ assertIdxs('Short', a, 6);
+ var a = new Int8Array(6);
+ assertIdxs('Byte', a, 6);
+ var a = new Uint32Array(6);
+ assertIdxs('UInt', a, 6);
+ var a = new Uint16Array(6);
+ assertIdxs('UShort', a, 6);
+ var a = new Uint8Array(6);
+ assertIdxs('UByte', a, 6);
+}
+Tests.testCreateFromBuffer = function() {
+ var sz = 24;
+ var b = new ArrayBuffer(sz);
+ var a = new Float32Array(b);
+ assertIdxs('Float', a, sz/4);
+ var a = new Int32Array(b);
+ assertIdxs('Int', a, sz/4);
+ var a = new Int16Array(b);
+ assertIdxs('Short', a, sz/2);
+ var a = new Int8Array(b);
+ assertIdxs('Byte', a, sz/1);
+ var a = new Uint32Array(b);
+ assertIdxs('UInt', a, sz/4);
+ var a = new Uint16Array(b);
+ assertIdxs('UShort', a, sz/2);
+ var a = new Uint8Array(b);
+ assertIdxs('UByte', a, sz/1);
+}
+
+Tests.testThatWritesChangeDrawing = function(gl) {
+ var verts = [
+ 0,0,
+ 1,0,
+ 1,1,
+
+ 0,0,
+ 1,1,
+ 0,1
+ ];
+ var a = new Float32Array(verts);
+ var arr = [];
+ for (var i=0; i<12; i++)
+ arr[i] = a[i];
+ assertEquals("Test that reads work from an array-initialized Float32Array", arr, verts);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.bufferData(gl.ARRAY_BUFFER, a, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(va, 2, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(va);
+
+ var id = new Uint8Array(4);
+ gl.readPixels(8,8,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);
+ assertEquals([0, 0, 0, 0], [id[0], id[1], id[2], id[3]]);
+
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ gl.readPixels(8,8,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);
+ assertEquals([255, 0, 0, 255], [id[0], id[1], id[2], id[3]]);
+ gl.readPixels(0,8,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);
+ assertEquals([0, 0, 0, 0], [id[0], id[1], id[2], id[3]]);
+
+ a[0] = a[6] = a[10] = -1;
+ gl.bufferData(gl.ARRAY_BUFFER, a, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(va, 2, gl.FLOAT, false, 0, 0);
+
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ gl.readPixels(8,8,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);
+ assertEquals([255, 0, 0, 255], [id[0], id[1], id[2], id[3]]);
+ gl.readPixels(0,8,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);
+ assertEquals("Test that Float32Array#[]= worked and drawArrays drew a full-width rectangle",
+ [255, 0, 0, 255], [id[0], id[1], id[2], id[3]]);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);
+ assertEquals([0, 0, 0, 0], [id[0], id[1], id[2], id[3]]);
+}
+
+</script>
+<script id="vert" type="x-shader/x-vertex">
+ attribute vec2 Vertex;
+ void main()
+ {
+ gl_Position = vec4(Vertex, 0.0, 1.0);
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+ precision mediump float;
+
+ uniform vec4 c;
+ void main()
+ {
+ gl_FragColor = c;
+ }
+</script>
+<style>canvas{border: 1px solid black}</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html
new file mode 100644
index 0000000000..9011d76168
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBuffer.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testBindBufferARRAY_BUFFER = function(gl) {
+ var b = gl.createBuffer();
+ assert(gl.NO_ERROR == checkError(gl, "genBuffers"));
+ gl.bindBuffer(gl.ARRAY_BUFFER, b);
+ assert(gl.NO_ERROR == checkError(gl, "bindBuffer"));
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ assert(gl.NO_ERROR == checkError(gl, "bindBuffer 0"));
+ gl.deleteBuffer(b);
+ assert(gl.NO_ERROR == checkError(gl, "deleteBuffers"));
+}
+
+Tests.testBindBufferELEMENT_ARRAY_BUFFER = function(gl) {
+ var b = gl.createBuffer();
+ assert(gl.NO_ERROR == checkError(gl, "genBuffers"));
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, b);
+ assert(gl.NO_ERROR == checkError(gl, "bindBuffer"));
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ assert(gl.NO_ERROR == checkError(gl, "bindBuffer 0"));
+ gl.deleteBuffer(b);
+ assert(gl.NO_ERROR == checkError(gl, "deleteBuffers"));
+}
+
+</script>
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html
new file mode 100644
index 0000000000..09797cb3d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindBufferBadArgs.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testBindBufferARRAY_BUFFER = function(gl) {
+ var b = gl.createBuffer();
+ assertOk("bind buffer", function(){gl.bindBuffer(gl.ARRAY_BUFFER, b)});
+ assertFail("bufferData to null buffer", function() {
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([10]), gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([10]));
+ });
+ assertFail("bind to number", function(){
+ gl.bindBuffer(gl.ARRAY_BUFFER, 1000000000);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([10]), gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([10]));
+ });
+ assertOk("bind to null", function(){gl.bindBuffer(gl.ARRAY_BUFFER, null)});
+ gl.deleteBuffer(b);
+}
+
+Tests.testBindBufferELEMENT_ARRAY_BUFFER = function(gl) {
+ var b = gl.createBuffer();
+ assertOk("bind buffer", function(){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, b)});
+ assertFail("bufferData to null buffer", function() {
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Float32Array([10]), gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([10]));
+ });
+ assertFail("bind to number", function(){
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, 1000000000);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Float32Array([10]), gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([10]));
+ });
+ assertOk("bind to null",
+ function(){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null)});
+ gl.deleteBuffer(b);
+}
+Tests.testBindBuffer = function(gl) {
+ assertFail("bind ARRAY_BUFFER to number",
+ function(){gl.bindBuffer(gl.ARRAY_BUFFER, 1);});
+ assertFail("bind ELEMENT_ARRAY_BUFFER to number",
+ function(){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, 1);});
+ assertFail("bind bad target",
+ function(){gl.bindBuffer(gl.FLOAT, 0);});
+ assertFail("bind ARRAY_BUFFER to string",
+ function(){gl.bindBuffer(gl.ARRAY_BUFFER, "foo");});
+ assertFail("bind ELEMENT_ARRAY_BUFFER to string",
+ function(){gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, "foo");});
+}
+
+</script>
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html
new file mode 100644
index 0000000000..1c0bab8e00
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bindFramebufferLeaveNonZero.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<title>OpenGL for the web</title>
+
+<script type="application/javascript" src="../util.js"></script>
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+
+ <script type="application/javascript">
+Tests.message = "This was segfaulting when the GL context got GC'd (in glXDestroyContext)";
+Tests.testSeg = function () {
+ var canvas = document.getElementById('canvas');
+ var gl = getGLContext(canvas);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+}
+</script>
+
+</head><body>
+ <canvas id="canvas" width="400" height="400"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html
new file mode 100644
index 0000000000..25d53e6b7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferData.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var buf = gl.createBuffer();
+ var ebuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebuf);
+ return [gl, buf, ebuf];
+}
+
+Tests.testBufferData = function(gl, buf, ebuf) {
+ var data = [0,0,0,0, 1,0,0,0, 0,1,0,0];
+ gl.bufferData(gl.ARRAY_BUFFER, 12, gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([]), gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STREAM_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STREAM_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.DYNAMIC_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.DYNAMIC_DRAW);
+
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint16Array(data), gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint16Array(data), gl.STREAM_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint16Array(data), gl.DYNAMIC_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*2);
+ throwError(gl, "array bufferSubData");
+}
+Tests.testBufferDataElement = function(gl, buf, ebuf) {
+ var data = [0,0,0,0, 1,0,0,0, 0,1,0,0];
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), gl.STATIC_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ELEMENT_ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STATIC_DRAW);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), gl.STREAM_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ELEMENT_ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STREAM_DRAW);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), gl.DYNAMIC_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ELEMENT_ARRAY_BUFFER, gl.BUFFER_USAGE), gl.DYNAMIC_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ELEMENT_ARRAY_BUFFER, gl.BUFFER_SIZE), 12*2);
+ throwError(gl, "element array bufferSubData");
+}
+
+Tests.endUnit = function(gl, buf, ebuf) {
+ gl.deleteBuffer(buf);
+ gl.deleteBuffer(ebuf);
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html
new file mode 100644
index 0000000000..4a473be0d8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferDataBadArgs.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var buf = gl.createBuffer();
+ var ebuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebuf);
+ return [gl, buf, ebuf];
+}
+
+Tests.testBufferData = function(gl) {
+ assertOk("zero size data",
+ function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(0), gl.STATIC_DRAW);});
+ assertFail("bad target",
+ function(){gl.bufferData(gl.TEXTURE_2D, new Float32Array([1,2,3]), gl.STATIC_DRAW);});
+// assertFail("array for data",
+// function(){gl.bufferData(gl.ARRAY_BUFFER, [1,2,3], gl.STATIC_DRAW);});
+ assertFail("bad usage",
+ function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1,2,3]), gl.TEXTURE_2D);});
+ assertFail("null data",
+ function(){gl.bufferData(gl.ARRAY_BUFFER, null, gl.STATIC_DRAW);});
+ assertFail("undefined data",
+ function(){gl.bufferData(gl.ARRAY_BUFFER, undefined, gl.STATIC_DRAW);});
+ assertOk(function(){gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Float32Array([1,2,3]), gl.STATIC_DRAW);});
+ throwError(gl, 'bufferData');
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ assertFail(function(){gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1,2,3]), gl.STATIC_DRAW);});
+ throwError(gl, 'bufferData');
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ assertFail(function(){gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([1,2,3]), gl.STATIC_DRAW);});
+ throwError(gl, 'bufferData');
+}
+
+Tests.endUnit = function(gl, buf, ebuf) {
+ gl.deleteBuffer(buf);
+ gl.deleteBuffer(ebuf);
+}
+
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html
new file mode 100644
index 0000000000..df03cf2835
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubData.html
@@ -0,0 +1,117 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = getGLContext(canvas);
+ var buf = gl.createBuffer();
+ var ebuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebuf);
+ return [gl, buf, ebuf];
+}
+
+Tests.testBufferSubData = function(gl, buf, ebuf) {
+ var data = [0,0,0,0, 1,0,0,0, 0,1,0,0];
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([1,2,3,4]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Float32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 32, new Float32Array([1,1,1,1]));
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STREAM_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Float32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([1,2,3,4]));
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STREAM_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.DYNAMIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Float32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([1,2,3,4]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Int32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Int16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Int8Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint8Array([1,1,1,1]));
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.DYNAMIC_DRAW);
+
+ gl.bufferData(gl.ARRAY_BUFFER, 12, gl.STATIC_DRAW);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STATIC_DRAW);
+
+ gl.bufferData(gl.ARRAY_BUFFER, 12*4, gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([1,2,3,4]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Float32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 32, new Float32Array([1,1,1,1]));
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STATIC_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, 12*4, gl.STREAM_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Float32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([1,2,3,4]));
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.STREAM_DRAW);
+ gl.bufferData(gl.ARRAY_BUFFER, 12*4, gl.DYNAMIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Float32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([1,2,3,4]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Int32Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Int16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Int8Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint8Array([1,1,1,1]));
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*4);
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_USAGE), gl.DYNAMIC_DRAW);
+
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint16Array(data), gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Uint16Array([1,2,3,4]));
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint16Array(data), gl.STREAM_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Uint16Array([1,2,3,4]));
+ gl.bufferData(gl.ARRAY_BUFFER, new Uint16Array(data), gl.DYNAMIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Uint16Array([1,2,3,4]));
+ assertEquals(gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE), 12*2);
+ throwError(gl, "array bufferSubData");
+}
+Tests.testBufferSubDataElement = function(gl, buf, ebuf) {
+ var data = [0,0,0,0, 1,0,0,0, 0,1,0,0];
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint16Array([1,2,3,4]));
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), gl.STREAM_DRAW);
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint16Array([1,2,3,4]));
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), gl.DYNAMIC_DRAW);
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 16, new Uint16Array([1,1,1,1]));
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint16Array([1,2,3,4]));
+ assertEquals(gl.getBufferParameter(gl.ELEMENT_ARRAY_BUFFER, gl.BUFFER_SIZE), 12*2);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array(data), gl.DYNAMIC_DRAW);
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 4, new Uint8Array([1,1,1,1]));
+ gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint8Array([1,2,3,4]));
+ assertEquals(gl.getBufferParameter(gl.ELEMENT_ARRAY_BUFFER, gl.BUFFER_SIZE), 12);
+ throwError(gl, "element array bufferSubData");
+}
+
+Tests.endUnit = function(gl, buf, ebuf) {
+ gl.deleteBuffer(buf);
+ gl.deleteBuffer(ebuf);
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html
new file mode 100644
index 0000000000..a12adf8ff8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/bufferSubDataBadArgs.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var buf = gl.createBuffer();
+ var ebuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ebuf);
+ return [gl, buf, ebuf];
+}
+
+Tests.testBufferData = function(gl) {
+ var data = [0,0,0,0, 1,0,0,0, 0,1,0,0];
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(data), gl.STREAM_DRAW);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(data), gl.STREAM_DRAW);
+ assertOk("zero length data",
+ function(){gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array(0));});
+ assertFail("number for data",
+ function(){gl.bufferSubData(gl.ARRAY_BUFFER, 0, 12);});
+ assertFail("bad target",
+ function(){gl.bufferSubData(gl.TEXTURE_2D, 0, new Float32Array([1,2,3]));});
+ assertFail("array for data",
+ function(){gl.bufferSubData(gl.ARRAY_BUFFER, 0, [1,2,3]);});
+ assertOk("floats in element buffer",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Float32Array([1,2,3]));});
+ assertFail("negative offset",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, -1, new Uint16Array([1,2,3]));});
+ assertFail("offset out of range",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 24, new Uint16Array([1,2,3]));});
+ assertFail("offset out of range",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 2400000, new Uint16Array([1,2,3]));});
+ assertFail("offset out of range",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 19, new Uint16Array([1,2,3]));});
+ assertFail("data too large",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint16Array(data.concat([1])));});
+ assertOk("offset + data.length = end",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 18, new Uint16Array([1,2,3]));});
+ assertOk("offset Infinity",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, Infinity, new Uint16Array([1,2,3]));});
+ assertOk("offset -Infinity",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, -Infinity, new Uint16Array([1,2,3]));});
+ assertOk("offset NaN",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, NaN, new Uint16Array([1,2,3]));});
+ assertOk("good args",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint16Array([1,2,3]));});
+ throwError(gl, 'bufferData0');
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ assertFail("setting buffer 0",
+ function(){gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([1,2,3]));});
+ throwError(gl, 'bufferData1');
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ assertFail("setting buffer 0",
+ function(){gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, new Uint16Array([1,2,3]));});
+ throwError(gl, 'bufferData2');
+}
+
+Tests.endUnit = function(gl, buf, ebuf) {
+ gl.deleteBuffer(buf);
+ gl.deleteBuffer(ebuf);
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html
new file mode 100644
index 0000000000..8aaebf396d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2D.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var texCubeMap = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex, texCubeMap) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+ gl.deleteTexture(tex);
+ gl.deleteTexture(texCubeMap);
+}
+
+Tests.testTexImage2D = function(gl) {
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,1,1,0);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,2,1,0);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,1,2,0);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,16,16,0);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 15,15,1,1,0);
+ var valid_targets = [
+ gl.TEXTURE_2D,
+ 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
+ ];
+ valid_targets.forEach(function(t) {
+ assertOk(function(){gl.copyTexImage2D(t, 0, gl.RGBA, 0,0,1,1,0);});
+ });
+}
+Tests.testRoundtrip = function(gl) {
+ var sh = new Filter(gl, 'identity-flip-vert', 'identity-frag');
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var buf = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]);
+ // red texture
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,16,16,0);
+ 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_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.clearColor(0.0, 0.0, 1.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ // blue framebuffer
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ assertEquals([0,0,255,255], [buf[0], buf[1], buf[2], buf[3]]);
+ sh.apply(); // paint it with texture
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]);
+ sh.destroy();
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="identity-flip-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="identity-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform sampler2D Texture;
+
+varying vec4 texCoord0;
+void main()
+{
+ vec4 c = texture2D(Texture, texCoord0.st);
+ gl_FragColor = c;
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html
new file mode 100644
index 0000000000..802fbc971f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexImage2DBadArgs.html
@@ -0,0 +1,88 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+}
+
+Tests.testTexImage2D = function(gl) {
+ assertOk("height > backHeight", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 17,1,0);
+ });
+ assertOk("width > backWidth", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,17,0);
+ });
+ assertOk("x + width > backWidth", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16,0, 1,1,0);
+ });
+ assertOk("y + height > backHeight", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,16, 1,1,0);
+ });
+ assertOk("Negative X", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, -1,0, 1,1,0);
+ });
+ assertOk("Negative Y", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,-1, 1,1,0);
+ });
+ assertFail("Negative height", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, -1,1,0);
+ });
+ assertFail("Negative width", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,-1,0);
+ });
+ assertFail("Non 0 border", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,1,1);
+ });
+ assertFail("Negative border",function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 1,1,-1);
+ });
+ assertOk("Good Args", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 16,16,0);
+ });
+ assertFail("NPOT texture to > level 0", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 1, gl.RGBA, 0,0, 15,16,0);
+ });
+ assertFail("Bad target", function(){
+ gl.copyTexImage2D(gl.FLOAT, 0, gl.RGBA, 0,0, 16,16,0);
+ });
+ assertFail("Bad internal format", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.FLOAT, 0,0, 16,16,0);
+ });
+ assertFail("Negative level", function(){
+ gl.copyTexImage2D(gl.TEXTURE_2D, -1, gl.RGBA, 0,0, 16,16,0);
+ });
+}
+
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html
new file mode 100644
index 0000000000..82262e3d68
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2D.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var texCubeMap = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex,texCubeMap) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+ gl.deleteTexture(tex);
+ gl.deleteTexture(texCubeMap);
+}
+
+
+Tests.testTexImage2D = function(gl) {
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,16,16,0);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,1,1);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,2,1);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,1,2);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0,16,16);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 15,15,1,1);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 1,1, 0,0,15,15);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 15,15, 0,0,1,1);
+ var valid_targets = [
+ gl.TEXTURE_2D,
+ 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
+ ];
+ valid_targets.forEach(function(t) {
+ assertOk(function(){
+ gl.copyTexImage2D(t, 0, gl.RGBA, 0,0,1,1,0);
+ gl.copyTexSubImage2D(t, 0, 0,0,0,0,1,1);
+ });
+ });
+}
+Tests.testRoundtrip = function(gl) {
+ var sh = new Filter(gl, 'identity-flip-vert', 'identity-frag');
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var buf = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]);
+ // red texture
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, document.getElementById('gl'));
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0,0,0,16,16);
+ 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_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.clearColor(0.0, 0.0, 1.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ // blue framebuffer
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ assertEquals([0,0,255,255], [buf[0], buf[1], buf[2], buf[3]]);
+ sh.apply(); // paint with texture
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ assertEquals([255,0,0,255], [buf[0], buf[1], buf[2], buf[3]]);
+ sh.destroy();
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="identity-flip-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="identity-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform sampler2D Texture;
+
+varying vec4 texCoord0;
+void main()
+{
+ vec4 c = texture2D(Texture, texCoord0.st);
+ gl_FragColor = c;
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html
new file mode 100644
index 0000000000..a170c6c78e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/copyTexSubImage2DBadArgs.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+}
+
+Tests.testTexImage2D = function(gl) {
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0, 16,16, 0);
+ assertGLError(gl, gl.INVALID_VALUE, "width > dst tex width", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 17,1);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "height > dst tex height", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 1,17);
+ });
+ // The spec says the source image dimensions can be out of range.
+ assertOk("x > dst tex width", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 16,0, 1,1);
+ });
+ assertOk("y > dst tex width", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,16, 1,1);
+ });
+ assertOk("x < 0", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, -1,0, 1,1);
+ });
+ assertOk("y < 0", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,-1, 1,1);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "width < 0", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, -1,1);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "height < 0", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 1,-1);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "xoffset < 0", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, -1,0, 0,0, 16,16);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "yoffset < 0", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,-1, 0,0, 16,16);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "dimension out of range", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 4,0, 0,0, 16,16);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "dimension out of range", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,4, 0,0, 16,16);
+ });
+ assertOk("x < 0 full width", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, -1,0, 16,16);
+ });
+ assertOk("y < 0 full height", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,-1, 16,16);
+ });
+ assertOk(function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0,0, 16,16);
+ });
+ assertGLError(gl, gl.INVALID_ENUM, "bad target", function(){
+ gl.copyTexSubImage2D(gl.FLOAT, 0, 0,0, 0,0, 16,16);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "", function(){
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, -1, 0,0, 0,0, 16,16);
+ });
+}
+
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html
new file mode 100644
index 0000000000..a373448631
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/deleteBufferBadArgs.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = getGLContext(canvas);
+ return [gl];
+}
+
+Tests.testDeleteBuffer = function(gl) {
+ assertThrowNoGLError(gl, "number ", function(){ gl.deleteBuffer(1); });
+ assertGLError(gl, gl.NO_ERROR, "null", function(){ gl.deleteBuffer(null); });
+ assertThrowNoGLError(gl, "0", function(){ gl.deleteBuffer(0); });
+ assertThrowNoGLError(gl, "false", function(){ gl.deleteBuffer(false); });
+ assertThrowNoGLError(gl, "true", function(){ gl.deleteBuffer(true); });
+ assertThrowNoGLError(gl, "{}", function(){ gl.deleteBuffer({}); });
+ var tex = gl.createTexture();
+ assertThrowNoGLError(gl, "tex as buf", function(){ gl.deleteBuffer(tex); });
+ var buf = gl.createBuffer();
+ assertOk(function(){ gl.deleteBuffer(buf); });
+ assertOk(function(){ gl.deleteBuffer(buf); });
+ assertOk(function(){ gl.deleteBuffer(buf); });
+ assertOk(function(){ gl.deleteTexture(tex); });
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html
new file mode 100644
index 0000000000..7fdefbb636
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawArrays.html
@@ -0,0 +1,110 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0];
+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0];
+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0];
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var prog = new Shader(gl, 'vert', 'frag');
+ prog.use();
+ var sh = prog.shader.program;
+// log(gl.getShaderInfoLog(prog.shaders[1]));
+ var v = gl.getAttribLocation(sh, 'Vertex');
+ var n = gl.getAttribLocation(sh, 'Normal');
+ var t = gl.getAttribLocation(sh, 'Tex');
+ return [gl,prog,v,n,t];
+}
+
+Tests.setup = function(gl, prog, v,n,t) {
+ assert(0 == gl.getError());
+ return [gl, prog, v,n,t];
+}
+Tests.teardown = function(gl, prog, v,n,t) {
+ gl.disableVertexAttribArray(v);
+ gl.disableVertexAttribArray(n);
+ gl.disableVertexAttribArray(t);
+}
+
+Tests.endUnit = function(gl, prog, v,n,t) {
+ prog.destroy();
+}
+
+Tests.testDrawArraysVBO = function(gl, prog, v,n,t) {
+ var vbo = new VBO(gl, {size:3, data:Quad.vertices});
+ vbo.draw(v);
+ assert(0 == checkError(gl, "vbo.draw"));
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 5, 1);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 6);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 1, 5);});
+ vbo.destroy();
+ assert(0 == checkError(gl, "vbo.destroy"));
+}
+
+Tests.testDrawArraysVBOMulti = function(gl, prog, v,n,t) {
+ // creates VBOs for the quad arrays, binds them with
+ // vertexAttribPointer and calls drawArrays
+ var vbo = new VBO(gl,
+ {size:3, data:Quad.vertices},
+ {size:3, data:Quad.normals},
+ {size:2, data:Quad.texcoords});
+ vbo.draw(v, n, t);
+ assert(0 == checkError(gl, "vbo.draw"));
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 5, 1);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 6);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 1, 5);});
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[1]);
+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0);
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 5, 1);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 2);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 6);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 1, 5);});
+ vbo.destroy();
+ assert(0 == checkError(gl, "vbo.destroy"));
+}
+
+
+</script>
+<script id="vert" type="x-shader/x-vertex">
+ attribute vec3 Vertex;
+ attribute vec3 Normal;
+ attribute vec2 Tex;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ gl_Position = vec4(Vertex * Normal, 1.0);
+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+ precision mediump float;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ vec4 c = texCoord0;
+ gl_FragColor = c;
+ }
+</script>
+
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html
new file mode 100644
index 0000000000..f0c3bb3d27
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/drawElements.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0];
+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0];
+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0];
+var indices = [0,1,2]
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var prog = new Shader(gl, 'vert', 'frag');
+ prog.use();
+ var sh = prog.shader.program;
+ var v = gl.getAttribLocation(sh, 'Vertex');
+ var n = gl.getAttribLocation(sh, 'Normal');
+ var t = gl.getAttribLocation(sh, 'Tex');
+ return [gl,prog,v,n,t];
+}
+
+Tests.setup = function(gl, prog, v,n,t) {
+ assert(0 == gl.getError());
+ return [gl, prog, v,n,t];
+}
+Tests.teardown = function(gl, prog, v,n,t) {
+ gl.disableVertexAttribArray(v);
+ gl.disableVertexAttribArray(n);
+ gl.disableVertexAttribArray(t);
+}
+
+Tests.endUnit = function(gl, prog, v,n,t) {
+ prog.destroy();
+}
+
+Tests.testDrawElementsVBO = function(gl, prog, v,n,t) {
+ var vbo = new VBO(gl,
+ {size:3, data:Quad.vertices},
+ {elements:true, data:Quad.indices});
+ vbo.draw(v);
+ assert(gl.NO_ERROR == checkError(gl, "vbo.draw"));
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 0, gl.UNSIGNED_SHORT, 2*1);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);});
+ vbo.destroy();
+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy"));
+}
+
+Tests.testDrawElementsVBOMulti = function(gl, prog, v,n,t) {
+ // creates VBOs for the quad arrays, binds them with
+ // vertexAttribPointer and calls drawElements
+ var vbo = new VBO(gl,
+ {size:3, data:Quad.vertices},
+ {size:3, data:Quad.normals},
+ {size:2, data:Quad.texcoords},
+ {elements:true, data:Quad.indices});
+ vbo.draw(v, n, t);
+ assert(gl.NO_ERROR == checkError(gl, "vbo.draw"));
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 0, gl.UNSIGNED_SHORT, 2*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);});
+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range",
+ function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 6*2);});
+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range 2",
+ function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1*2);});
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo.vbos[1]);
+ gl.vertexAttribPointer(n, 3, gl.FLOAT, false, 0, 0);
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 5, gl.UNSIGNED_SHORT, 1*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 0, gl.UNSIGNED_SHORT, 2*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0*2);});
+ assertOk(function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 5*2);});
+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range 3",
+ function(){gl.drawElements(gl.TRIANGLES, 1, gl.UNSIGNED_SHORT, 6*2);});
+ assertGLError(gl, gl.INVALID_OPERATION, "count + offset out of range 4",
+ function(){gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 1*2);});
+ vbo.destroy();
+ assert(gl.NO_ERROR == checkError(gl, "vbo.destroy"));
+}
+
+
+</script>
+<script id="vert" type="x-shader/x-vertex">
+ attribute vec3 Vertex;
+ attribute vec3 Normal;
+ attribute vec2 Tex;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ gl_Position = vec4(Vertex * Normal, 1.0);
+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+ precision mediump float;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ vec4 c = texCoord0;
+ gl_FragColor = c;
+ }
+</script>
+
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html
new file mode 100644
index 0000000000..54c1cb0603
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTests.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testIs = function(gl) {
+ var tex = loadTexture(gl, document.getElementById('2d'));
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var fbo = new FBO(gl, 1, 1);
+ fbo.use();
+ var prog = gl.createProgram();
+ var sh1 = gl.createShader(gl.VERTEX_SHADER);
+ var sh2 = gl.createShader(gl.FRAGMENT_SHADER);
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ assert("tex", gl.isTexture(tex));
+ assert("fbo", gl.isFramebuffer(fbo.fbo));
+ assert("rbo", gl.isRenderbuffer(fbo.rbo));
+ assert("prog", gl.isProgram(prog));
+ assert("sh1", gl.isShader(sh1));
+ assert("sh2", gl.isShader(sh2));
+ assert("buf", gl.isBuffer(buf));
+ gl.deleteTexture(tex);
+ gl.deleteFramebuffer(fbo.fbo);
+ gl.deleteRenderbuffer(fbo.rbo);
+ gl.deleteProgram(prog);
+ gl.deleteShader(sh1);
+ gl.deleteShader(sh2);
+ gl.deleteBuffer(buf);
+ // NOTE: we purposely do not unbind things.
+ assert("tex", !gl.isTexture(tex));
+ assert("fbo", !gl.isFramebuffer(fbo.fbo));
+ assert("rbo", !gl.isRenderbuffer(fbo.rbo));
+ assert("prog", !gl.isProgram(prog));
+ assert("sh1", !gl.isShader(sh1));
+ assert("sh2", !gl.isShader(sh2));
+ assert("buf", !gl.isBuffer(buf));
+}
+
+</script>
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+ <canvas id="2d" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html
new file mode 100644
index 0000000000..4d7548140b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/isTestsBadArgs.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas_element" width="1" height="1"></canvas>
+<script type="application/javascript">
+
+function runTest()
+{
+ shouldThrow("gl.isBuffer(gl.createFramebuffer())");
+ shouldThrow("gl.isBuffer(gl.createProgram())");
+ shouldThrow("gl.isBuffer(gl.createRenderbuffer())");
+ shouldThrow("gl.isBuffer(gl.createShader(gl.VERTEX_SHADER))");
+ shouldThrow("gl.isBuffer(gl.createTexture())");
+
+ shouldThrow("gl.isFramebuffer(gl.createBuffer())");
+ shouldThrow("gl.isFramebuffer(gl.createProgram())");
+ shouldThrow("gl.isFramebuffer(gl.createRenderbuffer())");
+ shouldThrow("gl.isFramebuffer(gl.createShader(gl.VERTEX_SHADER))");
+ shouldThrow("gl.isFramebuffer(gl.createTexture())");
+
+ shouldThrow("gl.isProgram(gl.createBuffer())");
+ shouldThrow("gl.isProgram(gl.createFramebuffer())");
+ shouldThrow("gl.isProgram(gl.createRenderbuffer())");
+ shouldThrow("gl.isProgram(gl.createShader(gl.VERTEX_SHADER))");
+ shouldThrow("gl.isProgram(gl.createTexture())");
+
+ shouldThrow("gl.isRenderbuffer(gl.createBuffer())");
+ shouldThrow("gl.isRenderbuffer(gl.createFramebuffer())");
+ shouldThrow("gl.isRenderbuffer(gl.createProgram())");
+ shouldThrow("gl.isRenderbuffer(gl.createShader(gl.VERTEX_SHADER))");
+ shouldThrow("gl.isRenderbuffer(gl.createTexture())");
+
+ shouldThrow("gl.isShader(gl.createBuffer())");
+ shouldThrow("gl.isShader(gl.createFramebuffer())");
+ shouldThrow("gl.isShader(gl.createProgram())");
+ shouldThrow("gl.isShader(gl.createRenderbuffer())");
+ shouldThrow("gl.isShader(gl.createTexture())");
+
+ shouldThrow("gl.isTexture(gl.createBuffer())");
+ shouldThrow("gl.isTexture(gl.createFramebuffer())");
+ shouldThrow("gl.isTexture(gl.createProgram())");
+ shouldThrow("gl.isTexture(gl.createRenderbuffer())");
+ shouldThrow("gl.isTexture(gl.createShader(gl.VERTEX_SHADER))");
+
+ shouldBe("gl.isBuffer(null)", "false");
+ shouldBe("gl.isBuffer(undefined)", "false");
+
+ shouldBe("gl.isFramebuffer(null)", "false");
+ shouldBe("gl.isFramebuffer(undefined)", "false");
+
+ shouldBe("gl.isProgram(null)", "false");
+ shouldBe("gl.isProgram(undefined)", "false");
+
+ shouldBe("gl.isRenderbuffer(null)", "false");
+ shouldBe("gl.isRenderbuffer(undefined)", "false");
+
+ shouldBe("gl.isShader(null)", "false");
+ shouldBe("gl.isShader(undefined)", "false");
+
+ shouldBe("gl.isTexture(null)", "false");
+ shouldBe("gl.isTexture(undefined)", "false");
+}
+
+description("Tests type checking for isX() functions");
+var gl = WebGLTestUtils.create3DContext(document.getElementById("canvas_element"));
+runTest();
+var successfullyParsed = true;
+</script>
+
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html
new file mode 100644
index 0000000000..61589b0a80
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixels.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testReadPixels = function(gl) {
+ var id = new Uint8Array(16 * 16 * 4);
+ assertOk(function(){gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);});
+ assertOk(function(){gl.readPixels(0,0,16,16,gl.RGBA, gl.UNSIGNED_BYTE, id);});
+ assertOk(function(){gl.readPixels(15,15,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);});
+}
+Tests.testReadPixelsRGBA = function(gl) {
+ gl.clearColor(1, 0, 1, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var id = new Uint8Array(4);
+ gl.readPixels(1,2,1,1,gl.RGBA, gl.UNSIGNED_BYTE, id);
+ assertArrayEquals([255, 0, 255, 0], id);
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html
new file mode 100644
index 0000000000..3d155ed61b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/readPixelsBadArgs.html
@@ -0,0 +1,113 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="../../../js/webgl-test-utils.js"></script>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+<canvas id="c" width="128" height="128"></canvas>
+<img id="i">
+<script type="application/javascript">
+var wtu = WebGLTestUtils;
+var defaultImgUrl = "https://get.webgl.org/conformance-resources/opengl_logo.jpg";
+var localImgUrl = "../../../resources/opengl_logo.jpg";
+
+Tests.autoinit = false; // Prevents the test from running until the image is loaded
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testReadPixels = function(gl) {
+ // we can't know if this is going to fail because of negative width
+ // or because the buffer size doesn't match the dimensions.
+ assertSomeGLError(gl, "negative width",
+ function(){gl.readPixels(0,0,-1,1, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4));});
+ assertSomeGLError(gl, "negative height",
+ function(){gl.readPixels(0,0,1,-1, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4));});
+ assertOk("negative x",
+ function(){gl.readPixels(-1,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4));});
+ assertOk("negative y",
+ function(){gl.readPixels(0,-1,1,1, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4));});
+ assertOk("height > backbuffer height",
+ function(){gl.readPixels(0,0,16,17, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(16*17*4));});
+ assertOk("width > backbuffer width",
+ function(){gl.readPixels(0,0,17,16, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(17*16*4));});
+ assertOk("width, height = 0",
+ function(){gl.readPixels(0,0,0,0, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(0));});
+ // we can't know if this is going to fail because of negative width
+ // or because the buffer size doesn't match the dimensions.
+ assertSomeGLError(gl, "bad format",
+ function(){gl.readPixels(0,0,1,1, gl.FLOAT, gl.UNSIGNED_BYTE,
+ new Uint8Array(4*4));});
+ // we can't know if this is going to fail because of negative width
+ // or because the buffer size doesn't match the dimensions.
+ assertSomeGLError(gl, "bad type",
+ function(){gl.readPixels(0,0,1,1, gl.ALPHA, gl.FLOAT,
+ new Uint8Array(1*4));});
+}
+
+Tests.testReadPixelsSOPIMG = function(gl) {
+ var img = document.getElementById("i");
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ // SOP failure
+ assertThrowNoGLError(gl, "throw because img is from another domain",
+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ assertOk("canvas still origin-clean",
+ function(){gl.readPixels(0,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4));});
+ gl.deleteTexture(tex);
+}
+Tests.testReadPixelsSOPCanvas = function(gl) {
+ var img = document.getElementById("i");
+ var c = document.getElementById("c");
+ c.getContext("2d").drawImage(img, 0, 0);
+ assertFail("canvas throws because not origin clean",
+ function(){c.getContext("2d").getImageData(0,0,1,1);});
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ // SOP failure
+ assertThrowNoGLError(gl, "throw because canvas is not origin clean",
+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ assertOk("canvas still origin-clean",
+ function(){gl.readPixels(0,0,1,1, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4));});
+ gl.deleteTexture(tex);
+}
+
+Tests.endUnit = function(gl) {
+};
+
+(async function() {
+ const img = document.getElementById('i');
+ try {
+ await wtu.awaitOrTimeout(wtu.loadCrossOriginImage(img, defaultImgUrl, localImgUrl));
+ } catch (e) {
+ testFailed(`Image setup failed (${e}).`);
+ finishTest();
+ return;
+ }
+ initTests();
+})();
+</script>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html
new file mode 100644
index 0000000000..5da8b6313f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2D.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var texCubeMap = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex,texCubeMap) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+ gl.deleteTexture(tex);
+ gl.deleteTexture(texCubeMap);
+}
+
+Tests.testTexImage2D = function(gl) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2,1,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0]));
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,2,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0]));
+ var valid_targets = [
+ gl.TEXTURE_2D,
+ 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
+ ];
+ valid_targets.forEach(function(t) {
+ assertOk(function(){gl.texImage2D(t, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));});
+ });
+}
+
+Tests.testTexImage2DNull = function(gl) {
+ assertOk(function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, null);});
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html
new file mode 100644
index 0000000000..c818d1b1a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DBadArgs.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+}
+
+Tests.testTexImage2D = function(gl) {
+ var data = new Uint8Array(4);
+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2,1,0,gl.RGBA,gl.UNSIGNED_BYTE, data);
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,2,0,gl.RGBA,gl.UNSIGNED_BYTE, data);
+ });
+ assertGLError(gl, gl.INVALID_ENUM, "bad target", function(){
+ gl.texImage2D(gl.FLOAT, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, null);
+ });
+ assertGLErrorIn(gl, [gl.INVALID_ENUM, gl.INVALID_VALUE],
+ "bad internal format/format", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.FLOAT, 1,1,0,gl.FLOAT,gl.UNSIGNED_BYTE, null);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "border > 0", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,48,gl.RGBA,gl.UNSIGNED_BYTE, null);
+ });
+ // The spec says zero size is OK. If you disagree please list the section
+ // in the spec that details this issue.
+ assertOk("zero size", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0,0,0,gl.RGBA,gl.UNSIGNED_BYTE, null);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "negative width", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, -1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, null);
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "negative height", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,-1,0,gl.RGBA,gl.UNSIGNED_BYTE, null);
+ });
+ assertGLErrorIn(gl, [gl.INVALID_ENUM, gl.INVALID_OPERATION], "bad format", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.FLOAT,gl.UNSIGNED_BYTE, null);
+ });
+ assertGLErrorIn(gl, [gl.INVALID_ENUM, gl.INVALID_OPERATION], "bad type", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.TEXTURE_2D, null);
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array(3));
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "format and type incompatible",function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_SHORT_5_6_5, null);
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "format and type incompatible",function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1,1,0,gl.RGB,gl.UNSIGNED_SHORT_4_4_4_4, null);
+ });
+
+ assertThrows(gl, true, "too few args", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE);
+ });
+ assertThrows(gl, false, "too many args", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null, null);
+ });
+
+ assertThrows(gl, true, "bad TexSourceType", function(){
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, window);
+ });
+ assertThrows(gl, true, "fake TexSourceType", function(){
+ var fakeObj = {
+ get width() { throw 7 },
+ get height() { throw 7 },
+ data: new Uint8ClampedArray(10)
+ };
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, fakeObj);
+ });
+}
+
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html
new file mode 100644
index 0000000000..5cc78d1635
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTML.html
@@ -0,0 +1,149 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="../../../js/webgl-test-utils.js"></script>
+<script id="identity-flip-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="identity-hflip-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(1.0-Tex.s, Tex.t, 0.0, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="identity-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform sampler2D Texture;
+
+varying vec4 texCoord0;
+void main()
+{
+ vec4 c = texture2D(Texture, texCoord0.st);
+ gl_FragColor = c;
+}
+</script>
+</head>
+<body>
+<canvas id="gl" width="256" height="256"></canvas>
+<canvas id="c" width="256" height="256"></canvas>
+<img id="i" width="256" height="256" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAATVElEQVR4nO3d+VPUd57Hcf2b9k9Y+z44+qK7OZoGFVA5VfBGzah9cxpNzGEOoRua5lBEue/DK4fZ7MapmSm3Mlshu8xOdCpDJt3v/aEBAUHAOMG4z0fV53fqU/V6fd7fT/e32bEDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwOvBkar7l+3+GwBsk8xUrT0rTb8vx2Q45janlu7YsWPnsgXgTeYwak85U3Xv5ZiM3+XbUh/l2dICBc6080WZ1ur92baSHRQB8GayGdUWu1HzoSNFO+ZM1f2cbTLM51lT5woc5rkDObbZ/Vm2SEm23VvsyjhV5nJQBsCbxGZQVtmN6p4Mo/YPdqNGHKlayUrXJ9zWlESh0xIvzsmYL3HZ54pzMm6VuRyRMpfTW+pyUAbAm8BmVNVnGNTTdqP6vzOMGrGnaMSZqpNsk17ybKlS6DTL/ixbotRlj5flOubL3I65MpfjVrnbEalYKINSl335vQGA3wKbUW2xGdWRDKP66wyjWhYLwJGiFWeaTrJNBnFbU2SP3ST7s6xSmmuXcrczUe52xstzHfPlbsdcudt5qyzX3lKWlxkszXGeK8mxnyzJySjeQRkArzebQVllM6p7bUb149UF4EjVSmaaTrLS9eKypMgee7ocyLZJmdshFXmZUpHnXFEGB/OzJsrdjqEyt/NmWa49XJbt9Ja6Mk4Vu7hEBF5LNr2q3mZQz9gM6u9XFEBqsgCcaTrJXJgEci0pstdhkv3ZNinNTZbAofwsOZSfJQfzMqU8z5kodzsSZbmOeIXb+XW52zFa5nLcKnPZI2ULl4jFfKIAvB7MOrXFZlBHbAb11zaj+kmGUbNuAWSm65dKYHdGmhRlWqQ8zyFHCnLk+L5cOV6UK0cKXVK5J1sO5mdKhdspZavKoDTX0VPiciTLIHtFGVAIwK/NYlBW2fTqXptB/dhmSJ7+LyqArHS95JiTJVDgNEllQZZ4KgulrrpU6qtLJXBsv5wt3yMn9rvlaIFLDi8vg1xH4mB+5p+Wl0Fpjr2lJMcRLM6ynyvOzjhxIIt7A+BXY9Gr6q0L4/9SAaRoxL7w/L9WAWSbDJJrTZFid4Z4jxZJU/1xufHhOem+ek6il0/LB74qaTxTJoGj++Vs2R45vj9XjhTkyOHdC48JC2VwaHfmnyrczn+vcDsmynLtQyU5GTeLczLCpTk2T3GW7VhxVsae7d4f4I1l1qktVoM6YjOovrYa1D8sFoB9WQE415kA8u1pcvRAjnwUOiLDLQG5190o9242ylRHnQyG/XLz6nmJXqqWD3yV0nC6VPxH98nZst1yfF+uHC10SdXebDmUnyyDqoLs7w7lZ35b7nb8scxt/7dSl32kJCejqyQn40pJTkbZDiYC4NWzaJVVVr2q12ZQPbYa1H9fuwB0SwWQla6XLFOyAAoyTfLW4T3SfuWM3L3RIA/7L8vD/svyZe8l+ezW23Kvu1EmO2ploNkn3VfPSevb1fK+t1Iaz5RJ7cli8R0pktOl+XKsKFkGBxfKoHJv1l8P5mf+uSLP8fvyXMdMmdsRKXc5qotdGQXbvV/AG8WiV9Vb9aoZq141azOoxWbcXAHkWlOkJC9Dak8Xy61PL8iDnotLBbBUBH2X5Yvbl+RBz0W5e6NBJtprpL/ZJzc/Oi/XP3hLWi6ekvc8h6WuukS8Vc/KYPEC8WhhzpOqguzvKvdmfXV4d2b3wfzM9w/lZTENAK+CWaewWHWqiE2v+tqqV/2w2QLINhkkP2Nh/K89ImNtIfmi99Kz8Pcl15dL65J80XtJPr/1tty/2Sh3uxvkzvV6GY+FpO+aV65/8DuJXDwpVzyHpO7UQhmU5MvRIpdU7c2RQ7uz5MR+9x+OFbnuHi3MiVQVuKoP784u2u79A37TLFpllVWn6rXqVY+tetWPGxbAsgvAvU6TvHVot8SunJY7N+rly761g/9lb3J9sWx9fvuSfH77bXnQc1HudTfITFedjLWFpPeaR7o+eEvCjSflyoVDUlddKsHjB+TC4UI5VZwnVQU5ibcq9nx1ujS/58QB99XqYnf5DqYB4OVYdM/Gf6te9Y/k8//GBeCyGKXEnSE11Qek55Pzcv9m48rQrxP8L25fki9uvy2fr1qf3bqYnAxuNMh0Z52MRINy+1OPXP/wd9J+5Yw015+Qd84flJqTxXLhcIGcLM77+UhBzt8uVBa2nqvce/ZsxZ6y7d5L4Ddlcfy36FVfW/SqH6wGlawugMWvATvTlhWAySB5GalydH+OfFRzREajQfn81tvrh/6FwV9cF+WzWxflwa2Lcr/notzrbpSZ6/Uy1VUnkx21MtwSkJ5PLkjHe2elqf64XD53UEInDiQuHC6Yry7Omz1W5HrY+FbF4R1MA8DmWLTKKsuy8d9qUL+wAJZ/C3CPM13OHtwtbe+elunr9fLFusF/PvSf31o7+A96nq37PRflfk+j3L+Z/Fjx7o0Gme6qk4n2Ghlq8UvPx+el/coZuVZ3XC6fq/i57lTx32pOHngUOlUc/jR4lEtCYCMWnareolfNWPSqWatB9dOaBbDGl4BcFqMUu20SOnVAbn58Tu52N27qtP98g9A/WAz9QvAX173FEuhukLvdDcnJoLNWxmM1Mhjxy82Pzknn+2cSsXdPz4cbT8x+GKh8+FHwSO0OSgBYm1mnsJh1qohFr1wY/5XxZwWw/teAs9KTvwtwZH+2XA1VyXBrUB70XFz/tF9nzN9K8O91N8i9hfAvrjs3GuTOjXqZXnhEGG+vkdFoUAbD/p97Pj7/t56r57/pu+b5pOXd6qPbvdfAa8ei3VVl0al6LXrlY4tO+aNFr0pstgD2ONLlzMHdEn2nWqY66+SzlxzzHywb858L/TrBv3vjWfgX18z15JruqpOpzlqZaA8lxmKhv49Gg3/oD/s+3u69Bl47Fp2i3qJVzVh0ylmrTvmTVZ+8AFz5HsDzBZBjNkpxrk2Cpw5I90fn5M6Nhhee9lsOfvfmg3/n+rPwz1yvk5muOpleWJMdtfHJjprvJjtqKABgueT4r4iYdcqvzbpdP1j0yvjqArCv9SJQul7ctlSp2pctHwYrZaglIPdvNq5/2r/gYm9Twb+x9eBPd9XJVHISmJ/qrP1murOGRwBgOZN2V5VFp+y1aBfGf50ysVQAa3wHYLEAstL1stuRLqcr8qX18imZ7KiVBz0XXxj6jZ/vNxn86xsHP/kIUCdTnXXx6c7av0x11PRs914Drx2TTlFv0ipmzDrlrEWn/MmiV8lmCiDbbJADuTYJntwvN67+Tmau1ydDvmbot36x9yz49S8Z/NrFNT/dVfv7qc66k9u918BrxaxePf4r4hsVgHPh9wBzrSlSVZQtHwQqZTDil7vdjVs77bcY/JmtB1+mOmsTkx21T6a6ake2e6+B145Ju6vKpFP2mrTKx2bts/F/8VuALyqA3fY0OV2eLy2XTspEe43cf8Gz/TYEXyY7amWyoyY+1VHz/VRnXfN27zXw2lka/7XKWYtW+ZNFp5TNFEC2ySD7XVYJnNgnXR++JdNddZs+7X+d4NfKZEeNTHbUzE921Dya5PIPWClNrbCYtcnx36Td9YNZp4hbdKqNC2Bh/K8szJL3/YdlIOyTOzcatvwx3sY3+r8o+DLZEUpMtNc8mehg/AeeY1LvqjJplb0mjeKxWav40axVJlYXwFpvAmam6STfnibVZXkSefukjMVCcrd7EyP+eqf9loJfu2HwJzpqZKK9RsbbQ/HJ9tD3k501jP/AaiaNot6kSY7/Zq3iJ7NOKYsXgC8qgCyTQfblWMV/fJ90fnBWJjtrV4z3Wzntn7vRv/586Lca/GcrND/RHno02c74D6yQplZYTFpFxKRVLI3/Kwvg+ReB7CnJ3wFwWVLkcGGWvOc/LP3NXpm5Xv/LT/tNBn9yE8EfT4Y/MR4LPRlvDzH+A6uZNYpKk3ZXb/rC+G/SKhKbLYC8jDQ5VZYn4YsnZLQtKHdubC70mx3zf0nwx9tDMh4LyVgsFB+PBb8fb2f8B56TrlHUp2sV0yaNYmn830wBZKXrZV+2RXzH90nH+2dloqMmWQCv4LR/+eCHloK/EH4ZjwXnx2PBR2PtQcZ/YDmTRpmarlY0mTS7vkrTKP5q0ip+NuuUYtmgABypWnFZjHKoIFOueA9JX5NHprvqNh36zZ72vyT4C+FPjLYFn4zHgoz/wGomza7d6ZpdMZNG8Y1Jo3hi1i48/2+iAPIyUuVkqVuaGk/ISDQoM9df3Wm/Mvg1Ww7+WCwkY21BGW0Lxkfbgt+PxUKM/8BqaZpdu9PUiiaTRvGVSav4y9InABsUQGa6XoqyLeI9ViTt752R8fbQqsC/4tN+i8EfawvKaDQoI9HA/Ghb8JuxKOM/8ByT5l9T09SKQLpGMWTSKv7TrFU8NeuUieUFYFv1YyCOVK3kmJPj/7veg9J7zSNTnbWv6LR/BcFfWCPRQHwkGvjLSDTAm3/AetLVyjyTRvmOSauYNOsU35p1yn9sVABuW6qcLM2Vaw3HZbg1INNdr+a0X/sz/K0FfzQalNFoIHn6RwO/H2kL8uYf8CImza5Ck27Xe2atcsqiU8bXLYAUjWSm66QwyyzeY4USu3JaxmKhtUP/i0/7mhWhXxH8tvWCH5SRaEBGo4HESKv/yWhrgMs/YDPSdcois1bxvkWnfGrRK+NrFYA9RSvZZoMc3OuUdzwH5fa1CzLRUfNPPe3H1zjt1wv+4hpuDcRHooHvR6IBLv+AzTLrlEVmnfKhRad8al3z58C04ralyImSXLnWcEyGWv0y2VkrU13Ph/6lTvsNgj+6QfBHWgMy3BqQ4Vb//HBr4NFI1M/lH7AVFr0qYNGrHlr1qqc2gyq+/E1AZ5pOCrNM4jlaIG1XTstoW/Cfd9q/VPADMtzqTwy3+J8MM/4DL2XnihIwquI2o1rsKRrJNhmkYq9DLl+okFufnJfx9ppnoV/vc/utnvaxNcb8TQU/IMOtfhlq8ceHW/zfD0cDF7Z7I4Hfqp02vSpg06se2gzqpxlGTdyeopFca4ocL3HJp/VHZTDik4mOzY34L33ab+7EXwz+wvLND7cEbo20BjK3exOB37KdNqM6YDOoH2YY1U+dabp4QaZJLhzZK9F3q2UkGpCJDU/70Ks77TcMvl+GWnyJwYjvyVBL4J3t3jzgTbDTZlQHMoyah9lm/dOKPc74pfPl0vPxORmLhX6d035TwV9YEV98sMU/NRDm8g94VXbaU7UBl8X48ESJ6+kn9Ud+Hgh7EuPtoVdz2rdtJvQvDv5gxLewvH8ciHg7hloClu3eNOBNstNtSw34jxc9bH2nenaoxTc33h6aH4uF4uPtwcR48n/u/RNO+80G3ydDEd//DIR99wbCvsbt3izgTbTzaqgy0PPxufBINBAbbw89Go+FZsdjobnx9tDcaCw4P9oWjI/FgomxWCAx+gpO++G1xvxVwR+M+GQw7P1xMOx7PBj29fZHvFXbvVHAm2rn4prsrKkd6wiFR9tDsfH2mthILPRorC04O9YWmhuNheZG2wLzI9FgfLQtkBiNBhLPhf4XnPaLayDik4GwTwbC3v8daPY+HIj4Pupv9jL+A7+CncvXeHtN7WgsGB6NhWKjsVBsJBp8NBoNzo5EA3MLa364NRAfafUnhpPr5U77lcGXgbD37wNhz5/7m70jA2HPmW3eE+D/rZWF0BasHW4LhkeigdhILBQbbg08Gm4NzA63+OeGW/xzQ63++aEWf3yoxZdIrmWhb3k+9INLoV8KvvQ3e+MDzd4f+ps9/9Ef9rYNRHyObd4DAAtWFMJoW7B2uDUYHooGYkPRQGyoxf9oqMU3OxTxzQ1FfHNDLb75oYgvPhjxJpZWeO3gJ8PvSfQ3eX8aCHtn+5u9M33NXP4Br7MVhTDcGqgdbvWHB1v9scFWf2ww4n80GPHNDoa9c4MR39xg2Ds3EPbOD4S98YGwJzEQ9iT6m73S3+yVvmbPfH+zZ76vyfO0v9n7p75mb29/M5d/wG/Jc4Uw1OIP90f8scGIP9Yf8ccGwr5HA2Hv7ECzd26g2TvXlwx9vK/Z821/s+e/+po83/Y3eT7ra/Y0cfkH/LbtXL2GWny1A2FfuC/sjfWHvbH+Zs+jvrD3Zm+TZ6i3yTPW1+yZ7GvyXO9r9vi3908H8M+wohB6m7xlt695Tw6EfecGw15ff5Pnnb5mT6D32oUD2/x3AvgV7dyxY8fOgSavu7/Jk9V3zave7j8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICV/g9tPJEQu1XvmQAAAABJRU5ErkJggg==">
+<img id="i2">
+
+<script>
+var wtu = WebGLTestUtils;
+var defaultImgUrl = "https://get.webgl.org/conformance-resources/thunderbird-logo-64x64.png";
+var localImgUrl = "../../../resources/thunderbird-logo-64x64.png";
+
+Tests.autoinit = false; // Prevents the test from running until the image is loaded
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ gl.viewport(0,0,canvas.width,canvas.height);
+ gl.clearColor(0,0,1,1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.disable(gl.DEPTH_TEST);
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var texCubeMap = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap);
+ return [gl]
+}
+
+Tests.teardown = function(gl, tex, texCubeMap) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+ gl.deleteTexture(texCubeMap);
+}
+
+Tests.testTexImage2D = function(gl) {
+ gl.enable(gl.BLEND);
+ var img = document.getElementById('i');
+ var c = document.getElementById('c');
+ var ctx = c.getContext('2d');
+ ctx.drawImage(img,0,0);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
+ 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_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ var f = new Filter(gl, 'identity-flip-vert', 'identity-frag');
+ gl.blendFunc(gl.ONE, gl.ZERO);
+ f.apply();
+ f.destroy();
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ f = new Filter(gl, 'identity-hflip-vert', 'identity-frag');
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
+ f.apply();
+ f.destroy();
+ var valid_targets = [
+ gl.TEXTURE_2D,
+ 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
+ ];
+ valid_targets.forEach(function(t) {
+ assertOk(function(){gl.texImage2D(t, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+ assertOk(function(){gl.texImage2D(t, 1, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+ });
+}
+
+Tests.testTexImage2DNonSOP = function(gl) {
+ var img = document.getElementById('i2');
+ var c = document.getElementById('c');
+ var ctx = c.getContext('2d');
+ ctx.drawImage(img,0,0);
+ assertThrowNoGLError(gl, "texImage2D with cross-origin image should throw exception.",
+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+ assertThrowNoGLError(gl, "texImage2D with dirty origin canvas should throw exception.",
+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+}
+
+Tests.endUnit = function(gl) {
+};
+
+(async function() {
+ const img = document.getElementById('i2');
+ try {
+ await wtu.awaitOrTimeout(wtu.loadCrossOriginImage(img, defaultImgUrl, localImgUrl));
+ } catch (e) {
+ testFailed(`Image setup failed (${e}).`);
+ finishTest();
+ return;
+ }
+ initTests();
+})();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html
new file mode 100644
index 0000000000..0953cd8884
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texImage2DHTMLBadArgs.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<!--
+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.
+-->
+<meta charset="utf-8">
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ return [gl, tex];
+}
+
+Tests.testTexImage2D = function(gl) {
+ var b = document.createElement('b');
+ var div = document.createElement('div');
+ var c = document.getElementById('c');
+ assertFail("bad element b",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, b); });
+ assertFail("bad element div",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, div); });
+ assertFail("no element",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, 0); });
+ assertFail("string as data",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, "foo"); });
+ assertOk("canvas as data",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertFail("bad target",
+ function() {gl.texImage2D(gl.FLOAT, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+}
+
+Tests.endUnit = function(gl, tex) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+<canvas id="c" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html
new file mode 100644
index 0000000000..ef0912aa8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2D.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var texCubeMap = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex,texCubeMap) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+ gl.deleteTexture(texCubeMap);
+}
+
+Tests.testTexSubImage2D = function(gl) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2,2,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]));
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 2,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0]));
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,2,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0]));
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 1,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,1, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 1,1, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ gl.texImage2D(gl.TEXTURE_2D, 1,gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ gl.texSubImage2D(gl.TEXTURE_2D, 1, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ var valid_targets = [
+ gl.TEXTURE_2D,
+ 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
+ ];
+ valid_targets.forEach(function(t) {
+ assertOk(function(){
+ gl.texImage2D(t, 0, gl.RGBA, 1,1,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ gl.texSubImage2D(t, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ });
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html
new file mode 100644
index 0000000000..9573607b3b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DBadArgs.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ return [gl]
+}
+
+Tests.teardown = function(gl,tex) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+}
+
+Tests.testTexImage2D = function(gl) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2,2,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]));
+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 2,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 1,2,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_ENUM, "bad target", function(){
+ gl.texSubImage2D(gl.FLOAT, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "width out of range", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 3,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "height out of range", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 1,3,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "dimension out of range", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D,0, 1,1, 2,1, gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "dimension out of range", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D,0, 1,1, 1,2, gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]));
+ });
+ assertOk("zero size", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 0,0,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertSomeGLError(gl, "negative width", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, -1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertSomeGLError(gl, "negative height", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, 1,-1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "negative x", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,-1,1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_VALUE, "negative y", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0,1,-1,1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertGLErrorIn(gl, [gl.INVALID_OPERATION, gl.INVALID_ENUM], "bad format", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.FLOAT,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]));
+ });
+ assertGLErrorIn(gl, [gl.INVALID_OPERATION, gl.INVALID_ENUM], "bad type", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.TEXTURE_2D, new Uint8Array([0,0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "not enough data", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "format does not match internal format", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGB,gl.UNSIGNED_BYTE, new Uint8Array([0,0,0]));
+ });
+ assertGLError(gl, gl.INVALID_OPERATION, "type does not match original", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1,gl.RGBA,gl.UNSIGNED_SHORT_4_4_4_4, new Uint16Array([0]));
+ });
+
+ assertThrows(gl, true, "too few args", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE);
+ });
+ assertThrows(gl, false, "too many args", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,0,0,0]), null);
+ });
+
+ assertThrows(gl, true, "bad TexSourceType", function(){
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, window);
+ });
+ assertThrows(gl, true, "fake TexSourceType", function(){
+ var fakeObj = {
+ get width() { throw 7 },
+ get height() { throw 7 },
+ data: new Uint8ClampedArray(10)
+ };
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, fakeObj);
+ });
+}
+
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html
new file mode 100644
index 0000000000..4f8ec2aa09
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTML.html
@@ -0,0 +1,160 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript" src="../../../js/webgl-test-utils.js"></script>
+<script id="identity-flip-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, 0.0, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="identity-hflip-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(1.0-Tex.s, Tex.t, 0.0, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="identity-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform sampler2D Texture;
+
+varying vec4 texCoord0;
+void main()
+{
+ vec4 c = texture2D(Texture, texCoord0.st);
+ gl_FragColor = c;
+}
+</script>
+</head><body>
+<canvas id="gl" width="256" height="256"></canvas>
+<canvas id="c" width="256" height="256"></canvas>
+<img id="i" width="256" height="256" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAATVElEQVR4nO3d+VPUd57Hcf2b9k9Y+z44+qK7OZoGFVA5VfBGzah9cxpNzGEOoRua5lBEue/DK4fZ7MapmSm3Mlshu8xOdCpDJt3v/aEBAUHAOMG4z0fV53fqU/V6fd7fT/e32bEDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwOvBkar7l+3+GwBsk8xUrT0rTb8vx2Q45janlu7YsWPnsgXgTeYwak85U3Xv5ZiM3+XbUh/l2dICBc6080WZ1ur92baSHRQB8GayGdUWu1HzoSNFO+ZM1f2cbTLM51lT5woc5rkDObbZ/Vm2SEm23VvsyjhV5nJQBsCbxGZQVtmN6p4Mo/YPdqNGHKlayUrXJ9zWlESh0xIvzsmYL3HZ54pzMm6VuRyRMpfTW+pyUAbAm8BmVNVnGNTTdqP6vzOMGrGnaMSZqpNsk17ybKlS6DTL/ixbotRlj5flOubL3I65MpfjVrnbEalYKINSl335vQGA3wKbUW2xGdWRDKP66wyjWhYLwJGiFWeaTrJNBnFbU2SP3ST7s6xSmmuXcrczUe52xstzHfPlbsdcudt5qyzX3lKWlxkszXGeK8mxnyzJySjeQRkArzebQVllM6p7bUb149UF4EjVSmaaTrLS9eKypMgee7ocyLZJmdshFXmZUpHnXFEGB/OzJsrdjqEyt/NmWa49XJbt9Ja6Mk4Vu7hEBF5LNr2q3mZQz9gM6u9XFEBqsgCcaTrJXJgEci0pstdhkv3ZNinNTZbAofwsOZSfJQfzMqU8z5kodzsSZbmOeIXb+XW52zFa5nLcKnPZI2ULl4jFfKIAvB7MOrXFZlBHbAb11zaj+kmGUbNuAWSm65dKYHdGmhRlWqQ8zyFHCnLk+L5cOV6UK0cKXVK5J1sO5mdKhdspZavKoDTX0VPiciTLIHtFGVAIwK/NYlBW2fTqXptB/dhmSJ7+LyqArHS95JiTJVDgNEllQZZ4KgulrrpU6qtLJXBsv5wt3yMn9rvlaIFLDi8vg1xH4mB+5p+Wl0Fpjr2lJMcRLM6ynyvOzjhxIIt7A+BXY9Gr6q0L4/9SAaRoxL7w/L9WAWSbDJJrTZFid4Z4jxZJU/1xufHhOem+ek6il0/LB74qaTxTJoGj++Vs2R45vj9XjhTkyOHdC48JC2VwaHfmnyrczn+vcDsmynLtQyU5GTeLczLCpTk2T3GW7VhxVsae7d4f4I1l1qktVoM6YjOovrYa1D8sFoB9WQE415kA8u1pcvRAjnwUOiLDLQG5190o9242ylRHnQyG/XLz6nmJXqqWD3yV0nC6VPxH98nZst1yfF+uHC10SdXebDmUnyyDqoLs7w7lZ35b7nb8scxt/7dSl32kJCejqyQn40pJTkbZDiYC4NWzaJVVVr2q12ZQPbYa1H9fuwB0SwWQla6XLFOyAAoyTfLW4T3SfuWM3L3RIA/7L8vD/svyZe8l+ezW23Kvu1EmO2ploNkn3VfPSevb1fK+t1Iaz5RJ7cli8R0pktOl+XKsKFkGBxfKoHJv1l8P5mf+uSLP8fvyXMdMmdsRKXc5qotdGQXbvV/AG8WiV9Vb9aoZq141azOoxWbcXAHkWlOkJC9Dak8Xy61PL8iDnotLBbBUBH2X5Yvbl+RBz0W5e6NBJtprpL/ZJzc/Oi/XP3hLWi6ekvc8h6WuukS8Vc/KYPEC8WhhzpOqguzvKvdmfXV4d2b3wfzM9w/lZTENAK+CWaewWHWqiE2v+tqqV/2w2QLINhkkP2Nh/K89ImNtIfmi99Kz8Pcl15dL65J80XtJPr/1tty/2Sh3uxvkzvV6GY+FpO+aV65/8DuJXDwpVzyHpO7UQhmU5MvRIpdU7c2RQ7uz5MR+9x+OFbnuHi3MiVQVuKoP784u2u79A37TLFpllVWn6rXqVY+tetWPGxbAsgvAvU6TvHVot8SunJY7N+rly761g/9lb3J9sWx9fvuSfH77bXnQc1HudTfITFedjLWFpPeaR7o+eEvCjSflyoVDUlddKsHjB+TC4UI5VZwnVQU5ibcq9nx1ujS/58QB99XqYnf5DqYB4OVYdM/Gf6te9Y/k8//GBeCyGKXEnSE11Qek55Pzcv9m48rQrxP8L25fki9uvy2fr1qf3bqYnAxuNMh0Z52MRINy+1OPXP/wd9J+5Yw015+Qd84flJqTxXLhcIGcLM77+UhBzt8uVBa2nqvce/ZsxZ6y7d5L4Ddlcfy36FVfW/SqH6wGlawugMWvATvTlhWAySB5GalydH+OfFRzREajQfn81tvrh/6FwV9cF+WzWxflwa2Lcr/notzrbpSZ6/Uy1VUnkx21MtwSkJ5PLkjHe2elqf64XD53UEInDiQuHC6Yry7Omz1W5HrY+FbF4R1MA8DmWLTKKsuy8d9qUL+wAJZ/C3CPM13OHtwtbe+elunr9fLFusF/PvSf31o7+A96nq37PRflfk+j3L+Z/Fjx7o0Gme6qk4n2Ghlq8UvPx+el/coZuVZ3XC6fq/i57lTx32pOHngUOlUc/jR4lEtCYCMWnareolfNWPSqWatB9dOaBbDGl4BcFqMUu20SOnVAbn58Tu52N27qtP98g9A/WAz9QvAX173FEuhukLvdDcnJoLNWxmM1Mhjxy82Pzknn+2cSsXdPz4cbT8x+GKh8+FHwSO0OSgBYm1mnsJh1qohFr1wY/5XxZwWw/teAs9KTvwtwZH+2XA1VyXBrUB70XFz/tF9nzN9K8O91N8i9hfAvrjs3GuTOjXqZXnhEGG+vkdFoUAbD/p97Pj7/t56r57/pu+b5pOXd6qPbvdfAa8ei3VVl0al6LXrlY4tO+aNFr0pstgD2ONLlzMHdEn2nWqY66+SzlxzzHywb858L/TrBv3vjWfgX18z15JruqpOpzlqZaA8lxmKhv49Gg3/oD/s+3u69Bl47Fp2i3qJVzVh0ylmrTvmTVZ+8AFz5HsDzBZBjNkpxrk2Cpw5I90fn5M6Nhhee9lsOfvfmg3/n+rPwz1yvk5muOpleWJMdtfHJjprvJjtqKABgueT4r4iYdcqvzbpdP1j0yvjqArCv9SJQul7ctlSp2pctHwYrZaglIPdvNq5/2r/gYm9Twb+x9eBPd9XJVHISmJ/qrP1murOGRwBgOZN2V5VFp+y1aBfGf50ysVQAa3wHYLEAstL1stuRLqcr8qX18imZ7KiVBz0XXxj6jZ/vNxn86xsHP/kIUCdTnXXx6c7av0x11PRs914Drx2TTlFv0ipmzDrlrEWn/MmiV8lmCiDbbJADuTYJntwvN67+Tmau1ydDvmbot36x9yz49S8Z/NrFNT/dVfv7qc66k9u918BrxaxePf4r4hsVgHPh9wBzrSlSVZQtHwQqZTDil7vdjVs77bcY/JmtB1+mOmsTkx21T6a6ake2e6+B145Ju6vKpFP2mrTKx2bts/F/8VuALyqA3fY0OV2eLy2XTspEe43cf8Gz/TYEXyY7amWyoyY+1VHz/VRnXfN27zXw2lka/7XKWYtW+ZNFp5TNFEC2ySD7XVYJnNgnXR++JdNddZs+7X+d4NfKZEeNTHbUzE921Dya5PIPWClNrbCYtcnx36Td9YNZp4hbdKqNC2Bh/K8szJL3/YdlIOyTOzcatvwx3sY3+r8o+DLZEUpMtNc8mehg/AeeY1LvqjJplb0mjeKxWav40axVJlYXwFpvAmam6STfnibVZXkSefukjMVCcrd7EyP+eqf9loJfu2HwJzpqZKK9RsbbQ/HJ9tD3k501jP/AaiaNot6kSY7/Zq3iJ7NOKYsXgC8qgCyTQfblWMV/fJ90fnBWJjtrV4z3Wzntn7vRv/586Lca/GcrND/RHno02c74D6yQplZYTFpFxKRVLI3/Kwvg+ReB7CnJ3wFwWVLkcGGWvOc/LP3NXpm5Xv/LT/tNBn9yE8EfT4Y/MR4LPRlvDzH+A6uZNYpKk3ZXb/rC+G/SKhKbLYC8jDQ5VZYn4YsnZLQtKHdubC70mx3zf0nwx9tDMh4LyVgsFB+PBb8fb2f8B56TrlHUp2sV0yaNYmn830wBZKXrZV+2RXzH90nH+2dloqMmWQCv4LR/+eCHloK/EH4ZjwXnx2PBR2PtQcZ/YDmTRpmarlY0mTS7vkrTKP5q0ip+NuuUYtmgABypWnFZjHKoIFOueA9JX5NHprvqNh36zZ72vyT4C+FPjLYFn4zHgoz/wGomza7d6ZpdMZNG8Y1Jo3hi1i48/2+iAPIyUuVkqVuaGk/ISDQoM9df3Wm/Mvg1Ww7+WCwkY21BGW0Lxkfbgt+PxUKM/8BqaZpdu9PUiiaTRvGVSav4y9InABsUQGa6XoqyLeI9ViTt752R8fbQqsC/4tN+i8EfawvKaDQoI9HA/Ghb8JuxKOM/8ByT5l9T09SKQLpGMWTSKv7TrFU8NeuUieUFYFv1YyCOVK3kmJPj/7veg9J7zSNTnbWv6LR/BcFfWCPRQHwkGvjLSDTAm3/AetLVyjyTRvmOSauYNOsU35p1yn9sVABuW6qcLM2Vaw3HZbg1INNdr+a0X/sz/K0FfzQalNFoIHn6RwO/H2kL8uYf8CImza5Ck27Xe2atcsqiU8bXLYAUjWSm66QwyyzeY4USu3JaxmKhtUP/i0/7mhWhXxH8tvWCH5SRaEBGo4HESKv/yWhrgMs/YDPSdcois1bxvkWnfGrRK+NrFYA9RSvZZoMc3OuUdzwH5fa1CzLRUfNPPe3H1zjt1wv+4hpuDcRHooHvR6IBLv+AzTLrlEVmnfKhRad8al3z58C04ralyImSXLnWcEyGWv0y2VkrU13Ph/6lTvsNgj+6QfBHWgMy3BqQ4Vb//HBr4NFI1M/lH7AVFr0qYNGrHlr1qqc2gyq+/E1AZ5pOCrNM4jlaIG1XTstoW/Cfd9q/VPADMtzqTwy3+J8MM/4DL2XnihIwquI2o1rsKRrJNhmkYq9DLl+okFufnJfx9ppnoV/vc/utnvaxNcb8TQU/IMOtfhlq8ceHW/zfD0cDF7Z7I4Hfqp02vSpg06se2gzqpxlGTdyeopFca4ocL3HJp/VHZTDik4mOzY34L33ab+7EXwz+wvLND7cEbo20BjK3exOB37KdNqM6YDOoH2YY1U+dabp4QaZJLhzZK9F3q2UkGpCJDU/70Ks77TcMvl+GWnyJwYjvyVBL4J3t3jzgTbDTZlQHMoyah9lm/dOKPc74pfPl0vPxORmLhX6d035TwV9YEV98sMU/NRDm8g94VXbaU7UBl8X48ESJ6+kn9Ud+Hgh7EuPtoVdz2rdtJvQvDv5gxLewvH8ciHg7hloClu3eNOBNstNtSw34jxc9bH2nenaoxTc33h6aH4uF4uPtwcR48n/u/RNO+80G3ydDEd//DIR99wbCvsbt3izgTbTzaqgy0PPxufBINBAbbw89Go+FZsdjobnx9tDcaCw4P9oWjI/FgomxWCAx+gpO++G1xvxVwR+M+GQw7P1xMOx7PBj29fZHvFXbvVHAm2rn4prsrKkd6wiFR9tDsfH2mthILPRorC04O9YWmhuNheZG2wLzI9FgfLQtkBiNBhLPhf4XnPaLayDik4GwTwbC3v8daPY+HIj4Pupv9jL+A7+CncvXeHtN7WgsGB6NhWKjsVBsJBp8NBoNzo5EA3MLa364NRAfafUnhpPr5U77lcGXgbD37wNhz5/7m70jA2HPmW3eE+D/rZWF0BasHW4LhkeigdhILBQbbg08Gm4NzA63+OeGW/xzQ63++aEWf3yoxZdIrmWhb3k+9INLoV8KvvQ3e+MDzd4f+ps9/9Ef9rYNRHyObd4DAAtWFMJoW7B2uDUYHooGYkPRQGyoxf9oqMU3OxTxzQ1FfHNDLb75oYgvPhjxJpZWeO3gJ8PvSfQ3eX8aCHtn+5u9M33NXP4Br7MVhTDcGqgdbvWHB1v9scFWf2ww4n80GPHNDoa9c4MR39xg2Ds3EPbOD4S98YGwJzEQ9iT6m73S3+yVvmbPfH+zZ76vyfO0v9n7p75mb29/M5d/wG/Jc4Uw1OIP90f8scGIP9Yf8ccGwr5HA2Hv7ECzd26g2TvXlwx9vK/Z821/s+e/+po83/Y3eT7ra/Y0cfkH/LbtXL2GWny1A2FfuC/sjfWHvbH+Zs+jvrD3Zm+TZ6i3yTPW1+yZ7GvyXO9r9vi3908H8M+wohB6m7xlt695Tw6EfecGw15ff5Pnnb5mT6D32oUD2/x3AvgV7dyxY8fOgSavu7/Jk9V3zave7j8IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICV/g9tPJEQu1XvmQAAAABJRU5ErkJggg==">
+<img id="i2">
+
+<script>
+var wtu = WebGLTestUtils;
+var defaultImgUrl = "https://get.webgl.org/conformance-resources/thunderbird-logo-64x64.png";
+var localImgUrl = "../../../resources/thunderbird-logo-64x64.png";
+
+Tests.autoinit = false; // Prevents the test from running until the image is loaded
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+
+ gl.viewport(0,0,canvas.width,canvas.height);
+ gl.clearColor(0,0,1,1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.disable(gl.DEPTH_TEST);
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ var texCubeMap = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCubeMap);
+ return [gl]
+}
+
+Tests.teardown = function(gl, tex, texCubeMap) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+ gl.deleteTexture(texCubeMap);
+}
+
+Tests.testTexImage2D = function(gl) {
+ gl.enable(gl.BLEND);
+ var img = document.getElementById('i');
+ var c = document.getElementById('c');
+ var ctx = c.getContext('2d');
+ ctx.drawImage(img,0,0);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, img);
+ 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_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ var f = new Filter(gl, 'identity-flip-vert', 'identity-frag');
+ gl.blendFunc(gl.ONE, gl.ZERO);
+ f.apply();
+ f.destroy();
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ f = new Filter(gl, 'identity-hflip-vert', 'identity-frag');
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
+ f.apply();
+ f.destroy();
+ var valid_targets = [
+ gl.TEXTURE_2D,
+ 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
+ ];
+ valid_targets.forEach(function(t) {
+ assertOk(function(){
+ gl.texImage2D(t, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ gl.texSubImage2D(t, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ });
+ assertOk(function(){
+ gl.texImage2D(t, 1, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ gl.texSubImage2D(t, 1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ });
+ });
+}
+
+Tests.testTexImage2DNonSOP = function(gl) {
+ var img = document.getElementById('i2');
+ var c = document.getElementById('c');
+ var ctx = c.getContext('2d');
+ ctx.drawImage(img,0,0);
+ assertThrowNoGLError(gl, "texImage2D with cross-origin image should throw exception.",
+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+ assertThrowNoGLError(gl, "texSubImage2D with cross-origin image should throw exception.",
+ function(){gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, img);});
+ assertThrowNoGLError(gl, "texImage2D with dirty origin canvas should throw exception.",
+ function(){gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+ assertThrowNoGLError(gl, "texSubImage2D with dirty origin canvas should throw exception.",
+ function(){gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c);});
+}
+
+Tests.endUnit = function(gl) {
+};
+
+(async function() {
+ const img = document.getElementById('i2');
+ try {
+ await wtu.awaitOrTimeout(wtu.loadCrossOriginImage(img, defaultImgUrl, localImgUrl));
+ } catch (e) {
+ testFailed(`Image setup failed (${e}).`);
+ finishTest();
+ return;
+ }
+ initTests();
+})();
+</script>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html
new file mode 100644
index 0000000000..0d860bcaaa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/texSubImage2DHTMLBadArgs.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ return [gl, tex];
+}
+
+Tests.testTexImage2D = function(gl) {
+ var b = document.createElement('b');
+ var div = document.createElement('div');
+ var c = document.getElementById('c');
+ assertOk("make texture",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_VALUE, "y + height > texture height",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 1, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_VALUE, "x + width > texture width",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_VALUE, "negative x",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_VALUE, "negative y",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_VALUE, "negative level",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, -1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertThrowNoGLError(gl, "bad element b",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, b); });
+ assertThrowNoGLError(gl, "bad element div",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, div); });
+ assertThrowNoGLError(gl, "no element",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, 0); });
+ assertThrowNoGLError(gl, "string as data",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0,0, 0, gl.RGBA, gl.UNSIGNED_BYTE, "foo"); });
+ assertGLError(gl, gl.INVALID_ENUM, "bad target",
+ function() {gl.texSubImage2D(gl.FLOAT, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertOk("good args",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_OPERATION, "format not same as original",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_OPERATION, "type not same as original",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c); });
+ assertOk("make texture RGB",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, c); });
+ assertOk("format same as original RGB",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_OPERATION, "format not same as original RGB",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_OPERATION, "type not same as original RGB",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_SHORT_5_6_5, c); });
+ assertOk("make texture RGBA 4_4_4_4",
+ function() {gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c); });
+ assertOk("format same as original RGBA 4_4_4_4",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c); });
+ assertGLError(gl, gl.INVALID_OPERATION, "format not same as original RGBA 4_4_4_4",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGB, gl.UNSIGNED_BYTE, c); });
+ assertGLError(gl, gl.INVALID_OPERATION, "type not same as original RGBA 4_4_4_4",
+ function() {gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, gl.RGBA, gl.UNSIGNED_BYTE, c); });
+}
+
+Tests.endUnit = function(gl, tex) {
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(tex);
+}
+
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+<canvas id="c" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html
new file mode 100644
index 0000000000..cae388fd4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrix.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testUniformf = function(gl) {
+ var sh = new Filter(gl, 'foobar-vert', 'foobar-frag');
+ sh.apply(function(f){
+ var foo = f.uniform('foo');
+ var bar = f.uniform('bar');
+ var bar3 = f.uniform('bar3');
+ gl.uniformMatrix4fv(foo, false, [1,0,0,0, 0,2,0,0, 0,0,3,0, 0,0,0,4]);
+ gl.uniformMatrix2fv(bar, false, [2,1, 2,2]);
+ gl.uniformMatrix3fv(bar3, false, [2,2,2, 2,2,2, 2,1,2]);
+ });
+ var d = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertEquals([1,2,3,8], [d[0], d[1], d[2], d[3]]);
+ sh.destroy();
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="foobar-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+uniform mat2 bar;
+uniform mat3 bar3;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, bar[0][1]+bar3[2][1], 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="foobar-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform mat4 foo;
+
+varying vec4 texCoord0;
+void main()
+{
+ gl_FragColor = vec4(foo[0][0]/256.0, foo[1][1]/256.0, foo[2][2]/256.0, foo[3][3]*texCoord0.z/256.0);
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html
new file mode 100644
index 0000000000..1355cd547f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformMatrixBadArgs.html
@@ -0,0 +1,143 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var unwrappedGL = getGLContext(canvas);
+ var gl = wrapGLContext(unwrappedGL);
+ return [gl, unwrappedGL];
+}
+
+Tests.testUniformf = function(gl, unwrappedGL) {
+ var sh = new Filter(gl, 'foobar-vert', 'foobar-frag');
+ sh.apply(function(f){
+ var fm4 = f.uniform('fm4');
+ var fm2 = f.uniform('fm2');
+ var fm3 = f.uniform('fm3');
+ assertGLError(gl, gl.INVALID_VALUE, "bad transpose 4fv",
+ function(){gl.uniformMatrix4fv(fm4, true, [1,0,0,0, 0,2,0,0, 0,0,3,0, 0,0,0,4]);});
+ assertGLError(gl, gl.INVALID_VALUE, "bad transpose 3fv",
+ function(){gl.uniformMatrix3fv(fm3, true, [1,0,0, 0,2,0, 0,0,3]);});
+ assertGLError(gl, gl.INVALID_VALUE, "bad transpose 2fv",
+ function(){gl.uniformMatrix2fv(fm2, true, [1,0, 0,2]);});
+ assertThrowNoGLError(gl, "bad location",
+ function(){gl.uniformMatrix4fv(588939, false, [1,0,0,0, 0,2,0,0, 0,0,3,0, 0,0,0,4]);});
+ assertThrowNoGLError(gl, "bad location (negative)",
+ function(){gl.uniformMatrix4fv(-588939, false, [1,0,0,0, 0,2,0,0, 0,0,3,0, 0,0,0,4]);});
+ assertGLError(gl, gl.INVALID_VALUE, "17 values to 4fv",
+ function(){gl.uniformMatrix4fv(fm4, false, [0,1,0,0,0, 0,2,0,0, 0,0,3,0, 0,0,0,4]);});
+ assertGLError(gl, gl.INVALID_VALUE, "5 values to 2fv",
+ function(){gl.uniformMatrix2fv(fm2, false, [0,2,1, 2,2]);});
+ assertGLError(gl, gl.INVALID_VALUE, "10 values to 3fv",
+ function(){gl.uniformMatrix3fv(fm3, false, [0,2,2,2, 2,2,2, 2,1,2]);});
+ assertGLError(gl, gl.INVALID_VALUE, "too few values to 4fv",
+ function(){gl.uniformMatrix4fv(fm4, false, [0,0,0, 0,2,0,0, 0,0,3,0, 0,0,0,4]);});
+ assertGLError(gl, gl.INVALID_VALUE, "too few values to 2fv",
+ function(){gl.uniformMatrix2fv(fm2, false, [1, 2,2]);});
+ assertGLError(gl, gl.INVALID_VALUE, "too few values to 2fv",
+ function(){gl.uniformMatrix2fv(fm2, false, []);});
+ assertThrowNoGLError(gl, "string for data",
+ function(){gl.uniformMatrix2fv(fm2, false, "fm4");});
+ assertGLError(gl, gl.INVALID_VALUE, "too few values to 3fv",
+ function(){gl.uniformMatrix3fv(fm3, false, [2,2, 2,2,2, 2,1,2]);});
+ gl.uniformMatrix4fv(fm4, false, [1,0,0,0, 0,2,0,0, 0,0,3,0, 0,0,0,4]);
+ gl.uniformMatrix2fv(fm2, false, [2,1, 2,2]);
+ gl.uniformMatrix3fv(fm3, false, [2,2,2, 2,2,2, 2,1,2]);
+ assertGLError(gl, gl.INVALID_OPERATION, "3fv on mat4",
+ function(){gl.uniformMatrix3fv(fm4, false, [1,0,0, 0,2,0, 0,0,3]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "3fv on mat2",
+ function(){gl.uniformMatrix3fv(fm2, false, [0,2,1, 0,2,2, 0,0,0]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "2fv om mat3",
+ function(){gl.uniformMatrix2fv(fm3, false, [2,2, 2,2]);});
+ for (var ii = 2; ii <= 4; ++ii) {
+ var all = [];
+ var mats = [[],[]];
+ for (var jj = 0; jj < 2; ++jj) {
+ for (var kk = 0; kk < ii * ii; ++kk) {
+ mats[jj].push(jj + 1);
+ all.push(jj + 1);
+ }
+ }
+ var loc0Name = 'am' + ii + '[0]';
+ var loc1Name = 'am' + ii + '[1]';
+ var loc0 = f.uniform(loc0Name);
+ var loc1 = f.uniform(loc1Name);
+ var fname = "uniformMatrix" + ii + "fv";
+ assert(loc0Name, loc0 != null);
+ assert(loc1Name, loc1 != null);
+ assertOk("set array of 2 matrices " + ii + "fv",
+ function(){gl[fname].call(gl,loc0, false, all);});
+ var actual = unwrappedGL.getUniform(sh.shader.program, loc0);
+ assert("got value for loc0",
+ gl.NO_ERROR == checkError(gl, "getUniform loc0"));
+ assertArrayEquals(mats[0], actual);
+ var actual = unwrappedGL.getUniform(sh.shader.program, loc1);
+ assert("got value for loc1",
+ gl.NO_ERROR == checkError(gl, "getUniform loc1"));
+ assertArrayEquals(mats[1], actual);
+ assertOk("set array of second array of 2 matrixes",
+ function(){gl[fname].call(gl, loc1, false, mats[0]);});
+ var actual = unwrappedGL.getUniform(sh.shader.program, loc1);
+ assert("got value for loc1",
+ gl.NO_ERROR == checkError(gl, "getUniform loc1"));
+ assertArrayEquals(mats[0], actual);
+ var big = mats[1].concat([3]);
+ assertGLError(gl, gl.INVALID_VALUE, "set array of first array of 2 matrixes plus 1 value",
+ function(){gl[fname].call(gl, loc0, false, big);});
+ }
+ });
+ var d = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertArrayEqualsWithEpsilon([1,2,3,8], d, [1,1,1,1]);
+ sh.destroy();
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="foobar-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+uniform mat2 fm2;
+uniform mat3 fm3;
+uniform mat2 am2[2];
+uniform mat3 am3[2];
+uniform mat4 am4[2];
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, fm2[0][1]+fm3[2][1], 0.0);
+ float d = am2[0][1][1] + am3[0][2][2] + am4[0][3][3] +
+ am2[1][1][1] + am3[1][2][2] + am4[1][3][3];
+ gl_Position = vec4(Vertex, 1.0 + d * 0.0001);
+}
+</script>
+<script id="foobar-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform mat4 fm4;
+
+varying vec4 texCoord0;
+void main()
+{
+ gl_FragColor = vec4(fm4[0][0]/256.0, fm4[1][1]/256.0, fm4[2][2]/256.0, fm4[3][3]*texCoord0.z/256.0);
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html
new file mode 100644
index 0000000000..3c968c7a0c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformf.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testUniformf = function(gl) {
+ var sh = new Filter(gl, 'foobar-vert', 'foobar-frag');
+ sh.apply(function(f){
+ var foo = f.uniform('foo');
+ var bar = f.uniform('bar');
+ gl.uniform4fv(foo, [1,2,3,4]);
+ gl.uniform1fv(bar, [2]);
+ });
+ var d = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertEquals([1,2,3,8], [d[0], d[1], d[2], d[3]]);
+ sh.apply(function(f){
+ var foo = f.uniform('foo');
+ var bar = f.uniform('bar');
+ gl.uniform4f(foo, 2,2,3,4);
+ gl.uniform1f(bar, 3);
+ });
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertEquals([2,2,3,12], [d[0], d[1], d[2], d[3]]);
+ sh.destroy();
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="foobar-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+uniform float bar;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, bar, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="foobar-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform vec4 foo;
+
+varying vec4 texCoord0;
+void main()
+{
+ gl_FragColor = vec4(foo.r/255.0, foo.g/255.0, foo.b/255.0, foo.a*texCoord0.z/255.0);
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html
new file mode 100644
index 0000000000..3b210f1f1e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfArrayLen1.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testUniformArray = function(gl) {
+ var sh = new Filter(gl, 'foobar-vert', 'foobar-frag');
+ sh.apply(function(f){
+ var uniV4 = f.uniform('uniV4');
+ var uniFloat = f.uniform('uniFloat');
+ assertOk("1fv on 1fv",
+ function(){gl.uniform1fv(uniFloat, [2]);});
+ assertOk("5 values on 1fv",
+ function(){gl.uniform1fv(uniFloat, [2,3,4,5,6]);});
+ assertOk("4fv on 4fv",
+ function(){gl.uniform4fv(uniV4, [1, 2, 3, 4]);});
+ assertOk("8 values on 4fv",
+ function(){gl.uniform4fv(uniV4, [1, 2, 3, 4, 5, 6, 7, 8]);});
+
+ var uniformsFound = 0;
+ var numUniforms = gl.getProgramParameter(f.shader.program, gl.ACTIVE_UNIFORMS);
+ for (var i = 0; i < numUniforms; ++i) {
+ var uniformName = gl.getActiveUniform(f.shader.program, i).name;
+ if (uniformName.indexOf('uniV4') == 0 || uniformName.indexOf('uniFloat') == 0) {
+ assert("Uniform array of length 1 ends with [0]", uniformName.indexOf("[0]") != -1);
+ ++uniformsFound;
+ }
+ }
+ assert("Both uniforms found", uniformsFound == 2);
+
+ uniV4 = f.uniform('uniV4[0]');
+ uniFloat = f.uniform('uniFloat[0]');
+ assertOk("1fv on 1fv",
+ function(){gl.uniform1fv(uniFloat, [2]);});
+ assertOk("5 values on 1fv",
+ function(){gl.uniform1fv(uniFloat, [2,3,4,5,6]);});
+ assertOk("4fv on 4fv",
+ function(){gl.uniform4fv(uniV4, [1, 2, 3, 4]);});
+ assertOk("8 values on 4fv",
+ function(){gl.uniform4fv(uniV4, [1, 2, 3, 4, 5, 6, 7, 8]);});
+
+ });
+ var d = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertArrayEquals([1,2,3,8], d);
+ sh.destroy();
+ throwError(gl);
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="foobar-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+uniform float uniFloat[1];
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, uniFloat[0], 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="foobar-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform vec4 uniV4[1];
+
+varying vec4 texCoord0;
+void main()
+{
+ gl_FragColor = vec4(
+ uniV4[0].r/255.0,
+ uniV4[0].g/255.0,
+ uniV4[0].b/255.0,
+ uniV4[0].a*texCoord0.z/255.0);
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html
new file mode 100644
index 0000000000..32b2c4babc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformfBadArgs.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testUniformf = function(gl) {
+ var sh = new Filter(gl, 'foobar-vert', 'foobar-frag');
+ sh.apply(function(f){
+ var uniV4 = f.uniform('uniV4');
+ var uniFloat = f.uniform('uniFloat');
+ assertThrowNoGLError(gl, "number for location",
+ function(){gl.uniform4fv(58882929, [1,2,3,4]);});
+ assertThrowNoGLError(gl, "negative number for location",
+ function(){gl.uniform4fv(-58882929, [1,2,3,4]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "1fv on 4fv",
+ function(){gl.uniform1fv(uniV4, [1,2,3,4]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "more than enough values 1fv",
+ function(){gl.uniform1fv(uniFloat, [2,3,4,5,6]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "4fv on float",
+ function(){gl.uniform4fv(uniFloat, [2,3,4,5]);});
+ assertOk("4fv on 4fv",
+ function(){gl.uniform4fv(uniV4, [1, 2, 3, 4]);});
+ assertGLError(gl, gl.INVALID_VALUE, "5 values on 4fv",
+ function(){gl.uniform4fv(uniV4, [1, 2, 3, 4, 5]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "8 values on 4fv",
+ function(){gl.uniform4fv(uniV4, [1, 2, 3, 4, 5, 6, 7, 8]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "3fv on float",
+ function(){gl.uniform3fv(uniFloat, [2,3,4]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "2fv on float",
+ function(){gl.uniform2fv(uniFloat, [2,3]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "3fv on 4fv",
+ function(){gl.uniform3fv(uniV4, [4,5,6]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "2fv on 4fv",
+ function(){gl.uniform2fv(uniV4, [5,6]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "1fv on 4fv",
+ function(){gl.uniform1fv(uniV4, [6]);});
+ assertOk("1fv on 1fv",
+ function(){gl.uniform1fv(uniFloat, [2]);});
+ assertGLError(gl, gl.INVALID_VALUE, "not enough values on 1fv",
+ function(){gl.uniform1fv(uniFloat, []);});
+ assertGLError(gl, gl.INVALID_VALUE, "not enough values on 4fv",
+ function(){gl.uniform4fv(uniV4, [3,3,4]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "4iv on 4fv",
+ function(){gl.uniform4iv(uniV4, [1, 2, 3, 4]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "1iv on 1fv",
+ function(){gl.uniform1iv(uniFloat, [2]);});
+ });
+ var d = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertArrayEquals([1,2,3,8], d);
+ sh.destroy();
+ throwError(gl);
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="foobar-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+uniform float uniFloat;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, uniFloat, 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="foobar-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform vec4 uniV4;
+
+varying vec4 texCoord0;
+void main()
+{
+ gl_FragColor = vec4(
+ uniV4.r/255.0,
+ uniV4.g/255.0,
+ uniV4.b/255.0,
+ uniV4.a*texCoord0.z/255.0);
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html
new file mode 100644
index 0000000000..252626a735
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformi.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testUniformi = function(gl) {
+ var sh = new Filter(gl, 'foobar-vert', 'foobar-frag');
+ sh.apply(function(f){
+ var foo = f.uniform('foo');
+ var bar = f.uniform('bar');
+ gl.uniform4iv(foo, [1,2,3,4]);
+ gl.uniform1iv(bar, [2]);
+ });
+ var d = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertEquals([1,2,3,8], [d[0], d[1], d[2], d[3]]);
+ sh.apply(function(f){
+ var foo = f.uniform('foo');
+ var bar = f.uniform('bar');
+ gl.uniform4i(foo, 2,2,3,4);
+ gl.uniform1i(bar, 3);
+ });
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertEquals([2,2,3,12], [d[0], d[1], d[2], d[3]]);
+ sh.destroy();
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="foobar-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+uniform int bar;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, float(bar), 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="foobar-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform ivec4 foo;
+
+varying vec4 texCoord0;
+void main()
+{
+ gl_FragColor = vec4(float(foo.r)/256.0, float(foo.g)/256.0, float(foo.b)/256.0, float(foo.a)*texCoord0.z/256.0);
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html
new file mode 100644
index 0000000000..4741ffebac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/uniformiBadArgs.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.testUniformf = function(gl) {
+ var sh = new Filter(gl, 'foobar-vert', 'foobar-frag');
+ sh.apply(function(f){
+ var uniIV4 = f.uniform('uniIV4');
+ var uniInt = f.uniform('uniInt');
+ assertThrowNoGLError(gl, "number as location",
+ function(){gl.uniform4iv(58882929, [1,2,3,4]);});
+ assertThrowNoGLError(gl, "negative number as location",
+ function(){gl.uniform4iv(-58882929, [1,2,3,4]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "more than 1 value to 1iv",
+ function(){gl.uniform1iv(uniInt, [2,3,4,5,6]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "4iv on int",
+ function(){gl.uniform4iv(uniInt, [2,3,4,5]);});
+ assertOk("4iv on 4iv",
+ function(){gl.uniform4iv(uniIV4, [1, 2, 3, 4]);});
+ assertGLError(gl, gl.INVALID_VALUE, "5 values on 4iv",
+ function(){gl.uniform4iv(uniIV4, [1, 2, 3, 4, 5]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "8 values on 4iv",
+ function(){gl.uniform4iv(uniIV4, [1, 2, 3, 4, 5, 6, 7, 8]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "3iv on int",
+ function(){gl.uniform3iv(uniInt, [2,3,4]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "2iv on int",
+ function(){gl.uniform2iv(uniInt, [2,3]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "3iv on 4iv",
+ function(){gl.uniform3iv(uniIV4, [4,5,6]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "2iv on 4iv",
+ function(){gl.uniform2iv(uniIV4, [5,6]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "1iv on 4iv",
+ function(){gl.uniform1iv(uniIV4, [6]);});
+ assertGLError(gl, gl.INVALID_VALUE, "not enough values",
+ function(){gl.uniform1iv(uniInt, []);});
+ assertGLError(gl, gl.INVALID_OPERATION, "1fv on int",
+ function(){gl.uniform1fv(uniInt, [2]);});
+ assertGLError(gl, gl.INVALID_OPERATION, "4fv on ivec4",
+ function(){gl.uniform4fv(uniIV4, [2,3,4,5]);});
+ gl.uniform1iv(uniInt, [2]);
+ gl.uniform4iv(uniIV4, [1, 2, 3, 4]);
+ });
+ var d = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, d);
+ assertArrayEquals([1,2,3,8], d);
+ sh.destroy();
+ throwError(gl);
+}
+
+Tests.endUnit = function(gl) {
+}
+
+</script>
+<script id="foobar-vert" type="x-shader/x-vertex">
+attribute vec3 Vertex;
+attribute vec2 Tex;
+
+uniform int uniInt;
+
+varying vec4 texCoord0;
+void main()
+{
+ texCoord0 = vec4(Tex.s, 1.0-Tex.t, float(uniInt), 0.0);
+ gl_Position = vec4(Vertex, 1.0);
+}
+</script>
+<script id="foobar-frag" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform ivec4 uniIV4;
+
+varying vec4 texCoord0;
+void main()
+{
+ gl_FragColor = vec4(
+ float(uniIV4.x)/256.0,
+ float(uniIV4.y)/256.0,
+ float(uniIV4.z)/256.0,
+ float(uniIV4.a)*texCoord0.z/256.0);
+}
+</script>
+<style>canvas{ position:absolute; }</style>
+</head><body>
+<canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html
new file mode 100644
index 0000000000..866c95da1c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttrib.html
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0];
+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0];
+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0];
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var prog = new Shader(gl, 'vert', 'frag');
+ prog.use();
+ var sh = prog.shader.program;
+// log(gl.getShaderInfoLog(prog.shaders[1]));
+ var v = gl.getAttribLocation(sh, 'Vertex');
+ var n = gl.getAttribLocation(sh, 'Normal');
+ var t = gl.getAttribLocation(sh, 'Tex');
+ return [gl,prog,v,n,t];
+}
+
+Tests.setup = function(gl, prog, v,n,t) {
+ assert(0 == gl.getError());
+ return [gl, prog, v,n,t];
+}
+Tests.teardown = function(gl, prog, v,n,t) {
+ gl.disableVertexAttribArray(v);
+ gl.disableVertexAttribArray(n);
+ gl.disableVertexAttribArray(t);
+}
+
+Tests.endUnit = function(gl, prog, v,n,t) {
+ prog.destroy();
+}
+
+Tests.testVertexAttrib = function(gl, prog, v,n,t) {
+ var vbo = gl.createBuffer();
+ var vertsArr = new Float32Array(verts);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, vertsArr, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(v);
+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0);
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 3);});
+ gl.vertexAttrib1fv(v, [1]);
+ gl.vertexAttrib2fv(v, [1,2]);
+ gl.vertexAttrib3fv(v, [1,2,3]);
+ gl.vertexAttrib4fv(v, [1,2,3,4]);
+ gl.vertexAttrib1f(v, 1);
+ gl.vertexAttrib2f(v, 1,2);
+ gl.vertexAttrib3f(v, 1,2,3);
+ gl.vertexAttrib4f(v, 1,2,3,4);
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 3);});
+ throwError(gl);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(vbo);
+ throwError(gl);
+}
+Tests.testVertexAttribVBO = function(gl, prog, v,n,t) {
+ var vbo = gl.createBuffer();
+ var vertsArr = new Float32Array(verts);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, vertsArr, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(v);
+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0);
+ gl.vertexAttrib1fv(v, [1]);
+ gl.vertexAttrib2fv(v, [1,2]);
+ gl.vertexAttrib3fv(v, [1,2,3]);
+ gl.vertexAttrib4fv(v, [1,2,3,4]);
+ gl.vertexAttrib1f(v, 1);
+ gl.vertexAttrib2f(v, 1,2);
+ gl.vertexAttrib3f(v, 1,2,3);
+ gl.vertexAttrib4f(v, 1,2,3,4);
+ assertOk(function(){gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0);});
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 3);});
+ gl.vertexAttrib4fv(v, [1,2,3,4]);
+ assertOk(function(){gl.drawArrays(gl.TRIANGLES, 0, 3);});
+ throwError(gl);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(vbo);
+ throwError(gl);
+}
+
+</script>
+<script id="vert" type="x-shader/x-vertex">
+ attribute vec3 Vertex;
+ attribute vec3 Normal;
+ attribute vec2 Tex;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ gl_Position = vec4(Vertex * Normal, 1.0);
+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+ precision mediump float;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ vec4 c = texCoord0;
+ gl_FragColor = c;
+ }
+</script>
+
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html
new file mode 100644
index 0000000000..67e44a5b87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribBadArgs.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0];
+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0];
+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0];
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var prog = new Shader(gl, 'vert', 'frag');
+ prog.use();
+ var sh = prog.shader.program;
+// log(gl.getShaderInfoLog(prog.shaders[1]));
+ var v = gl.getAttribLocation(sh, 'Vertex');
+ var n = gl.getAttribLocation(sh, 'Normal');
+ var t = gl.getAttribLocation(sh, 'Tex');
+ return [gl,prog,v,n,t];
+}
+
+Tests.setup = function(gl, prog, v,n,t) {
+ assert(0 == gl.getError());
+ return [gl, prog, v,n,t];
+}
+Tests.teardown = function(gl, prog, v,n,t) {
+ gl.disableVertexAttribArray(v);
+ gl.disableVertexAttribArray(n);
+ gl.disableVertexAttribArray(t);
+}
+
+Tests.endUnit = function(gl, prog, v,n,t) {
+ prog.destroy();
+}
+
+
+Tests.testVertexAttrib = function(gl, prog, v,n,t) {
+ var vbo = gl.createBuffer();
+ var vertsArr = new Float32Array(verts);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, vertsArr, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(v);
+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0);
+ assertFail("bad index",
+ function(){gl.vertexAttrib1f(-1, 1);});
+ assertFail("bad index (big negative)",
+ function(){gl.vertexAttrib1f(-69092342, 1);});
+ assertFail("bad index (big positive)",
+ function(){gl.vertexAttrib1f(58928938, 1);});
+ assertOk("array too large",
+ function(){gl.vertexAttrib1fv(v, [1,2,3,4,5]);});
+ assertFail("array too small",
+ function(){gl.vertexAttrib1fv(v, []);});
+ assertOk("draw",
+ function(){gl.drawArrays(gl.TRIANGLES, 0, 3);});
+ throwError(gl);
+}
+
+</script>
+<script id="vert" type="x-shader/x-vertex">
+ attribute vec3 Vertex;
+ attribute vec3 Normal;
+ attribute vec2 Tex;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ gl_Position = vec4(Vertex * Normal, 1.0);
+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+ precision mediump float;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ vec4 c = texCoord0;
+ gl_FragColor = c;
+ }
+</script>
+
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html
new file mode 100644
index 0000000000..838f7d61e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointer.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+var verts = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 0.0];
+var normals = [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0];
+var texcoords = [0.0,0.0, 1.0,0.0, 0.0,1.0];
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = wrapGLContext(getGLContext(canvas));
+ var prog = new Shader(gl, 'vert', 'frag');
+ prog.use();
+ var sh = prog.shader.program;
+// log(gl.getShaderInfoLog(prog.shaders[1]));
+ var v = gl.getAttribLocation(sh, 'Vertex');
+ var n = gl.getAttribLocation(sh, 'Normal');
+ var t = gl.getAttribLocation(sh, 'Tex');
+ return [gl,prog,v,n,t];
+}
+
+Tests.setup = function(gl, prog, v,n,t) {
+ assert(0 == gl.getError());
+ return [gl, prog, v,n,t];
+}
+Tests.teardown = function(gl, prog, v,n,t) {
+ gl.disableVertexAttribArray(v);
+ gl.disableVertexAttribArray(n);
+ gl.disableVertexAttribArray(t);
+}
+
+Tests.endUnit = function(gl, prog, v,n,t) {
+ prog.destroy();
+}
+
+Tests.testVertexAttribPointerVBO = function(gl, prog, v,n,t) {
+ var vbo = gl.createBuffer();
+ var vertsArr = new Float32Array(verts);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, vertsArr, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 0);
+ gl.vertexAttribPointer(v, 3, gl.FLOAT, false, 0, 4);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(vbo);
+}
+
+</script>
+<script id="vert" type="x-shader/x-vertex">
+ attribute vec3 Vertex;
+ attribute vec3 Normal;
+ attribute vec2 Tex;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ gl_Position = vec4(Vertex * Normal, 1.0);
+ texCoord0 = vec4(Tex,0.0,0.0) + gl_Position;
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+ precision mediump float;
+
+ varying vec4 texCoord0;
+ void main()
+ {
+ vec4 c = texCoord0;
+ gl_FragColor = c;
+ }
+</script>
+
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html
new file mode 100644
index 0000000000..124d0258e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/functions/vertexAttribPointerBadArgs.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.createElement('canvas');
+ var gl = wrapGLContext(getGLContext(canvas));
+ return [gl];
+}
+
+Tests.setup = function(gl) {
+ assert(0 == gl.getError());
+ return [gl];
+}
+
+Tests.teardown = function(gl) {
+}
+
+Tests.endUnit = function(gl) {
+}
+
+Tests.testVertexAttribPointerVBO = function(gl) {
+ var vbo = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(4), gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ assertFail("negative offset",
+ function(){gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, -4);});
+ assertOk("out of range offset (OK because we can change the buffer later)",
+ function(){gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 1200);});
+ assertFail("Offset that is incompatible with type",
+ function(){gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 3);});
+ assertFail("negative stride",
+ function(){gl.vertexAttribPointer(0, 3, gl.FLOAT, false, -1, 0);});
+ assertFail("bad size",
+ function(){gl.vertexAttribPointer(0, 5, gl.FLOAT, false, 0, 0);});
+ assertFail("stride that doesn't match type",
+ function(){gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 1, 0);});
+ assertFail("bad type",
+ function(){gl.vertexAttribPointer(0, 3, gl.TEXTURE_2D, false, 0, 0);});
+ assertFail("bad index",
+ function(){gl.vertexAttribPointer(-1, 3, gl.FLOAT, false, 0, 0);});
+ assertFail("bad index (big negative)",
+ function(){gl.vertexAttribPointer(-8693948, 3, gl.FLOAT, false, 0, 0);});
+ assertFail("bad index (big positive)",
+ function(){gl.vertexAttribPointer(8693948, 3, gl.FLOAT, false, 0, 0);});
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ assertOk("binding to null buffer with offset=0",
+ function(){gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);});
+ assertFail("binding to null buffer with offset!=0",
+ function(){gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 16);});
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(vbo);
+ throwError(gl);
+}
+
+</script>
+</head><body>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html
new file mode 100644
index 0000000000..195b224a9e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/arrayOutOfBounds.html
@@ -0,0 +1,258 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = getGLContext(canvas);
+ return [gl];
+}
+
+Tests.testOk = function(gl) {
+ var sh = new Filter(gl, 'okvert', 'frag');
+ assertOk(function(){sh.apply();});
+ sh.destroy();
+
+ var sh = new Filter(gl, 'vert', 'okfrag');
+ assertOk(function(){sh.apply();});
+ sh.destroy();
+
+ var sh = new Filter(gl, 'vert', 'frag');
+ assertOk(function(){sh.apply();});
+ sh.destroy();
+}
+
+var arr = ['cr', 'cw', 'vr', 'vw'];
+arr.forEach(function(e){
+ if (e == 'cr' || e == 'cw') {
+ Tests['test'+e+'vert'] = function(gl) {
+ var sh = new Filter(gl, e+'vert', 'frag');
+ assertFail(function(){sh.apply();});
+ sh.destroy();
+ }
+ }
+ Tests['test'+e+'frag'] = function(gl) {
+ var sh = new Filter(gl, 'vert', e+'frag');
+ assertFail(function(){sh.apply();});
+ sh.destroy();
+ }
+});
+
+
+</script>
+<script id="okvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex;
+ attribute vec2 Tex;
+ varying vec2 TexCoord;
+ void main()
+ {
+ TexCoord = Tex;
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+ gl_Position = vec4(Vertex, x[2]);
+ }
+</script>
+<script id="crvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex;
+ attribute vec2 Tex;
+ varying vec2 TexCoord;
+ void main()
+ {
+ TexCoord = Tex;
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+ gl_Position = vec4(Vertex, x[4]);
+ }
+</script>
+<script id="cwvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex;
+ attribute vec2 Tex;
+ varying vec2 TexCoord;
+ void main()
+ {
+ TexCoord = Tex;
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+ x[4] = Vertex.z;
+ gl_Position = vec4(Vertex, x[4]);
+ }
+</script>
+<!-- This one can't be required to fail compilation, because vertex shaders must support arbitrary array indexing -->
+<script id="vrvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex;
+ attribute vec2 Tex;
+ varying vec2 TexCoord;
+ void main()
+ {
+ TexCoord = Tex;
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+ int idx = 4 * int(max(1.0, Vertex.x*20.0));
+ gl_Position = vec4(Vertex, x[idx]);
+ }
+</script>
+<!-- This one can't be required to fail compilation, because vertex shaders must support arbitrary array indexing -->
+<script id="vwvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex;
+ attribute vec2 Tex;
+ varying vec2 TexCoord;
+ void main()
+ {
+ TexCoord = Tex;
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+ int idx = 4 * int(max(1.0, Vertex.x*20.0));
+ x[idx] = Vertex.z;
+ gl_Position = vec4(Vertex, x[idx]);
+ }
+</script>
+<script id="vert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex;
+ attribute vec2 Tex;
+ varying vec2 TexCoord;
+ void main()
+ {
+ TexCoord = Tex;
+ gl_Position = vec4(Vertex, 0.0);
+ }
+</script>
+
+<script id="okfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ varying vec2 TexCoord;
+
+ void main()
+ {
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+ gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[2]);
+ }
+</script>
+<script id="crfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ varying vec2 TexCoord;
+
+ void main()
+ {
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+ gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[4]);
+ }
+</script>
+<script id="cwfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ varying vec2 TexCoord;
+
+ void main()
+ {
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+
+ x[4] = 6.0;
+ gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[4]);
+ }
+</script>
+<!-- This one actually fails because of WebGL's restrictions on indexing expressions in fragment shaders -->
+<script id="vrfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ varying vec2 TexCoord;
+
+ void main()
+ {
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+
+ int idx = 4 * int(max(1.0, TexCoord.x*20.0));
+ gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[idx]);
+ }
+</script>
+<!-- This one actually fails because of WebGL's restrictions on indexing expressions in fragment shaders -->
+<script id="vwfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ varying vec2 TexCoord;
+
+ void main()
+ {
+ float x[3];
+ x[0] = 1.0;
+ x[1] = 2.0;
+ x[2] = 3.0;
+
+ int idx = 4 * int(max(1.0, TexCoord.x*20.0));
+ x[idx] = 6.0;
+ gl_FragColor = vec4(1.0, 0.0, TexCoord.s, x[idx]);
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ varying vec2 TexCoord;
+
+ void main()
+ {
+ gl_FragColor = vec4(1.0, 0.0, TexCoord.s, 1.0);
+ }
+</script>
+
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="16" height="16"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html
new file mode 100644
index 0000000000..c53347e604
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/glsl/uniformOutOfBounds.html
@@ -0,0 +1,196 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+<link rel="stylesheet" type="text/css" href="../unit.css" />
+<script type="application/javascript" src="../unit.js"></script>
+<script type="application/javascript" src="../util.js"></script>
+<script type="application/javascript">
+
+Tests.startUnit = function () {
+ var canvas = document.getElementById('gl');
+ var gl = getGLContext(canvas);
+ return [gl];
+}
+
+var arr = ['cr', 'cw', 'vr', 'vw', 'tvw'];
+arr.forEach(function(e){
+ Tests['test'+e+'vert'] = function(gl) {
+ var sh = new Filter(gl, e+'vert', 'frag');
+ assertFail(function(){sh.apply(function(f){
+ f.uniform3fv('x', [0.0, 1.0, 2.0]);
+ throwError(e+"vert");
+ });});
+ sh.destroy();
+ }
+ Tests['test'+e+'frag'] = function(gl) {
+ var sh = new Filter(gl, 'vert', e+'frag');
+ assertFail(function(){sh.apply(function(f){
+ f.uniform3fv('x', [0.0, 1.0, 2.0]);
+ throwError(e+"frag");
+ });});
+ sh.destroy();
+ }
+});
+
+</script>
+<script id="crvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex; attribute vec2 Tex;
+ uniform float x[3];
+ void main()
+ {
+ gl_Position = vec4(Vertex.st, Tex.s, x[4]);
+ }
+</script>
+<script id="cwvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex; attribute vec2 Tex;
+ uniform float x[3];
+ void main()
+ {
+ x[4] = Vertex.z;
+ gl_Position = vec4(Vertex.st, Tex.s, x[4]);
+ }
+</script>
+<script id="vrvert" type="x-shader/x-vertex">
+
+
+ uniform float x[3];
+ attribute vec3 Vertex; attribute vec2 Tex;
+ void main()
+ {
+ float idx = 40.0 * max(1.0, Vertex.x*20.0);
+ gl_Position = vec4(Vertex, x[2] + Tex.s + x[int(idx)]);
+ }
+</script>
+<script id="vwvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex; attribute vec2 Tex;
+ uniform float x[3];
+ void main()
+ {
+ int idx = 4 * int(max(1.0, Vertex.x*20.0));
+ x[idx] = Vertex.z;
+ gl_Position = vec4(Vertex.st, Tex.s, x[idx]);
+ }
+</script>
+<script id="tvwvert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex; attribute vec2 Tex;
+ uniform float x[3];
+ void main()
+ {
+ int idx = 4 * int(max(1.0, Vertex.x*20.0));
+ x[2] = Vertex[idx];
+ gl_Position = vec4(Vertex.st, Tex.s, x[2]);
+ }
+</script>
+<script id="vert" type="x-shader/x-vertex">
+
+
+ attribute vec3 Vertex; attribute vec2 Tex;
+ varying vec2 TexCoord;
+ void main()
+ {
+ TexCoord = Vertex.st;
+ gl_Position = vec4(Vertex, Tex.s);
+ }
+</script>
+
+<script id="crfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ uniform float x[3];
+
+ varying vec2 TexCoord;
+ void main()
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, x[4]);
+ }
+</script>
+<script id="cwfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ uniform float x[3];
+
+ varying vec2 TexCoord;
+ void main()
+ {
+ x[4] = 6.0;
+ gl_FragColor = vec4(1.0, 0.0, 0.0, x[4]);
+ }
+</script>
+<script id="vrfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ uniform float x[3];
+
+ varying vec2 TexCoord;
+ void main()
+ {
+ int idx = 4 * int(max(1.0, TexCoord.s*20.0));
+ gl_FragColor = vec4(1.0, 0.0, 0.0, x[idx]);
+ }
+</script>
+<script id="vwfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ uniform float x[3];
+
+ varying vec2 TexCoord;
+ void main()
+ {
+ int idx = 4 * int(max(1.0, TexCoord.s*20.0));
+ x[idx] = 6.0;
+ gl_FragColor = vec4(1.0, 0.0, 0.0, x[idx]);
+ }
+</script>
+<script id="tvwfrag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ uniform float x[3];
+
+ varying vec2 TexCoord;
+ void main()
+ {
+ int idx = 4 * int(max(1.0, TexCoord.s*20.0));
+ x[2] = TexCoord[idx];
+ gl_FragColor = vec4(1.0, 0.0, 0.0, x[2]);
+ }
+</script>
+<script id="frag" type="x-shader/x-fragment">
+
+
+ precision mediump float;
+
+ void main()
+ {
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+ }
+</script>
+
+
+<style>canvas{ position:absolute; }</style>
+</head><body>
+ <canvas id="gl" width="1" height="1"></canvas>
+</body></html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/index.html b/dom/canvas/test/webgl-conf/checkout/conformance/more/index.html
new file mode 100644
index 0000000000..2be2bd3a8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/index.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html>
+ <head>
+<meta charset="utf-8">
+<!--
+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.
+-->
+ <title>WebGL tests</title>
+ </head>
+ <body>
+
+ <h1>Tests for the WebGL canvas context</h1>
+
+ <h2>These tests are intended to serve the following purposes:</h2>
+ <ul>
+ <li>Assert spec conformance (so that WebGL pages work the same across browsers and hardware)</li>
+ <li>Check the safety of the GL binding (bounds checking, same origin policy)</li>
+ <li>Provide performance numbers for developers</li>
+ </ul>
+
+ <h2>Test runners</h2>
+ <ul>
+ <li><a href="all_tests_linkonly.html">Run tests manually</a></li>
+ <li><a href="all_tests.html">Run all tests in parallel</a></li>
+ <li><a href="all_tests_sequential.html">Run all tests sequentially</a></li>
+ </ul>
+
+
+ <h2>Demos</h2>
+ <ul>
+ <li><a href="demos/opengl_web.html">OpenGL for the web</a> (requires working FBOs and null textures or using canvases as textures)</li>
+ <li><a href="demos/video.html">Green screen video demo with a color remapping filter</a> (requires loading &lt;video> to texture with texImage2D)</li>
+ </ul>
+
+ <h2>Running the tests</h2>
+
+ <ol>
+ <li><a href="http://learningwebgl.com/blog/?p=11">Install a browser with WebGL support</a></li>
+ <li>Open one of the test runners linked above in your browser.</li>
+ <li>For more control over the tests, go the <a href="http://github.com/kig/canvas3d-tests">GitHub page</a>, see the readme, and clone the repo.</li>
+ </ol>
+
+ <h2>Want to contribute?</h2>
+
+ <p>See the <a href="README.md">README</a>.</p>
+ <p>See the <a href="http://github.com/kig/canvas3d-tests">GitHub page</a>.</p>
+ <p>Mail me at <a href="mailto:ilmari.heikkinen@gmail.com">ilmari.heikkinen@gmail.com</a></p>
+
+
+ <h2>For more information on WebGL</h2>
+
+ <ul>
+ <li><a href="http://planet-webgl.org">Planet WebGL</a></li>
+ <li><a href="http://learningwebgl.com">Learning WebGL</a></li>
+ <li><a href="http://www.khronos.org/message_boards/viewforum.php?f=34">WebGL on Khronos Message Boards</a></li>
+ </ul>
+
+ <h2>Developer links</h2>
+ <ul>
+ <li><a href="https://bugzilla.mozilla.org/buglist.cgi?quicksearch=webgl">WebGL on Mozilla Bugzilla</a></li>
+ <li><a href="https://bugzilla.webkit.org/buglist.cgi?quicksearch=webgl">WebGL on WebKit Bugzilla</a></li>
+ <li><a href="http://code.google.com/p/chromium/issues/list?q=label:3D-WebGL">WebGL on Chromium Bugzilla</a></li>
+ </ul>
+
+
+ <h2>License</h2>
+
+ <p>
+ These tests are released under the BSD license. The images and videos used in the tests are the respective property of their authors.
+ </p>
+
+ </body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css
new file mode 100644
index 0000000000..0758b43bd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.css
@@ -0,0 +1,66 @@
+/*
+Tests for the OpenGL ES 2.0 HTML Canvas context
+
+Copyright (C) 2009 Ilmari Heikkinen <ilmari.heikkinen@gmail.com>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+.ok {
+ color: green;
+}
+.fail {
+ color: red;
+}
+canvas {
+ display: none;
+}
+#test-status {
+ font-size: large;
+}
+
+#test-log {
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+ background: white;
+ color: black;
+}
+#test-log > div {
+ padding-bottom: 0.5em;
+}
+#test-log h2 {
+ font-size: 1em;
+ margin-bottom: 0em;
+ padding-top: 0.5em;
+}
+#test-log h3 {
+ font-size: small;
+ margin-left: 1.5em;
+ margin-bottom: 0em;
+ margin-top: 0.5em;
+}
+#test-log p {
+ margin-left: 4em;
+ font-size: small;
+ margin-top: 0em;
+ margin-bottom: 0.2em;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js
new file mode 100644
index 0000000000..3ca21c4cae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/unit.js
@@ -0,0 +1,970 @@
+/*
+Unit testing library for the OpenGL ES 2.0 HTML Canvas context
+*/
+
+/*
+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.
+*/
+
+/* -- plaform specific code -- */
+
+// WebKit
+if (window.testRunner && !window.layoutTestController) {
+ window.layoutTestController = window.testRunner;
+}
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+
+ // The WebKit testing system compares console output.
+ // Because the output of the WebGL Tests is GPU dependent
+ // we turn off console messages.
+ window.console.log = function() { };
+ window.console.error = function() { };
+
+ // RAF doesn't work in LayoutTests. Disable it so the tests will
+ // use setTimeout instead.
+ window.requestAnimationFrame = undefined;
+ window.webkitRequestAnimationFrame = undefined;
+}
+
+if (window.internals) {
+ window.internals.settings.setWebGLErrorsToConsoleEnabled(false);
+}
+
+/* -- end platform specific code --*/
+Tests = {
+ autorun : true,
+ message : null,
+ delay : 0,
+ autoinit: true,
+
+ startUnit : function(){ return []; },
+ setup : function() { return arguments; },
+ teardown : function() {},
+ endUnit : function() {}
+}
+
+var __testSuccess__ = true;
+var __testFailCount__ = 0;
+var __testLog__;
+var __backlog__ = [];
+
+var getUrlOptions = (function() {
+ var _urlOptionsParsed = false;
+ var _urlOptions = {};
+ return function() {
+ if (!_urlOptionsParsed) {
+ var s = window.location.href;
+ var q = s.indexOf("?");
+ var e = s.indexOf("#");
+ if (e < 0) {
+ e = s.length;
+ }
+ var query = s.substring(q + 1, e);
+ var pairs = query.split("&");
+ for (var ii = 0; ii < pairs.length; ++ii) {
+ var keyValue = pairs[ii].split("=");
+ var key = keyValue[0];
+ var value = decodeURIComponent(keyValue[1]);
+ _urlOptions[key] = value;
+ }
+ _urlOptionsParsed = true;
+ }
+
+ return _urlOptions;
+ }
+})();
+
+if (typeof quietMode == 'undefined') {
+ var quietMode = (function() {
+ var _quietModeChecked = false;
+ var _isQuiet = false;
+ return function() {
+ if (!_quietModeChecked) {
+ _isQuiet = (getUrlOptions().quiet == 1);
+ _quietModeChecked = true;
+ }
+ return _isQuiet;
+ }
+ })();
+}
+
+Object.toSource = function(a, seen){
+ if (a == null) return "null";
+ if (typeof a == 'boolean') return a ? "true" : "false";
+ if (typeof a == 'string') return '"' + a.replace(/"/g, '\\"') + '"';
+ if (a instanceof HTMLElement) return a.toString();
+ if (a.width && a.height && a.data) return "[ImageData]";
+ if (a instanceof Array) {
+ if (!seen) seen = [];
+ var idx = seen.indexOf(a);
+ if (idx != -1) return '#'+(idx+1)+'#';
+ seen.unshift(a);
+ var srcs = a.map(function(o){ return Object.toSource(o,seen) });
+ var prefix = '';
+ idx = seen.indexOf(a);
+ if (idx != -1) prefix = '#'+(idx+1)+'=';
+ return prefix + '[' + srcs.join(", ") + ']';
+ }
+ if (typeof a == 'object') {
+ if (!seen) seen = [];
+ var idx = seen.indexOf(a);
+ if (idx != -1) return '#'+(idx+1)+'#';
+ seen.unshift(a);
+ var members = [];
+ var name;
+ try {
+ for (var i in a) {
+ if (i.search(/^[a-zA-Z0-9]+$/) != -1)
+ name = i;
+ else
+ name = '"' + i.replace(/"/g, '\\"') + '"';
+ var ai;
+ try { ai = a[i]; }
+ catch(e) { ai = 'null /*ERROR_ACCESSING*/'; }
+ var s = name + ':' + Object.toSource(ai, seen);
+ members.push(s);
+ }
+ } catch (e) {}
+ var prefix = '';
+ idx = seen.indexOf(a);
+ if (idx != -1) prefix = '#'+(idx+1)+'=';
+ return prefix + '{' + members.join(", ") + '}'
+ }
+ if (typeof a == 'function')
+ return '('+a.toString().replace(/\n/g, " ").replace(/\s+/g, " ")+')';
+ return a.toString();
+}
+
+function formatError(e) {
+ if (window.console) console.log(e);
+ var pathSegs = location.href.toString().split("/");
+ var currentDoc = e.lineNumber != null ? pathSegs[pathSegs.length - 1] : null;
+ var trace = (e.filename || currentDoc) + ":" + e.lineNumber + (e.trace ? "\n"+e.trace : "");
+ return e.message + "\n" + trace;
+}
+
+function runTests() {
+ var h = document.getElementById('test-status');
+ if (h == null) {
+ h = document.createElement('h1');
+ h.id = 'test-status';
+ document.body.appendChild(h);
+ }
+ h.textContent = "";
+ var log = document.getElementById('test-log');
+ if (log == null) {
+ log = document.createElement('div');
+ log.id = 'test-log';
+ document.body.appendChild(log);
+ }
+ while (log.childNodes.length > 0)
+ log.removeChild(log.firstChild);
+
+ var setup_args = [];
+
+ if (Tests.startUnit != null) {
+ __testLog__ = document.createElement('div');
+ try {
+ setup_args = Tests.startUnit();
+ if (__testLog__.childNodes.length > 0)
+ log.appendChild(__testLog__);
+ } catch(e) {
+ testFailed("startUnit", formatError(e));
+ log.appendChild(__testLog__);
+ printTestStatus();
+ return;
+ }
+ }
+
+ var testsRun = false;
+ var allTestsSuccessful = true;
+
+ for (var i in Tests) {
+ if (i.substring(0,4) != "test") continue;
+ __testLog__ = document.createElement('div');
+ __testSuccess__ = true;
+ try {
+ doTestNotify (i);
+ var args = setup_args;
+ if (Tests.setup != null)
+ args = Tests.setup.apply(Tests, setup_args);
+ Tests[i].apply(Tests, args);
+ if (Tests.teardown != null)
+ Tests.teardown.apply(Tests, args);
+ }
+ catch (e) {
+ testFailed(i, e.name, formatError(e));
+ }
+ if (__testSuccess__ == false) {
+ ++__testFailCount__;
+ }
+ var h = document.createElement('h2');
+ h.textContent = i;
+ __testLog__.insertBefore(h, __testLog__.firstChild);
+ log.appendChild(__testLog__);
+ allTestsSuccessful = allTestsSuccessful && __testSuccess__ == true;
+ reportTestResultsToHarness(__testSuccess__, i);
+ doTestNotify (i+"--"+(__testSuccess__?"OK":"FAIL"));
+ testsRun = true;
+ }
+
+ printTestStatus(testsRun);
+ if (Tests.endUnit != null) {
+ __testLog__ = document.createElement('div');
+ try {
+ Tests.endUnit.apply(Tests, setup_args);
+ if (__testLog__.childNodes.length > 0)
+ log.appendChild(__testLog__);
+ } catch(e) {
+ testFailed("endUnit", e.name, formatError(e));
+ log.appendChild(__testLog__);
+ }
+ }
+ notifyFinishedToHarness(allTestsSuccessful, "finished tests");
+}
+
+function doTestNotify(name) {
+ //try {
+ // var xhr = new XMLHttpRequest();
+ // xhr.open("GET", "http://localhost:8888/"+name, true);
+ // xhr.send(null);
+ //} catch(e) {}
+}
+
+function testFailed(assertName, name) {
+ var d = document.createElement('div');
+ var h = document.createElement('h3');
+ var d1 = document.createElement("span");
+ h.appendChild(d1);
+ d1.appendChild(document.createTextNode("FAIL: "));
+ d1.style.color = "red";
+ h.appendChild(document.createTextNode(
+ name==null ? assertName : name + " (in " + assertName + ")"));
+ d.appendChild(h);
+ var args = []
+ for (var i=2; i<arguments.length; i++) {
+ var a = arguments[i];
+ var p = document.createElement('p');
+ p.style.whiteSpace = 'pre';
+ p.textContent = (a == null) ? "null" :
+ (typeof a == 'boolean' || typeof a == 'string') ? a : Object.toSource(a);
+ args.push(p.textContent);
+ d.appendChild(p);
+ }
+ __testLog__.appendChild(d);
+ __testSuccess__ = false;
+ doTestNotify([assertName, name].concat(args).join("--"));
+}
+
+function testPassed(assertName, name) {
+ if (!quietMode()) {
+ var d = document.createElement('div');
+ var h = document.createElement('h3');
+ var d1 = document.createElement("span");
+ h.appendChild(d1);
+ d1.appendChild(document.createTextNode("PASS: "));
+ d1.style.color = "green";
+ h.appendChild(document.createTextNode(
+ name==null ? assertName : name + " (in " + assertName + ")"));
+ d.appendChild(h);
+ var args = []
+ for (var i=2; i<arguments.length; i++) {
+ var a = arguments[i];
+ var p = document.createElement('p');
+ p.style.whiteSpace = 'pre';
+ p.textContent = (a == null) ? "null" :
+ (typeof a == 'boolean' || typeof a == 'string') ? a : Object.toSource(a);
+ args.push(p.textContent);
+ d.appendChild(p);
+ }
+ __testLog__.appendChild(d);
+ }
+ doTestNotify([assertName, name].concat(args).join("--"));
+}
+
+function checkTestSuccess() {
+ return __testFailCount__ == 0;
+}
+
+window.addEventListener('load', function(){
+ for (var i=0; i<__backlog__.length; i++)
+ log(__backlog__[i]);
+}, false);
+
+function log(msg) {
+ var p = document.createElement('p');
+ var a = [];
+ for (var i=0; i<arguments.length; i++)
+ a.push(arguments[i]);
+ p.textContent = a.join(", ");
+ if (!__testLog__) {
+ if (document.body)
+ document.body.appendChild(p);
+ else
+ __backlog__.push(msg);
+ } else {
+ __testLog__.appendChild(p);
+ }
+}
+
+function printTestStatus(testsRun) {
+ var status = document.getElementById('test-status');
+ if (testsRun) {
+ status.className = checkTestSuccess() ? 'ok' : 'fail';
+ status.textContent = checkTestSuccess() ? "PASS" : "FAIL";
+ } else {
+ status.className = 'fail';
+ status.textContent = "NO TESTS FOUND";
+ }
+}
+
+function assertFail(name, f) {
+ if (f == null) { f = name; name = null; }
+ var r = false;
+ try { f(); } catch(e) { r=true; }
+ if (!r) {
+ testFailed("assertFail", name, f);
+ return false;
+ } else {
+ testPassed("assertFail", name, f);
+ return true;
+ }
+}
+
+function assertOk(name, f) {
+ if (f == null) { f = name; name = null; }
+ var r = false;
+ var err;
+ try { f(); r=true; } catch(e) { err = e; }
+ if (!r) {
+ testFailed("assertOk", name, f, err.toString());
+ return false;
+ } else {
+ testPassed("assertOk", name, f);
+ return true;
+ }
+}
+
+function assert(name, v) {
+ if (v == null) { v = name; name = null; }
+ if (!v) {
+ testFailed("assert", name, v);
+ return false;
+ } else {
+ testPassed("assert", name, v);
+ return true;
+ }
+}
+
+function assertProperty(name, v, p) {
+ if (p == null) { p = v; v = name; name = p; }
+ if (v[p] == null) {
+ testFailed("assertProperty", name);
+ return false;
+ } else {
+ testPassed("assertProperty", name);
+ return true;
+ }
+}
+
+function compare(a,b) {
+ if (typeof a == 'number' && typeof b == 'number') {
+ return a == b;
+ } else {
+ return Object.toSource(a) == Object.toSource(b);
+ }
+}
+
+function assertEquals(name, v, p) {
+ if (p == null) { p = v; v = name; name = null; }
+ if (!compare(v, p)) {
+ testFailed("assertEquals", name, v, p);
+ return false;
+ } else {
+ testPassed("assertEquals", name, v, p);
+ return true;
+ }
+}
+
+function assertArrayEquals(name, v, p) {
+ if (p == null) { p = v; v = name; name = null; }
+ if (!v) {
+ testFailed("assertArrayEquals: first array undefined", name, v, p);
+ return false;
+ }
+ if (!p) {
+ testFailed("assertArrayEquals: second array undefined", name, v, p);
+ return false;
+ }
+ if (v.length != p.length) {
+ testFailed("assertArrayEquals", name, v, p);
+ return false;
+ }
+ for (var ii = 0; ii < v.length; ++ii) {
+ if (v[ii] != p[ii]) {
+ testFailed("assertArrayEquals", name, v, p);
+ return false;
+ }
+ }
+ testPassed("assertArrayEquals", name, v, p);
+ return true;
+}
+
+function assertArrayEqualsWithEpsilon(name, v, p, l) {
+ if (l == null) { l = p; p = v; v = name; name = null; }
+ if (!v) {
+ testFailed("assertArrayEqualsWithEpsilon: first array undefined", name, v, p);
+ return false;
+ }
+ if (!p) {
+ testFailed("assertArrayEqualsWithEpsilon: second array undefined", name, v, p);
+ return false;
+ }
+ if (!l) {
+ testFailed("assertArrayEqualsWithEpsilon: limit array undefined", name, v, p);
+ return false;
+ }
+ if (v.length != p.length) {
+ testFailed("assertArrayEqualsWithEpsilon", name, v, p, l);
+ return false;
+ }
+ if (v.length != l.length) {
+ testFailed("assertArrayEqualsWithEpsilon", name, v, p, l);
+ return false;
+ }
+ for (var ii = 0; ii < v.length; ++ii) {
+ if (Math.abs(v[ii]- p[ii])>l[ii]) {
+ testFailed("assertArrayEqualsWithEpsilon", name, v, p, l);
+ return false;
+ }
+ }
+ testPassed("assertArrayEqualsWithEpsilon", name, v, p, l);
+ return true;
+}
+
+function assertNotEquals(name, v, p) {
+ if (p == null) { p = v; v = name; name = null; }
+ if (compare(v, p)) {
+ testFailed("assertNotEquals", name, v, p)
+ return false;
+ } else {
+ testPassed("assertNotEquals", name, v, p)
+ return true;
+ }
+}
+
+function time(elementId, f) {
+ var s = document.getElementById(elementId);
+ var t0 = new Date().getTime();
+ f();
+ var t1 = new Date().getTime();
+ s.textContent = 'Elapsed: '+(t1-t0)+' ms';
+}
+
+function randomFloat () {
+ // note that in fuzz-testing, this can used as the size of a buffer to allocate.
+ // so it shouldn't return astronomic values. The maximum value 10000000 is already quite big.
+ var fac = 1.0;
+ var r = Math.random();
+ if (r < 0.25)
+ fac = 10;
+ else if (r < 0.4)
+ fac = 100;
+ else if (r < 0.5)
+ fac = 1000;
+ else if (r < 0.6)
+ fac = 100000;
+ else if (r < 0.7)
+ fac = 10000000;
+ else if (r < 0.8)
+ fac = NaN;
+ return -0.5*fac + Math.random() * fac;
+}
+function randomFloatFromRange(lo, hi) {
+ var r = Math.random();
+ if (r < 0.05)
+ return lo;
+ else if (r > 0.95)
+ return hi;
+ else
+ return lo + Math.random()*(hi-lo);
+}
+function randomInt (sz) {
+ if (sz != null)
+ return Math.floor(Math.random()*sz);
+ else
+ return Math.floor(randomFloat());
+}
+function randomIntFromRange(lo, hi) {
+ return Math.floor(randomFloatFromRange(lo, hi));
+}
+function randomLength () {
+ var l = Math.floor(Math.random() * 256);
+ if (Math.random < 0.5) l = l / 10;
+ if (Math.random < 0.3) l = l / 10;
+ return l;
+}
+function randomSmallIntArray () {
+ var l = randomLength();
+ var s = new Array(l);
+ for (var i=0; i<l; i++)
+ s[i] = Math.floor(Math.random() * 256)-1;
+ return s;
+}
+function randomFloatArray () {
+ var l = randomLength();
+ var s = new Array(l);
+ for (var i=0; i<l; i++)
+ s[i] = randomFloat();
+ return s;
+}
+function randomIntArray () {
+ var l = randomLength();
+ var s = new Array(l);
+ for (var i=0; i<l; i++)
+ s[i] = randomFloat();
+ return s;
+}
+function randomMixedArray () {
+ var l = randomLength();
+ var s = new Array(l);
+ for (var i=0; i<l; i++)
+ s[i] = randomNonArray();
+ return s;
+}
+function randomArray () {
+ var r = Math.random();
+ if (r < 0.3)
+ return randomFloatArray();
+ else if (r < 0.6)
+ return randomIntArray();
+ else if (r < 0.8)
+ return randomSmallIntArray();
+ else
+ return randomMixedArray();
+}
+function randomString () {
+ return String.fromCharCode.apply(String, randomSmallIntArray());
+}
+function randomGLConstant () {
+ return GLConstants[Math.floor(Math.random() * GLConstants.length)];
+}
+
+function randomNonArray() {
+ var r = Math.random();
+ if (r < 0.25) {
+ return randomFloat();
+ } else if (r < 0.6) {
+ return randomInt();
+ } else if (r < 0.7) {
+ return (r < 0.65);
+ } else if (r < 0.87) {
+ return randomString();
+ } else if (r < 0.98) {
+ return randomGLConstant();
+ } else {
+ return null;
+ }
+}
+
+function generateRandomArg(pos, count) {
+ if (pos == 0 && Math.random() < 0.5)
+ return randomGLConstant();
+ if (pos == count-1 && Math.random() < 0.25)
+ if (Math.random() < 0.5)
+ return randomString();
+ else
+ return randomArray();
+ var r = Math.random();
+ if (r < 0.25) {
+ return randomFloat();
+ } else if (r < 0.6) {
+ return randomInt();
+ } else if (r < 0.7) {
+ return (r < 0.65);
+ } else if (r < 0.77) {
+ return randomString();
+ } else if (r < 0.84) {
+ return randomArray();
+ } else if (r < 0.98) {
+ return randomGLConstant();
+ } else {
+ return null;
+ }
+}
+
+
+function generateRandomArgs(count) {
+ var arr = new Array(count);
+ for (var i=0; i<count; i++)
+ arr[i] = generateRandomArg(i, count);
+ return arr;
+}
+
+// qc (arg1gen, arg2gen, ..., predicate)
+// qc (randomString, randomInt, randomInt, function(s,i,j){ s.substring(i,j) })
+function qc() {
+}
+
+GLConstants = [
+1,
+0x00000100,
+0x00000400,
+0x00004000,
+0x0000,
+0x0001,
+0x0002,
+0x0003,
+0x0004,
+0x0005,
+0x0006,
+0,
+1,
+0x0300,
+0x0301,
+0x0302,
+0x0303,
+0x0304,
+0x0305,
+0x0306,
+0x0307,
+0x0308,
+0x8006,
+0x8009,
+0x8009,
+0x883D,
+0x800A,
+0x800B,
+0x80C8,
+0x80C9,
+0x80CA,
+0x80CB,
+0x8001,
+0x8002,
+0x8003,
+0x8004,
+0x8005,
+0x8892,
+0x8893,
+0x8894,
+0x8895,
+0x88E0,
+0x88E4,
+0x88E8,
+0x8764,
+0x8765,
+0x8626,
+0x0404,
+0x0405,
+0x0408,
+0x0DE1,
+0x0B44,
+0x0BE2,
+0x0BD0,
+0x0B90,
+0x0B71,
+0x0C11,
+0x8037,
+0x809E,
+0x80A0,
+0,
+0x0500,
+0x0501,
+0x0502,
+0x0505,
+0x0900,
+0x0901,
+0x0B21,
+0x846D,
+0x846E,
+0x0B45,
+0x0B46,
+0x0B70,
+0x0B72,
+0x0B73,
+0x0B74,
+0x0B91,
+0x0B92,
+0x0B94,
+0x0B95,
+0x0B96,
+0x0B97,
+0x0B93,
+0x0B98,
+0x8800,
+0x8801,
+0x8802,
+0x8803,
+0x8CA3,
+0x8CA4,
+0x8CA5,
+0x0BA2,
+0x0C10,
+0x0C22,
+0x0C23,
+0x0CF5,
+0x0D05,
+0x0D33,
+0x0D3A,
+0x0D50,
+0x0D52,
+0x0D53,
+0x0D54,
+0x0D55,
+0x0D56,
+0x0D57,
+0x2A00,
+0x8038,
+0x8069,
+0x80A8,
+0x80A9,
+0x80AA,
+0x80AB,
+0x86A2,
+0x86A3,
+0x1100,
+0x1101,
+0x1102,
+0x8192,
+0x1400,
+0x1401,
+0x1402,
+0x1403,
+0x1404,
+0x1405,
+0x1406,
+0x140C,
+0x1902,
+0x1906,
+0x1907,
+0x1908,
+0x1909,
+0x190A,
+0x8033,
+0x8034,
+0x8363,
+0x8B30,
+0x8B31,
+0x8869,
+0x8DFB,
+0x8DFC,
+0x8B4D,
+0x8B4C,
+0x8872,
+0x8DFD,
+0x8B4F,
+0x8B80,
+0x8B82,
+0x8B83,
+0x8B85,
+0x8B86,
+0x8B87,
+0x8B89,
+0x8B8A,
+0x8B8C,
+0x8B8D,
+0x0200,
+0x0201,
+0x0202,
+0x0203,
+0x0204,
+0x0205,
+0x0206,
+0x0207,
+0x1E00,
+0x1E01,
+0x1E02,
+0x1E03,
+0x150A,
+0x8507,
+0x8508,
+0x1F00,
+0x1F01,
+0x1F02,
+0x1F03,
+0x2600,
+0x2601,
+0x2700,
+0x2701,
+0x2702,
+0x2703,
+0x2800,
+0x2801,
+0x2802,
+0x2803,
+0x1702,
+0x8513,
+0x8514,
+0x8515,
+0x8516,
+0x8517,
+0x8518,
+0x8519,
+0x851A,
+0x851C,
+0x84C0,
+0x84C1,
+0x84C2,
+0x84C3,
+0x84C4,
+0x84C5,
+0x84C6,
+0x84C7,
+0x84C8,
+0x84C9,
+0x84CA,
+0x84CB,
+0x84CC,
+0x84CD,
+0x84CE,
+0x84CF,
+0x84D0,
+0x84D1,
+0x84D2,
+0x84D3,
+0x84D4,
+0x84D5,
+0x84D6,
+0x84D7,
+0x84D8,
+0x84D9,
+0x84DA,
+0x84DB,
+0x84DC,
+0x84DD,
+0x84DE,
+0x84DF,
+0x84E0,
+0x2901,
+0x812F,
+0x8370,
+0x8B50,
+0x8B51,
+0x8B52,
+0x8B53,
+0x8B54,
+0x8B55,
+0x8B56,
+0x8B57,
+0x8B58,
+0x8B59,
+0x8B5A,
+0x8B5B,
+0x8B5C,
+0x8B5E,
+0x8B60,
+0x8622,
+0x8623,
+0x8624,
+0x8625,
+0x886A,
+0x8645,
+0x889F,
+0x8B9A,
+0x8B9B,
+0x8B81,
+0x8B84,
+0x8B88,
+0x8DFA,
+0x8DF8,
+0x8DF9,
+0x8DF0,
+0x8DF1,
+0x8DF2,
+0x8DF3,
+0x8DF4,
+0x8DF5,
+0x8D40,
+0x8D41,
+0x8056,
+0x8057,
+0x8D62,
+0x81A5,
+0x1901,
+0x8D48,
+0x8D42,
+0x8D43,
+0x8D44,
+0x8D50,
+0x8D51,
+0x8D52,
+0x8D53,
+0x8D54,
+0x8D55,
+0x8CD0,
+0x8CD1,
+0x8CD2,
+0x8CD3,
+0x8CE0,
+0x8D00,
+0x8D20,
+0,
+0x8CD5,
+0x8CD6,
+0x8CD7,
+0x8CD9,
+0x8CDD,
+0x8CA6,
+0x8CA7,
+0x84E8,
+0x0506,
+0x809D
+];
+
+function reportTestResultsToHarness(success, msg) {
+ if (window.parent.webglTestHarness) {
+ window.parent.webglTestHarness.reportResults(window.location.pathname, success, msg);
+ }
+}
+
+function notifyFinishedToHarness() {
+ if (window.parent.webglTestHarness) {
+ window.parent.webglTestHarness.notifyFinished(window.location.pathname);
+ }
+}
+
+function initTests() {
+ if (Tests.message != null) {
+ var h = document.getElementById('test-message');
+ if (h == null) {
+ h = document.createElement('p');
+ h.id = 'test-message';
+ document.body.insertBefore(h, document.body.firstChild);
+ }
+ h.textContent = Tests.message;
+ }
+ if (Tests.autorun) {
+ runTests();
+ } else {
+ var h = document.getElementById('test-run');
+ if (h == null) {
+ h = document.createElement('input');
+ h.type = 'submit';
+ h.value = "Run tests";
+ h.addEventListener('click', function(ev){
+ runTests();
+ ev.preventDefault();
+ }, false);
+ h.id = 'test-run';
+ document.body.insertBefore(h, document.body.firstChild);
+ }
+ h.textContent = Tests.message;
+ }
+
+}
+
+window.addEventListener('load', function(){
+ if (Tests.autoinit) {
+ // let the browser hopefully finish updating the gl canvas surfaces if we are given a delay
+ if (Tests.delay)
+ setTimeout(initTests, Tests.delay);
+ else
+ initTests()
+ }
+}, false);
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/more/util.js b/dom/canvas/test/webgl-conf/checkout/conformance/more/util.js
new file mode 100644
index 0000000000..78cc08a652
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/more/util.js
@@ -0,0 +1,1287 @@
+/*
+Utilities for the OpenGL ES 2.0 HTML Canvas context
+*/
+
+/*
+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.
+*/
+
+function loadTexture(gl, elem, mipmaps) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, elem);
+ if (mipmaps != false)
+ gl.generateMipmap(gl.TEXTURE_2D);
+ 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_MAG_FILTER, gl.LINEAR);
+ if (mipmaps)
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
+ else
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ return tex;
+}
+
+function getShader(gl, id) {
+ var shaderScript = document.getElementById(id);
+ if (!shaderScript) {
+ throw(new Error("No shader element with id: "+id));
+ }
+
+ var str = "";
+ var k = shaderScript.firstChild;
+ while (k) {
+ if (k.nodeType == 3)
+ str += k.textContent;
+ k = k.nextSibling;
+ }
+
+ var shader;
+ if (shaderScript.type == "x-shader/x-fragment") {
+ shader = gl.createShader(gl.FRAGMENT_SHADER);
+ } else if (shaderScript.type == "x-shader/x-vertex") {
+ shader = gl.createShader(gl.VERTEX_SHADER);
+ } else {
+ throw(new Error("Unknown shader type "+shaderScript.type));
+ }
+
+ gl.shaderSource(shader, str);
+ gl.compileShader(shader);
+
+ if (gl.getShaderParameter(shader, gl.COMPILE_STATUS) != 1) {
+ var ilog = gl.getShaderInfoLog(shader);
+ gl.deleteShader(shader);
+ throw(new Error("Failed to compile shader "+shaderScript.id + ", Shader info log: " + ilog));
+ }
+ return shader;
+}
+
+function loadShaderArray(gl, shaders) {
+ var id = gl.createProgram();
+ var shaderObjs = [];
+ for (var i=0; i<shaders.length; ++i) {
+ try {
+ var sh = getShader(gl, shaders[i]);
+ shaderObjs.push(sh);
+ gl.attachShader(id, sh);
+ } catch (e) {
+ var pr = {program: id, shaders: shaderObjs};
+ deleteShader(gl, pr);
+ throw (e);
+ }
+ }
+ var prog = {program: id, shaders: shaderObjs};
+ gl.linkProgram(id);
+ gl.validateProgram(id);
+ if (gl.getProgramParameter(id, gl.LINK_STATUS) != 1) {
+ deleteShader(gl,prog);
+ throw(new Error("Failed to link shader"));
+ }
+ if (gl.getProgramParameter(id, gl.VALIDATE_STATUS) != 1) {
+ deleteShader(gl,prog);
+ throw(new Error("Failed to validate shader"));
+ }
+ return prog;
+}
+function loadShader(gl) {
+ var sh = [];
+ for (var i=1; i<arguments.length; ++i)
+ sh.push(arguments[i]);
+ return loadShaderArray(gl, sh);
+}
+
+function deleteShader(gl, sh) {
+ gl.useProgram(null);
+ sh.shaders.forEach(function(s){
+ gl.detachShader(sh.program, s);
+ gl.deleteShader(s);
+ });
+ gl.deleteProgram(sh.program);
+}
+
+function getGLErrorAsString(ctx, err) {
+ if (err === ctx.NO_ERROR) {
+ return "NO_ERROR";
+ }
+ for (var name in ctx) {
+ if (ctx[name] === err) {
+ return name;
+ }
+ }
+ return err.toString();
+}
+
+function checkError(gl, msg) {
+ var e = gl.getError();
+ if (e != gl.NO_ERROR) {
+ log("Error " + getGLErrorAsString(gl, e) + " at " + msg);
+ }
+ return e;
+}
+
+function throwError(gl, msg) {
+ var e = gl.getError();
+ if (e != 0) {
+ throw(new Error("Error " + getGLErrorAsString(gl, e) + " at " + msg));
+ }
+}
+
+Math.cot = function(z) { return 1.0 / Math.tan(z); }
+
+/*
+ Matrix utilities, using the OpenGL element order where
+ the last 4 elements are the translation column.
+
+ Uses flat arrays as matrices for performance.
+
+ Most operations have in-place variants to avoid allocating temporary matrices.
+
+ Naming logic:
+ Matrix.method operates on a 4x4 Matrix and returns a new Matrix.
+ Matrix.method3x3 operates on a 3x3 Matrix and returns a new Matrix. Not all operations have a 3x3 version (as 3x3 is usually only used for the normal matrix: Matrix.transpose3x3(Matrix.inverseTo3x3(mat4x4)))
+ Matrix.method[3x3]InPlace(args, target) stores its result in the target matrix.
+
+ Matrix.scale([sx, sy, sz]) -- non-uniform scale by vector
+ Matrix.scale1(s) -- uniform scale by scalar
+ Matrix.scale3(sx, sy, sz) -- non-uniform scale by scalars
+
+ Ditto for translate.
+*/
+Matrix = {
+ identity : [
+ 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
+ ],
+
+ newIdentity : function() {
+ return [
+ 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
+ ];
+ },
+
+ newIdentity3x3 : function() {
+ return [
+ 1.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 0.0, 0.0, 1.0
+ ];
+ },
+
+ copyMatrix : function(src, dst) {
+ for (var i=0; i<16; i++) dst[i] = src[i];
+ return dst;
+ },
+
+ to3x3 : function(m) {
+ return [
+ m[0], m[1], m[2],
+ m[4], m[5], m[6],
+ m[8], m[9], m[10]
+ ];
+ },
+
+ // orthonormal matrix inverse
+ inverseON : function(m) {
+ var n = this.transpose4x4(m);
+ var t = [m[12], m[13], m[14]];
+ n[3] = n[7] = n[11] = 0;
+ n[12] = -Vec3.dot([n[0], n[4], n[8]], t);
+ n[13] = -Vec3.dot([n[1], n[5], n[9]], t);
+ n[14] = -Vec3.dot([n[2], n[6], n[10]], t);
+ return n;
+ },
+
+ inverseTo3x3 : function(m) {
+ return this.inverse4x4to3x3InPlace(m, this.newIdentity3x3());
+ },
+
+ inverseTo3x3InPlace : function(m,n) {
+ var a11 = m[10]*m[5]-m[6]*m[9],
+ a21 = -m[10]*m[1]+m[2]*m[9],
+ a31 = m[6]*m[1]-m[2]*m[5],
+ a12 = -m[10]*m[4]+m[6]*m[8],
+ a22 = m[10]*m[0]-m[2]*m[8],
+ a32 = -m[6]*m[0]+m[2]*m[4],
+ a13 = m[9]*m[4]-m[5]*m[8],
+ a23 = -m[9]*m[0]+m[1]*m[8],
+ a33 = m[5]*m[0]-m[1]*m[4];
+ var det = m[0]*(a11) + m[1]*(a12) + m[2]*(a13);
+ if (det == 0) // no inverse
+ return [1,0,0,0,1,0,0,0,1];
+ var idet = 1 / det;
+ n[0] = idet*a11;
+ n[1] = idet*a21;
+ n[2] = idet*a31;
+ n[3] = idet*a12;
+ n[4] = idet*a22;
+ n[5] = idet*a32;
+ n[6] = idet*a13;
+ n[7] = idet*a23;
+ n[8] = idet*a33;
+ return n;
+ },
+
+ inverse3x3 : function(m) {
+ return this.inverse3x3InPlace(m, this.newIdentity3x3());
+ },
+
+ inverse3x3InPlace : function(m,n) {
+ var a11 = m[8]*m[4]-m[5]*m[7],
+ a21 = -m[8]*m[1]+m[2]*m[7],
+ a31 = m[5]*m[1]-m[2]*m[4],
+ a12 = -m[8]*m[3]+m[5]*m[6],
+ a22 = m[8]*m[0]-m[2]*m[6],
+ a32 = -m[5]*m[0]+m[2]*m[3],
+ a13 = m[7]*m[4]-m[4]*m[8],
+ a23 = -m[7]*m[0]+m[1]*m[6],
+ a33 = m[4]*m[0]-m[1]*m[3];
+ var det = m[0]*(a11) + m[1]*(a12) + m[2]*(a13);
+ if (det == 0) // no inverse
+ return [1,0,0,0,1,0,0,0,1];
+ var idet = 1 / det;
+ n[0] = idet*a11;
+ n[1] = idet*a21;
+ n[2] = idet*a31;
+ n[3] = idet*a12;
+ n[4] = idet*a22;
+ n[5] = idet*a32;
+ n[6] = idet*a13;
+ n[7] = idet*a23;
+ n[8] = idet*a33;
+ return n;
+ },
+
+ frustum : function (left, right, bottom, top, znear, zfar) {
+ var X = 2*znear/(right-left);
+ var Y = 2*znear/(top-bottom);
+ var A = (right+left)/(right-left);
+ var B = (top+bottom)/(top-bottom);
+ var C = -(zfar+znear)/(zfar-znear);
+ var D = -2*zfar*znear/(zfar-znear);
+
+ return [
+ X, 0, 0, 0,
+ 0, Y, 0, 0,
+ A, B, C, -1,
+ 0, 0, D, 0
+ ];
+ },
+
+ perspective : function (fovy, aspect, znear, zfar) {
+ var ymax = znear * Math.tan(fovy * Math.PI / 360.0);
+ var ymin = -ymax;
+ var xmin = ymin * aspect;
+ var xmax = ymax * aspect;
+
+ return this.frustum(xmin, xmax, ymin, ymax, znear, zfar);
+ },
+
+ mul4x4 : function (a,b) {
+ return this.mul4x4InPlace(a,b,this.newIdentity());
+ },
+
+ mul4x4InPlace : function (a, b, c) {
+ c[0] = b[0] * a[0] +
+ b[0+1] * a[4] +
+ b[0+2] * a[8] +
+ b[0+3] * a[12];
+ c[0+1] = b[0] * a[1] +
+ b[0+1] * a[5] +
+ b[0+2] * a[9] +
+ b[0+3] * a[13];
+ c[0+2] = b[0] * a[2] +
+ b[0+1] * a[6] +
+ b[0+2] * a[10] +
+ b[0+3] * a[14];
+ c[0+3] = b[0] * a[3] +
+ b[0+1] * a[7] +
+ b[0+2] * a[11] +
+ b[0+3] * a[15];
+ c[4] = b[4] * a[0] +
+ b[4+1] * a[4] +
+ b[4+2] * a[8] +
+ b[4+3] * a[12];
+ c[4+1] = b[4] * a[1] +
+ b[4+1] * a[5] +
+ b[4+2] * a[9] +
+ b[4+3] * a[13];
+ c[4+2] = b[4] * a[2] +
+ b[4+1] * a[6] +
+ b[4+2] * a[10] +
+ b[4+3] * a[14];
+ c[4+3] = b[4] * a[3] +
+ b[4+1] * a[7] +
+ b[4+2] * a[11] +
+ b[4+3] * a[15];
+ c[8] = b[8] * a[0] +
+ b[8+1] * a[4] +
+ b[8+2] * a[8] +
+ b[8+3] * a[12];
+ c[8+1] = b[8] * a[1] +
+ b[8+1] * a[5] +
+ b[8+2] * a[9] +
+ b[8+3] * a[13];
+ c[8+2] = b[8] * a[2] +
+ b[8+1] * a[6] +
+ b[8+2] * a[10] +
+ b[8+3] * a[14];
+ c[8+3] = b[8] * a[3] +
+ b[8+1] * a[7] +
+ b[8+2] * a[11] +
+ b[8+3] * a[15];
+ c[12] = b[12] * a[0] +
+ b[12+1] * a[4] +
+ b[12+2] * a[8] +
+ b[12+3] * a[12];
+ c[12+1] = b[12] * a[1] +
+ b[12+1] * a[5] +
+ b[12+2] * a[9] +
+ b[12+3] * a[13];
+ c[12+2] = b[12] * a[2] +
+ b[12+1] * a[6] +
+ b[12+2] * a[10] +
+ b[12+3] * a[14];
+ c[12+3] = b[12] * a[3] +
+ b[12+1] * a[7] +
+ b[12+2] * a[11] +
+ b[12+3] * a[15];
+ return c;
+ },
+
+ mulv4 : function (a, v) {
+ c = new Array(4);
+ for (var i=0; i<4; ++i) {
+ var x = 0;
+ for (var k=0; k<4; ++k)
+ x += v[k] * a[k*4+i];
+ c[i] = x;
+ }
+ return c;
+ },
+
+ rotate : function (angle, axis) {
+ axis = Vec3.normalize(axis);
+ var x=axis[0], y=axis[1], z=axis[2];
+ var c = Math.cos(angle);
+ var c1 = 1-c;
+ var s = Math.sin(angle);
+ return [
+ x*x*c1+c, y*x*c1+z*s, z*x*c1-y*s, 0,
+ x*y*c1-z*s, y*y*c1+c, y*z*c1+x*s, 0,
+ x*z*c1+y*s, y*z*c1-x*s, z*z*c1+c, 0,
+ 0,0,0,1
+ ];
+ },
+ rotateInPlace : function(angle, axis, m) {
+ axis = Vec3.normalize(axis);
+ var x=axis[0], y=axis[1], z=axis[2];
+ var c = Math.cos(angle);
+ var c1 = 1-c;
+ var s = Math.sin(angle);
+ var tmpMatrix = this.tmpMatrix;
+ var tmpMatrix2 = this.tmpMatrix2;
+ tmpMatrix[0] = x*x*c1+c; tmpMatrix[1] = y*x*c1+z*s; tmpMatrix[2] = z*x*c1-y*s; tmpMatrix[3] = 0;
+ tmpMatrix[4] = x*y*c1-z*s; tmpMatrix[5] = y*y*c1+c; tmpMatrix[6] = y*z*c1+x*s; tmpMatrix[7] = 0;
+ tmpMatrix[8] = x*z*c1+y*s; tmpMatrix[9] = y*z*c1-x*s; tmpMatrix[10] = z*z*c1+c; tmpMatrix[11] = 0;
+ tmpMatrix[12] = 0; tmpMatrix[13] = 0; tmpMatrix[14] = 0; tmpMatrix[15] = 1;
+ this.copyMatrix(m, tmpMatrix2);
+ return this.mul4x4InPlace(tmpMatrix2, tmpMatrix, m);
+ },
+
+ scale : function(v) {
+ return [
+ v[0], 0, 0, 0,
+ 0, v[1], 0, 0,
+ 0, 0, v[2], 0,
+ 0, 0, 0, 1
+ ];
+ },
+ scale3 : function(x,y,z) {
+ return [
+ x, 0, 0, 0,
+ 0, y, 0, 0,
+ 0, 0, z, 0,
+ 0, 0, 0, 1
+ ];
+ },
+ scale1 : function(s) {
+ return [
+ s, 0, 0, 0,
+ 0, s, 0, 0,
+ 0, 0, s, 0,
+ 0, 0, 0, 1
+ ];
+ },
+ scale3InPlace : function(x, y, z, m) {
+ var tmpMatrix = this.tmpMatrix;
+ var tmpMatrix2 = this.tmpMatrix2;
+ tmpMatrix[0] = x; tmpMatrix[1] = 0; tmpMatrix[2] = 0; tmpMatrix[3] = 0;
+ tmpMatrix[4] = 0; tmpMatrix[5] = y; tmpMatrix[6] = 0; tmpMatrix[7] = 0;
+ tmpMatrix[8] = 0; tmpMatrix[9] = 0; tmpMatrix[10] = z; tmpMatrix[11] = 0;
+ tmpMatrix[12] = 0; tmpMatrix[13] = 0; tmpMatrix[14] = 0; tmpMatrix[15] = 1;
+ this.copyMatrix(m, tmpMatrix2);
+ return this.mul4x4InPlace(tmpMatrix2, tmpMatrix, m);
+ },
+ scale1InPlace : function(s, m) { return this.scale3InPlace(s, s, s, m); },
+ scaleInPlace : function(s, m) { return this.scale3InPlace(s[0],s[1],s[2],m); },
+
+ translate3 : function(x,y,z) {
+ return [
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ x, y, z, 1
+ ];
+ },
+
+ translate : function(v) {
+ return this.translate3(v[0], v[1], v[2]);
+ },
+ tmpMatrix : [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],
+ tmpMatrix2 : [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0],
+ translate3InPlace : function(x,y,z,m) {
+ var tmpMatrix = this.tmpMatrix;
+ var tmpMatrix2 = this.tmpMatrix2;
+ tmpMatrix[0] = 1; tmpMatrix[1] = 0; tmpMatrix[2] = 0; tmpMatrix[3] = 0;
+ tmpMatrix[4] = 0; tmpMatrix[5] = 1; tmpMatrix[6] = 0; tmpMatrix[7] = 0;
+ tmpMatrix[8] = 0; tmpMatrix[9] = 0; tmpMatrix[10] = 1; tmpMatrix[11] = 0;
+ tmpMatrix[12] = x; tmpMatrix[13] = y; tmpMatrix[14] = z; tmpMatrix[15] = 1;
+ this.copyMatrix(m, tmpMatrix2);
+ return this.mul4x4InPlace(tmpMatrix2, tmpMatrix, m);
+ },
+ translateInPlace : function(v,m){ return this.translate3InPlace(v[0], v[1], v[2], m); },
+
+ lookAt : function (eye, center, up) {
+ var z = Vec3.direction(eye, center);
+ var x = Vec3.normalizeInPlace(Vec3.cross(up, z));
+ var y = Vec3.normalizeInPlace(Vec3.cross(z, x));
+
+ var m = [
+ x[0], y[0], z[0], 0,
+ x[1], y[1], z[1], 0,
+ x[2], y[2], z[2], 0,
+ 0, 0, 0, 1
+ ];
+
+ var t = [
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ -eye[0], -eye[1], -eye[2], 1
+ ];
+
+ return this.mul4x4(m,t);
+ },
+
+ transpose4x4 : function(m) {
+ return [
+ m[0], m[4], m[8], m[12],
+ m[1], m[5], m[9], m[13],
+ m[2], m[6], m[10], m[14],
+ m[3], m[7], m[11], m[15]
+ ];
+ },
+
+ transpose4x4InPlace : function(m) {
+ var tmp = 0.0;
+ tmp = m[1]; m[1] = m[4]; m[4] = tmp;
+ tmp = m[2]; m[2] = m[8]; m[8] = tmp;
+ tmp = m[3]; m[3] = m[12]; m[12] = tmp;
+ tmp = m[6]; m[6] = m[9]; m[9] = tmp;
+ tmp = m[7]; m[7] = m[13]; m[13] = tmp;
+ tmp = m[11]; m[11] = m[14]; m[14] = tmp;
+ return m;
+ },
+
+ transpose3x3 : function(m) {
+ return [
+ m[0], m[3], m[6],
+ m[1], m[4], m[7],
+ m[2], m[5], m[8]
+ ];
+ },
+
+ transpose3x3InPlace : function(m) {
+ var tmp = 0.0;
+ tmp = m[1]; m[1] = m[3]; m[3] = tmp;
+ tmp = m[2]; m[2] = m[6]; m[6] = tmp;
+ tmp = m[5]; m[5] = m[7]; m[7] = tmp;
+ return m;
+ },
+}
+
+Vec3 = {
+ make : function() { return [0,0,0]; },
+ copy : function(v) { return [v[0],v[1],v[2]]; },
+
+ add : function (u,v) {
+ return [u[0]+v[0], u[1]+v[1], u[2]+v[2]];
+ },
+
+ sub : function (u,v) {
+ return [u[0]-v[0], u[1]-v[1], u[2]-v[2]];
+ },
+
+ negate : function (u) {
+ return [-u[0], -u[1], -u[2]];
+ },
+
+ direction : function (u,v) {
+ return this.normalizeInPlace(this.sub(u,v));
+ },
+
+ normalizeInPlace : function(v) {
+ var imag = 1.0 / Math.sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
+ v[0] *= imag; v[1] *= imag; v[2] *= imag;
+ return v;
+ },
+
+ normalize : function(v) {
+ return this.normalizeInPlace(this.copy(v));
+ },
+
+ scale : function(f, v) {
+ return [f*v[0], f*v[1], f*v[2]];
+ },
+
+ dot : function(u,v) {
+ return u[0]*v[0] + u[1]*v[1] + u[2]*v[2];
+ },
+
+ inner : function(u,v) {
+ return [u[0]*v[0], u[1]*v[1], u[2]*v[2]];
+ },
+
+ cross : function(u,v) {
+ return [
+ u[1]*v[2] - u[2]*v[1],
+ u[2]*v[0] - u[0]*v[2],
+ u[0]*v[1] - u[1]*v[0]
+ ];
+ }
+}
+
+Shader = function(gl){
+ this.gl = gl;
+ this.shaders = [];
+ this.uniformLocations = {};
+ this.attribLocations = {};
+ for (var i=1; i<arguments.length; i++) {
+ this.shaders.push(arguments[i]);
+ }
+}
+Shader.prototype = {
+ id : null,
+ gl : null,
+ compiled : false,
+ shader : null,
+ shaders : [],
+
+ destroy : function() {
+ if (this.shader != null) deleteShader(this.gl, this.shader);
+ },
+
+ compile : function() {
+ this.shader = loadShaderArray(this.gl, this.shaders);
+ },
+
+ use : function() {
+ if (this.shader == null)
+ this.compile();
+ this.gl.useProgram(this.shader.program);
+ },
+
+ uniform1fv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform1fv(loc, value);
+ },
+
+ uniform2fv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform2fv(loc, value);
+ },
+
+ uniform3fv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform3fv(loc, value);
+ },
+
+ uniform4fv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform4fv(loc, value);
+ },
+
+ uniform1f : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform1f(loc, value);
+ },
+
+ uniform2f : function(name, v1,v2) {
+ var loc = this.uniform(name);
+ this.gl.uniform2f(loc, v1,v2);
+ },
+
+ uniform3f : function(name, v1,v2,v3) {
+ var loc = this.uniform(name);
+ this.gl.uniform3f(loc, v1,v2,v3);
+ },
+
+ uniform4f : function(name, v1,v2,v3,v4) {
+ var loc = this.uniform(name);
+ this.gl.uniform4f(loc, v1, v2, v3, v4);
+ },
+
+ uniform1iv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform1iv(loc, value);
+ },
+
+ uniform2iv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform2iv(loc, value);
+ },
+
+ uniform3iv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform3iv(loc, value);
+ },
+
+ uniform4iv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform4iv(loc, value);
+ },
+
+ uniform1i : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniform1i(loc, value);
+ },
+
+ uniform2i : function(name, v1,v2) {
+ var loc = this.uniform(name);
+ this.gl.uniform2i(loc, v1,v2);
+ },
+
+ uniform3i : function(name, v1,v2,v3) {
+ var loc = this.uniform(name);
+ this.gl.uniform3i(loc, v1,v2,v3);
+ },
+
+ uniform4i : function(name, v1,v2,v3,v4) {
+ var loc = this.uniform(name);
+ this.gl.uniform4i(loc, v1, v2, v3, v4);
+ },
+
+ uniformMatrix4fv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniformMatrix4fv(loc, false, value);
+ },
+
+ uniformMatrix3fv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniformMatrix3fv(loc, false, value);
+ },
+
+ uniformMatrix2fv : function(name, value) {
+ var loc = this.uniform(name);
+ this.gl.uniformMatrix2fv(loc, false, value);
+ },
+
+ attrib : function(name) {
+ if (this.attribLocations[name] == null) {
+ var loc = this.gl.getAttribLocation(this.shader.program, name);
+ this.attribLocations[name] = loc;
+ }
+ return this.attribLocations[name];
+ },
+
+ uniform : function(name) {
+ if (this.uniformLocations[name] == null) {
+ var loc = this.gl.getUniformLocation(this.shader.program, name);
+ this.uniformLocations[name] = loc;
+ }
+ return this.uniformLocations[name];
+ }
+}
+Filter = function(gl, shader) {
+ Shader.apply(this, arguments);
+}
+Filter.prototype = new Shader();
+Filter.prototype.apply = function(init) {
+ this.use();
+ var va = this.attrib("Vertex");
+ var ta = this.attrib("Tex");
+ var vbo = Quad.getCachedVBO(this.gl);
+ if (init) init(this);
+ vbo.draw(va, null, ta);
+}
+
+
+VBO = function(gl) {
+ this.gl = gl;
+ this.data = [];
+ this.elementsVBO = null;
+ for (var i=1; i<arguments.length; i++) {
+ if (arguments[i].elements)
+ this.elements = arguments[i];
+ else
+ this.data.push(arguments[i]);
+ }
+}
+
+VBO.prototype = {
+ initialized : false,
+ length : 0,
+ vbos : null,
+ type : 'TRIANGLES',
+ elementsVBO : null,
+ elements : null,
+
+ setData : function() {
+ this.destroy();
+ this.data = [];
+ for (var i=0; i<arguments.length; i++) {
+ if (arguments[i].elements)
+ this.elements = arguments[i];
+ else
+ this.data.push(arguments[i]);
+ }
+ },
+
+ destroy : function() {
+ if (this.vbos != null)
+ for (var i=0; i<this.vbos.length; i++)
+ this.gl.deleteBuffer(this.vbos[i]);
+ if (this.elementsVBO != null)
+ this.gl.deleteBuffer(this.elementsVBO);
+ this.length = this.elementsLength = 0;
+ this.vbos = this.elementsVBO = null;
+ this.initialized = false;
+ },
+
+ init : function() {
+ this.destroy();
+ var gl = this.gl;
+
+ gl.getError();
+ var vbos = [];
+ var length = 0;
+ for (var i=0; i<this.data.length; i++)
+ vbos.push(gl.createBuffer());
+ if (this.elements != null)
+ this.elementsVBO = gl.createBuffer();
+ try {
+ throwError(gl, "genBuffers");
+ for (var i = 0; i<this.data.length; i++) {
+ var d = this.data[i];
+ var dlen = Math.floor(d.data.length / d.size);
+ if (i == 0 || dlen < length)
+ length = dlen;
+ if (!d.floatArray)
+ d.floatArray = new Float32Array(d.data);
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbos[i]);
+ throwError(gl, "bindBuffer");
+ gl.bufferData(gl.ARRAY_BUFFER, d.floatArray, gl.STATIC_DRAW);
+ throwError(gl, "bufferData");
+ }
+ if (this.elementsVBO != null) {
+ var d = this.elements;
+ this.elementsLength = d.data.length;
+ this.elementsType = d.type == gl.UNSIGNED_BYTE ? d.type : gl.UNSIGNED_SHORT;
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.elementsVBO);
+ throwError(gl, "bindBuffer ELEMENT_ARRAY_BUFFER");
+ if (this.elementsType == gl.UNSIGNED_SHORT && !d.ushortArray) {
+ d.ushortArray = new Uint16Array(d.data);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, d.ushortArray, gl.STATIC_DRAW);
+ } else if (this.elementsType == gl.UNSIGNED_BYTE && !d.ubyteArray) {
+ d.ubyteArray = new Uint8Array(d.data);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, d.ubyteArray, gl.STATIC_DRAW);
+ }
+ throwError(gl, "bufferData ELEMENT_ARRAY_BUFFER");
+ }
+ } catch(e) {
+ for (var i=0; i<vbos.length; i++)
+ gl.deleteBuffer(vbos[i]);
+ throw(e);
+ }
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+
+ this.length = length;
+ this.vbos = vbos;
+
+ this.initialized = true;
+ },
+
+ use : function() {
+ if (!this.initialized) this.init();
+ var gl = this.gl;
+ for (var i=0; i<arguments.length; i++) {
+ if (arguments[i] == null || arguments[i] == -1) continue;
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vbos[i]);
+ gl.vertexAttribPointer(arguments[i], this.data[i].size, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(arguments[i]);
+ }
+ if (this.elementsVBO != null) {
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.elementsVBO);
+ }
+ },
+
+ draw : function() {
+ var args = [];
+ this.use.apply(this, arguments);
+ var gl = this.gl;
+ if (this.elementsVBO != null) {
+ gl.drawElements(gl[this.type], this.elementsLength, this.elementsType, 0);
+ } else {
+ gl.drawArrays(gl[this.type], 0, this.length);
+ }
+ }
+}
+
+FBO = function(gl, width, height, use_depth) {
+ this.gl = gl;
+ this.width = width;
+ this.height = height;
+ if (use_depth != null)
+ this.useDepth = use_depth;
+}
+FBO.prototype = {
+ initialized : false,
+ useDepth : true,
+ fbo : null,
+ rbo : null,
+ texture : null,
+
+ destroy : function() {
+ if (this.fbo) this.gl.deleteFramebuffer(this.fbo);
+ if (this.rbo) this.gl.deleteRenderbuffer(this.rbo);
+ if (this.texture) this.gl.deleteTexture(this.texture);
+ },
+
+ init : function() {
+ var gl = this.gl;
+ var w = this.width, h = this.height;
+ var fbo = this.fbo != null ? this.fbo : gl.createFramebuffer();
+ var rb;
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ checkError(gl, "FBO.init bindFramebuffer");
+ if (this.useDepth) {
+ rb = this.rbo != null ? this.rbo : gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ checkError(gl, "FBO.init bindRenderbuffer");
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, w, h);
+ checkError(gl, "FBO.init renderbufferStorage");
+ }
+
+ var tex = this.texture != null ? this.texture : gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ try {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, w, h, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ } catch (e) { // argh, no null texture support
+ var tmp = this.getTempCanvas(w,h);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tmp);
+ }
+ 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_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ checkError(gl, "FBO.init tex");
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ checkError(gl, "FBO.init bind tex");
+
+ if (this.useDepth) {
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, rb);
+ checkError(gl, "FBO.init bind depth buffer");
+ }
+
+ var fbstat = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ if (fbstat != gl.FRAMEBUFFER_COMPLETE) {
+ var glv;
+ for (var v in gl) {
+ try { glv = gl[v]; } catch (e) { glv = null; }
+ if (glv == fbstat) { fbstat = v; break; }}
+ log("Framebuffer status: " + fbstat);
+ }
+ checkError(gl, "FBO.init check fbo");
+
+ this.fbo = fbo;
+ this.rbo = rb;
+ this.texture = tex;
+ this.initialized = true;
+ },
+
+ getTempCanvas : function(w, h) {
+ if (!FBO.tempCanvas) {
+ FBO.tempCanvas = document.createElement('canvas');
+ }
+ FBO.tempCanvas.width = w;
+ FBO.tempCanvas.height = h;
+ return FBO.tempCanvas;
+ },
+
+ use : function() {
+ if (!this.initialized) this.init();
+ this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, this.fbo);
+ }
+}
+
+function GLError(err, msg, fileName, lineNumber) {
+ this.message = msg;
+ this.glError = err;
+}
+
+GLError.prototype = new Error();
+
+function makeGLErrorWrapper(gl, fname) {
+ return (function() {
+ try {
+ var rv = gl[fname].apply(gl, arguments);
+ var err = gl.getError();
+ if (err != gl.NO_ERROR) {
+ throw(new GLError(
+ err, "GL error "+getGLErrorAsString(gl, err)+" in "+fname));
+ }
+ return rv;
+ } catch (e) {
+ if (e.glError !== undefined) {
+ throw e;
+ }
+ throw(new Error("Threw " + e.name +
+ " in " + fname + "\n" +
+ e.message + "\n" +
+ arguments.callee.caller));
+ }
+ });
+}
+
+function wrapGLContext(gl) {
+ var wrap = {};
+ for (var i in gl) {
+ try {
+ if (typeof gl[i] == 'function') {
+ wrap[i] = makeGLErrorWrapper(gl, i);
+ } else {
+ wrap[i] = gl[i];
+ }
+ } catch (e) {
+ // log("wrapGLContext: Error accessing " + i);
+ }
+ }
+ wrap.getError = function(){ return gl.getError(); };
+ return wrap;
+}
+
+function getGLContext(canvas) {
+ return canvas.getContext(GL_CONTEXT_ID, {antialias: false});
+}
+
+// Assert that f generates a specific GL error.
+function assertGLError(gl, err, name, f) {
+ if (f == null) { f = name; name = null; }
+ var r = false;
+ var glErr = 0;
+ try { f(); } catch(e) { r=true; glErr = e.glError; }
+ if (glErr !== err) {
+ if (glErr === undefined) {
+ testFailed("assertGLError: UNEXPECTED EXCEPTION", name, f);
+ } else {
+ testFailed("assertGLError: expected: " + getGLErrorAsString(gl, err) +
+ " actual: " + getGLErrorAsString(gl, glErr), name, f);
+ }
+ return false;
+ }
+ return true;
+}
+
+// Assert that f generates a GL error from a list.
+function assertGLErrorIn(gl, expectedErrorList, name, f) {
+ if (f == null) { f = name; name = null; }
+
+ var actualError = 0;
+ try {
+ f();
+ } catch(e) {
+ if ('glError' in e) {
+ actualError = e.glError;
+ } else {
+ testFailed("assertGLError: UNEXPCETED EXCEPTION", name, f);
+ return false;
+ }
+ }
+
+ var expectedErrorStrList = [];
+ var expectedErrorSet = {};
+ for (var i in expectedErrorList) {
+ var cur = expectedErrorList[i];
+ expectedErrorSet[cur] = true;
+ expectedErrorStrList.push(getGLErrorAsString(gl, cur));
+ }
+ var expectedErrorListStr = "[" + expectedErrorStrList.join(", ") + "]";
+
+ if (actualError in expectedErrorSet) {
+ return true;
+ }
+
+ testFailed("assertGLError: expected: " + expectedErrorListStr +
+ " actual: " + getGLErrorAsString(gl, actualError), name, f);
+ return false;
+}
+
+// Assert that f generates some GL error. Used in situations where it's
+// ambigious which of multiple possible errors will be generated.
+function assertSomeGLError(gl, name, f) {
+ if (f == null) { f = name; name = null; }
+ var r = false;
+ var glErr = 0;
+ var err = 0;
+ try { f(); } catch(e) { r=true; glErr = e.glError; }
+ if (glErr === 0) {
+ if (glErr === undefined) {
+ testFailed("assertGLError: UNEXPECTED EXCEPTION", name, f);
+ } else {
+ testFailed("assertGLError: expected: " + getGLErrorAsString(gl, err) +
+ " actual: " + getGLErrorAsString(gl, glErr), name, f);
+ }
+ return false;
+ }
+ return true;
+}
+
+// Assert that f throws an exception but does not generate a GL error.
+function assertThrowNoGLError(gl, name, f) {
+ if (f == null) { f = name; name = null; }
+ var r = false;
+ var glErr = undefined;
+ var exp;
+ try { f(); } catch(e) { r=true; glErr = e.glError; exp = e;}
+ if (!r) {
+ testFailed(
+ "assertThrowNoGLError: should have thrown exception", name, f);
+ return false;
+ } else {
+ if (glErr !== undefined) {
+ testFailed(
+ "assertThrowNoGLError: should be no GL error but generated: " +
+ getGLErrorAsString(gl, glErr), name, f);
+ return false;
+ }
+ }
+ testPassed("assertThrowNoGLError", name, f);
+ return true;
+}
+
+function assertThrows(gl, shouldThrow, info, func) {
+ var didThrow = false;
+ try {
+ func();
+ } catch (e) {
+ var didGLError = (e instanceof GLError);
+ if (!didGLError) {
+ didThrow = true;
+ }
+ }
+
+ var text = shouldThrow ? "Should throw: "
+ : "Should not throw: ";
+ var func = (didThrow == shouldThrow) ? testPassed : testFailed;
+
+ func(text + info);
+}
+
+Quad = {
+ vertices : [
+ -1,-1,0,
+ 1,-1,0,
+ -1,1,0,
+ 1,-1,0,
+ 1,1,0,
+ -1,1,0
+ ],
+ normals : [
+ 0,0,-1,
+ 0,0,-1,
+ 0,0,-1,
+ 0,0,-1,
+ 0,0,-1,
+ 0,0,-1
+ ],
+ texcoords : [
+ 0,0,
+ 1,0,
+ 0,1,
+ 1,0,
+ 1,1,
+ 0,1
+ ],
+ indices : [0,1,2,1,5,2],
+ makeVBO : function(gl) {
+ return new VBO(gl,
+ {size:3, data: Quad.vertices},
+ {size:3, data: Quad.normals},
+ {size:2, data: Quad.texcoords}
+ )
+ },
+ cache: {},
+ getCachedVBO : function(gl) {
+ if (!this.cache[gl])
+ this.cache[gl] = this.makeVBO(gl);
+ return this.cache[gl];
+ }
+}
+Cube = {
+ vertices : [ 0.5, -0.5, 0.5, // +X
+ 0.5, -0.5, -0.5,
+ 0.5, 0.5, -0.5,
+ 0.5, 0.5, 0.5,
+
+ 0.5, 0.5, 0.5, // +Y
+ 0.5, 0.5, -0.5,
+ -0.5, 0.5, -0.5,
+ -0.5, 0.5, 0.5,
+
+ 0.5, 0.5, 0.5, // +Z
+ -0.5, 0.5, 0.5,
+ -0.5, -0.5, 0.5,
+ 0.5, -0.5, 0.5,
+
+ -0.5, -0.5, 0.5, // -X
+ -0.5, 0.5, 0.5,
+ -0.5, 0.5, -0.5,
+ -0.5, -0.5, -0.5,
+
+ -0.5, -0.5, 0.5, // -Y
+ -0.5, -0.5, -0.5,
+ 0.5, -0.5, -0.5,
+ 0.5, -0.5, 0.5,
+
+ -0.5, -0.5, -0.5, // -Z
+ -0.5, 0.5, -0.5,
+ 0.5, 0.5, -0.5,
+ 0.5, -0.5, -0.5,
+ ],
+
+ normals : [ 1, 0, 0,
+ 1, 0, 0,
+ 1, 0, 0,
+ 1, 0, 0,
+
+ 0, 1, 0,
+ 0, 1, 0,
+ 0, 1, 0,
+ 0, 1, 0,
+
+ 0, 0, 1,
+ 0, 0, 1,
+ 0, 0, 1,
+ 0, 0, 1,
+
+ -1, 0, 0,
+ -1, 0, 0,
+ -1, 0, 0,
+ -1, 0, 0,
+
+ 0,-1, 0,
+ 0,-1, 0,
+ 0,-1, 0,
+ 0,-1, 0,
+
+ 0, 0,-1,
+ 0, 0,-1,
+ 0, 0,-1,
+ 0, 0,-1
+ ],
+
+ indices : [],
+ create : function(){
+ for (var i = 0; i < 6; i++) {
+ Cube.indices.push(i*4 + 0);
+ Cube.indices.push(i*4 + 1);
+ Cube.indices.push(i*4 + 3);
+ Cube.indices.push(i*4 + 1);
+ Cube.indices.push(i*4 + 2);
+ Cube.indices.push(i*4 + 3);
+ }
+ },
+
+ makeVBO : function(gl) {
+ return new VBO(gl,
+ {size:3, data: Cube.vertices},
+ {size:3, data: Cube.normals},
+ {elements: true, data: Cube.indices}
+ )
+ },
+ cache : {},
+ getCachedVBO : function(gl) {
+ if (!this.cache[gl])
+ this.cache[gl] = this.makeVBO(gl);
+ return this.cache[gl];
+ }
+}
+Cube.create();
+
+Sphere = {
+ vertices : [],
+ normals : [],
+ indices : [],
+ create : function(){
+ var r = 0.75;
+ function vert(theta, phi)
+ {
+ var r = 0.75;
+ var x, y, z, nx, ny, nz;
+
+ nx = Math.sin(theta) * Math.cos(phi);
+ ny = Math.sin(phi);
+ nz = Math.cos(theta) * Math.cos(phi);
+ Sphere.normals.push(nx);
+ Sphere.normals.push(ny);
+ Sphere.normals.push(nz);
+
+ x = r * Math.sin(theta) * Math.cos(phi);
+ y = r * Math.sin(phi);
+ z = r * Math.cos(theta) * Math.cos(phi);
+ Sphere.vertices.push(x);
+ Sphere.vertices.push(y);
+ Sphere.vertices.push(z);
+ }
+ for (var phi = -Math.PI/2; phi < Math.PI/2; phi += Math.PI/20) {
+ var phi2 = phi + Math.PI/20;
+ for (var theta = -Math.PI/2; theta <= Math.PI/2; theta += Math.PI/20) {
+ vert(theta, phi);
+ vert(theta, phi2);
+ }
+ }
+ }
+}
+
+Sphere.create();
+
+initGL_CONTEXT_ID = function(){
+ var c = document.createElement('canvas');
+ var contextNames = ['webgl', 'experimental-webgl'];
+ GL_CONTEXT_ID = null;
+ for (var i=0; i<contextNames.length; i++) {
+ try {
+ if (c.getContext(contextNames[i])) {
+ GL_CONTEXT_ID = contextNames[i];
+ break;
+ }
+ } catch (e) {
+ }
+ }
+ if (!GL_CONTEXT_ID) {
+ log("No WebGL context found. Unable to run tests.");
+ }
+}
+
+initGL_CONTEXT_ID();
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/00_test_list.txt
new file mode 100644
index 0000000000..8c8154a542
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/00_test_list.txt
@@ -0,0 +1,12 @@
+context-attribute-preserve-drawing-buffer.html
+context-creation.html
+context-creation-worker.html
+context-lost.html
+context-lost-worker.html
+context-lost-restored.html
+context-lost-restored-worker.html
+methods.html
+methods-worker.html
+offscreencanvas-resize.html
+--min-version 1.0.4 offscreencanvas-timer-query.html
+--min-version 1.0.4 offscreencanvas-transfer-image-bitmap.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-attribute-preserve-drawing-buffer.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-attribute-preserve-drawing-buffer.html
new file mode 100644
index 0000000000..d230b69d9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-attribute-preserve-drawing-buffer.html
@@ -0,0 +1,93 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>OffscreenCanavs context attribute preserveDrawingBuffer</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/canvas-tests-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="canvases"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test checks whether OffscreenCanvas webgl context honors the preserveDrawingBuffer flag.");
+const wtu = WebGLTestUtils;
+const pixels = new Uint8Array(4);
+
+function checkPixels(color) {
+ return (color[0] === pixels[0]) &&
+ (color[1] === pixels[1]) &&
+ (color[2] === pixels[2]) &&
+ (color[3] === pixels[3]);
+}
+
+const nextFrame = () => new Promise(r => requestAnimationFrame(r));
+
+async function getPixelsFromOffscreenWebgl(preserveFlag, color, msg) {
+ const canvas = document.createElement("canvas");
+ document.getElementById("canvases").appendChild(canvas);
+ const offscreenCanvas = transferredOffscreenCanvasCreation(canvas, 10, 10);
+ const gl = offscreenCanvas.getContext("webgl", {preserveDrawingBuffer: preserveFlag});
+
+ // Draw some color on gl
+ gl.clearColor(1, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ let t;
+ const t0 = await nextFrame();
+ const timeDuration = preserveFlag ? 500 : 2000;
+ for (;;) {
+ t = await nextFrame();
+
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
+ if (preserveFlag) {
+ if (!checkPixels(color)) {
+ testFailed(msg + '\nexpected: ' + color.toString() + ' was ' + pixels.toString());
+ return;
+ }
+ } else {
+ if (checkPixels(color)) {
+ testPassed(msg);
+ return;
+ }
+ }
+
+ // Keep checking until it takes up to a certain time.
+ // preserveDrawingBuffer:false seems flaky on Chrome's test bots; run that test for longer.
+ if (t > t0 + timeDuration) {
+ break;
+ }
+ }
+
+ if (preserveFlag) {
+ testPassed(msg);
+ } else {
+ testFailed(msg + '\nafter ' + timeDuration + ' ms, expected: ' + color.toString() + ' was ' + pixels.toString());
+ }
+}
+
+(async () => {
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ } else {
+ // Test if OffscreenCanvas.webgl retains contents if preserveDrawingBuffer is true.
+ await getPixelsFromOffscreenWebgl(true, [255,0,255,255], "should be preserved");
+
+ // Test if OffscreenCanvas.webgl loses contents if preserveDrawingBuffer is false.
+ await getPixelsFromOffscreenWebgl(false, [0, 0, 0, 0], "should not be preserved");
+ }
+ finishTest();
+})();
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.html
new file mode 100644
index 0000000000..38b348ae36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Context Creation Test for OffscreenCanvas in a worker</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("This test ensures that the WebGL context can be created on an OffscreenCanvas.");
+
+if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+} else {
+ var worker = new Worker('context-creation-worker.js');
+ worker.postMessage("Start worker");
+ worker.onmessage = function(e) {
+ if (e.data == "Test passed") {
+ testPassed("All tests have passed");
+ } else {
+ testFailed("Some tests failed");
+ }
+ finishTest();
+ }
+}
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.js b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.js
new file mode 100644
index 0000000000..b0d867a1d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation-worker.js
@@ -0,0 +1,13 @@
+/*
+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.
+*/
+
+importScripts("../../js/tests/canvas-tests-utils.js");
+self.onmessage = function(e) {
+ if (contextCreation('webgl'))
+ self.postMessage("Test passed");
+ else
+ self.postMessage("Test failed");
+};
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation.html
new file mode 100644
index 0000000000..73c911b5d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-creation.html
@@ -0,0 +1,37 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Context Creation Test for OffscreenCanvas</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/canvas-tests-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test ensures that the WebGL context can be created on an OffscreenCanvas.");
+
+if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+} else {
+ if (contextCreation('webgl')) {
+ testPassed("WebGL context created correctly.");
+ } else {
+ testFailed("WebGL context creation failed");
+ }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.html
new file mode 100644
index 0000000000..62d6ef60a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.html
@@ -0,0 +1,43 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script>
+function init()
+{
+ description("Tests behavior under a restored context for OffscreenCanvas in a worker.");
+
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+ return;
+ }
+
+ var worker = new Worker('context-lost-restored-worker.js');
+ worker.postMessage("Start worker");
+ worker.onmessage = function(e) {
+ if (e.data == "Test passed") {
+ testPassed("All tests have passed");
+ } else {
+ testFailed("Some test failed");
+ }
+ finishTest();
+ return;
+ }
+}
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.js b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.js
new file mode 100644
index 0000000000..76f59dce7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored-worker.js
@@ -0,0 +1,51 @@
+/*
+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.
+*/
+
+importScripts("../../js/tests/canvas-tests-utils.js");
+self.onmessage = function(e) {
+ if (!setupTest())
+ self.postMessage("Test failed");
+
+ canvas.addEventListener("webglcontextlost", function(e) {
+ if (!testLostContext(e))
+ self.postMessage("Test failed");
+ // restore the context after this event has exited.
+ setTimeout(function() {
+ // we didn't call prevent default so we should not be able to restore the context
+ if (!compareGLError(gl.INVALID_OPERATION, "WEBGL_lose_context.restoreContext()"))
+ self.postMessage("Test failed");
+ testLosingAndRestoringContext().then(function() {
+ self.postMessage("Test passed");
+ }, function() {
+ self.postMessage("Test failed");
+ });
+ }, 0);
+ });
+ canvas.addEventListener("webglcontextrestored", function() {
+ self.postMessage("Test failed");
+ });
+ allowRestore = false;
+ contextLostEventFired = false;
+ contextRestoredEventFired = false;
+
+ if (!testOriginalContext())
+ self.postMessage("Test failed");
+ WEBGL_lose_context.loseContext();
+ // The context should be lost immediately.
+ if (!gl.isContextLost())
+ self.postMessage("Test failed");
+ if (gl.getError() != gl.CONTEXT_LOST_WEBGL)
+ self.postMessage("Test failed");
+ if (gl.getError() != gl.NO_ERROR)
+ self.postMessage("Test failed");
+ // gl methods should be no-ops
+ if (!compareGLError(gl.NO_ERROR, "gl.blendFunc(gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP)"))
+ self.postMessage("Test failed");
+ // but the event should not have been fired.
+ if (contextLostEventFired)
+ self.postMessage("Test failed");
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored.html
new file mode 100644
index 0000000000..28e1878179
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-restored.html
@@ -0,0 +1,88 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/canvas-tests-utils.js"></script>
+<script>
+
+function init()
+{
+ description("Tests behavior under a restored context for OffscreenCanvas.");
+
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+ return;
+ }
+
+ if (!setupTest()) {
+ testFailed("Cannot initialize test");
+ finishTest();
+ return;
+ }
+
+ canvas.addEventListener("webglcontextlost", function(e) {
+ if (!testLostContext(e)) {
+ testFailed("Some test failed");
+ finishTest();
+ return;
+ }
+ // restore the context after this event has exited.
+ setTimeout(function() {
+ // we didn't call prevent default so we should not be able to restore the context
+ if (!compareGLError(gl.INVALID_OPERATION, "WEBGL_lose_context.restoreContext()")) {
+ testFailed("Some test failed");
+ finishTest();
+ return;
+ }
+ testLosingAndRestoringContext().then(function() {
+ testPassed("Test passed");
+ finishTest();
+ return;
+ }, function() {
+ testFailed("Some test failed");
+ finishTest();
+ return;
+ });
+ }, 0);
+ });
+ canvas.addEventListener("webglcontextrestored", function() {
+ testFailed("Some test failed");
+ finishTest();
+ return;
+ });
+ allowRestore = false;
+ contextLostEventFired = false;
+ contextRestoredEventFired = false;
+
+ if (!testOriginalContext()) {
+ testFailed("Some test failed");
+ finishTest();
+ return;
+ }
+ WEBGL_lose_context.loseContext();
+ // The context should be lost immediately.
+ shouldBeTrue("gl.isContextLost()");
+ shouldBe("gl.getError()", "gl.CONTEXT_LOST_WEBGL");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+ // gl methods should be no-ops
+ shouldBeTrue(compareGLError(gl.NO_ERROR, "gl.blendFunc(gl.TEXTURE_2D, gl.TEXTURE_CUBE_MAP)"));
+ // but the event should not have been fired.
+ shouldBeFalse("contextLostEventFired");
+}
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.html
new file mode 100644
index 0000000000..a4846712de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.html
@@ -0,0 +1,43 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script>
+function init()
+{
+ description("Tests behavior under a lost context for OffscreenCanvas in a worker");
+
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+ return;
+ }
+
+ var worker = new Worker('context-lost-worker.js');
+ worker.postMessage("Start worker");
+ worker.onmessage = function(e) {
+ if (e.data == "Test passed") {
+ testPassed("All tests have passed");
+ } else {
+ testFailed("Some tests failed");
+ }
+ finishTest();
+ return;
+ }
+}
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.js b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.js
new file mode 100644
index 0000000000..75cd4b0045
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost-worker.js
@@ -0,0 +1,35 @@
+/*
+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.
+*/
+
+importScripts("../../js/tests/canvas-tests-utils.js");
+self.onmessage = function(e) {
+ canvas = new OffscreenCanvas(10, 10);
+ gl = canvas.getContext('webgl');
+
+ // call testValidContext() before checking for the extension, because this is where we check
+ // for the isContextLost() method, which we want to do regardless of the extension's presence.
+ if (!testValidContext())
+ self.postMessage("Test failed");
+
+ extension = gl.getExtension("WEBGL_lose_context");
+ // need an extension that exposes new API methods.
+ OES_vertex_array_object = gl.getExtension("OES_vertex_array_object");
+ if (extension == null || OES_vertex_array_object == null)
+ self.postMessage("Test failed");
+
+ // We need to initialize |uniformLocation| before losing context.
+ // Otherwise gl.getUniform() when context is lost will throw.
+ uniformLocation = gl.getUniformLocation(program, "tex");
+ extension.loseContext();
+
+ canvas.addEventListener("webglcontextlost", function() {
+ if (testLostContextWithoutRestore())
+ self.postMessage("Test passed");
+ else
+ self.postMessage("Test failed");
+ }, false);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost.html
new file mode 100644
index 0000000000..0568ad229e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/context-lost.html
@@ -0,0 +1,69 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/canvas-tests-utils.js"></script>
+<script>
+function init()
+{
+ description("Tests behavior under a lost context for OffscreenCanvas");
+
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+ return;
+ }
+
+ canvas = new OffscreenCanvas(10, 10);
+ gl = canvas.getContext('webgl');
+
+ // call testValidContext() before checking for the extension, because this is where we check
+ // for the isContextLost() method, which we want to do regardless of the extension's presence.
+ if (!testValidContext()) {
+ testFailed("Some tests failed");
+ finishTest();
+ return;
+ }
+
+ extension = gl.getExtension("WEBGL_lose_context");
+ // need an extension that exposes new API methods.
+ OES_vertex_array_object = gl.getExtension("OES_vertex_array_object");
+ if (extension == null || OES_vertex_array_object == null) {
+ testFailed("Some tests failed");
+ finishTest();
+ return;
+ }
+
+ // We need to initialize |uniformLocation| before losing context.
+ // Otherwise gl.getUniform() when context is lost will throw.
+ uniformLocation = gl.getUniformLocation(program, "tex");
+ extension.loseContext();
+
+ canvas.addEventListener("webglcontextlost", function() {
+ if (testLostContextWithoutRestore()) {
+ testPassed("All tests passed");
+ finishTest();
+ return;
+ } else {
+ testFailed("Some tests failed");
+ finishTest();
+ return;
+ }
+ }, false);
+}
+
+</script>
+</head>
+<body onload="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.html
new file mode 100644
index 0000000000..929474c9b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Methods Test for OffscreenCanvas in a worker</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("This test ensures that the WebGL context created for an OffscreenCanvas has all the methods in the specification.");
+
+if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+} else {
+ var worker = new Worker("methods-worker.js");
+ worker.postMessage("Start worker");
+ worker.onmessage = function(e) {
+ if (e.data == "Test passed") {
+ testPassed("All tests have passed");
+ } else {
+ testFailed("Some tests failed");
+ }
+ finishTest();
+ }
+}
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.js b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.js
new file mode 100644
index 0000000000..154cac7fc6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods-worker.js
@@ -0,0 +1,13 @@
+/*
+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.
+*/
+
+importScripts("../../js/tests/canvas-tests-utils.js");
+self.onmessage = function(e) {
+ if (testAPIs('webgl'))
+ self.postMessage("Test passed");
+ else
+ self.postMessage("Test failed");
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods.html
new file mode 100644
index 0000000000..9129e76cfc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/methods.html
@@ -0,0 +1,36 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Methods Test for OffscreenCanvas</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/canvas-tests-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+description("This test ensures that the WebGL context created for an OffscreenCanvas has all the methods in the specification.");
+
+if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+} else {
+ if (testAPIs('webgl')) {
+ testPassed("All WebGL methods found");
+ } else {
+ testFailed("Some WebGL methods not found");
+ }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-resize.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-resize.html
new file mode 100644
index 0000000000..21107bba53
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-resize.html
@@ -0,0 +1,93 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Resizing Test for OffscreenCanvas commit()</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/canvas-tests-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test ensures that the OffscreenCanvas context returns the correct image size after resizing and calling commit().");
+
+function testResizeOnNewOffscreenCanvas() {
+ var canvas = new OffscreenCanvas(10, 20);
+ canvas.getContext("webgl");
+ canvas.width = 30;
+ canvas.height = 40;
+ assertWidthAndHeight(canvas, "canvas", 30, 40);
+ var imagebitmap = canvas.transferToImageBitmap();
+ assertWidthAndHeight(imagebitmap, "imagebitmap", 30, 40);
+}
+
+function testResizeOnTransferredOffscreenCanvas() {
+ var placeholder = document.createElement("canvas");
+ var offscreencanvas = transferredOffscreenCanvasCreation(placeholder, 10, 20);
+ var ctx = offscreencanvas.getContext("webgl");
+
+ // Verify that setting the size of an OffscreenCanvas that has a placeholder works.
+ offscreencanvas.width = 30;
+ offscreencanvas.height = 40;
+ assertWidthAndHeight(offscreencanvas, "resized offscreencanvas", 30, 40);
+ var imagebitmap = offscreencanvas.transferToImageBitmap();
+ assertWidthAndHeight(imagebitmap, "imagebitmap transferred from resized offscreencanvas" , 30, 40);
+
+ // Verify that setting the size of an OffscreenCanvas does not directly update the size of its placeholder canvas.
+ assertWidthAndHeight(placeholder, "placeholder canvas", 10, 20);
+
+ var asyncStepsCompleted = 0;
+ ctx.commit();
+ createImageBitmap(placeholder).then(image => {
+ // Verify that the placeholder was not updated synchronously.
+ assertWidthAndHeight(image, "imagebitmap from placeholder canvas", 10, 20);
+ asyncStepsCompleted++;
+ if (asyncStepsCompleted == 2) {
+ finishTest();
+ }
+ });
+
+ // Set timeout acts as a sync barrier to allow commit to propagate
+ setTimeout(function() {
+ // Verify that commit() asynchronously updates the size of its placeholder canvas.
+ assertWidthAndHeight(placeholder, "placeholder canvas", 30, 40);
+
+ // Verify that width/height attributes are not settable
+ shouldThrow("placeholder.width = 50");
+ shouldThrow("placeholder.height = 60");
+
+ assertWidthAndHeight(placeholder, "placeholder canvas after size reset", 30, 40);
+
+ createImageBitmap(placeholder).then(image => {
+ // Verify that an image grabbed from the placeholder has the correct dimensions
+ assertWidthAndHeight(image, "imagebitmap from placeholder canvas", 30, 40);
+ asyncStepsCompleted++;
+ if (asyncStepsCompleted == 2) {
+ finishTest();
+ }
+ });
+ }, 0);
+}
+
+if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+} else if (!new OffscreenCanvas(10, 20).getContext("webgl").commit) {
+ testPassed("commit() not supported");
+ finishTest();
+} else {
+ testResizeOnNewOffscreenCanvas();
+ testResizeOnTransferredOffscreenCanvas();
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-timer-query.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-timer-query.html
new file mode 100644
index 0000000000..0d32f14c19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-timer-query.html
@@ -0,0 +1,84 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test for Timer Query objects with OffscreenCanvas</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+ <div id="description"></div>
+ <div id="console"></div>
+ <script id='myWorker' type='text/worker'>
+ function tick(callback) {
+ function tickImpl() {
+ const res = callback();
+ if (res) {
+ if (requestAnimationFrame) {
+ requestAnimationFrame(tickImpl);
+ } else {
+ setTimeout(tickImpl, 10);
+ }
+ }
+ }
+
+ tickImpl();
+ }
+
+ self.onmessage = function(e) {
+ let canvas = new OffscreenCanvas(128, 128);
+ let gl = canvas.getContext("webgl");
+ let ext = gl.getExtension("EXT_disjoint_timer_query");
+ if (!ext) {
+ self.postMessage("PASSED - no EXT_disjoint_timer_query extension - this is legal");
+ return false;
+ }
+ let query = ext.createQueryEXT();
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
+ ext.endQueryEXT(ext.TIME_ELAPSED_EXT);
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ tick(function() {
+ const status = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);
+ if (status) {
+ self.postMessage("PASSED - timer query object completed successfully on worker");
+ return false;
+ } else {
+ const err = gl.getError();
+ if (err != 0) {
+ self.postMessage("FAILED - GL error " + err);
+ return false;
+ }
+ }
+ return true;
+ });
+ };
+ </script>
+ <script>
+ "use strict";
+ description("This test ensures that timer query objects work with the WebGL 1.0 context created via OffscreenCanvas.");
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+ } else {
+ var blob = new Blob([document.getElementById('myWorker').textContent]);
+ var worker = new Worker(URL.createObjectURL(blob));
+ worker.onmessage = function(msg) {
+ if (msg.data.startsWith("PASSED")) {
+ testPassed(msg.data);
+ } else {
+ testFailed(msg.data);
+ }
+ finishTest();
+ }
+ worker.postMessage("Start Worker");
+ }
+ </script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-transfer-image-bitmap.html b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-transfer-image-bitmap.html
new file mode 100644
index 0000000000..70b359216b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/offscreencanvas/offscreencanvas-transfer-image-bitmap.html
@@ -0,0 +1,50 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test for OffscreenCanvas TransferToImageBitmap</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../js/tests/offscreencanvas-transfer-image-bitmap.js"></script>
+</head>
+<body>
+ <div id="description"></div>
+ <div id="console"></div>
+ <script id='myWorker' type='text/worker'>
+ self.onmessage = function(e) {
+ var canvas = new OffscreenCanvas(128, 128);
+ var gl = canvas.getContext("webgl");
+ gl.clearColor(1.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var image = canvas.transferToImageBitmap();
+
+ self.postMessage({ bitmap: image },
+ [ image ]);
+ };
+ </script>
+ <script>
+ "use strict";
+ description("This test ensures that the transferToImageBitmap function of OffscreenCanvas webgl context is functional.");
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+ } else {
+ var blob = new Blob([document.getElementById('myWorker').textContent]);
+ var worker = new Worker(URL.createObjectURL(blob));
+
+ worker.onmessage = function(msg) {
+ testTransferToImageBitmap("webgl", msg.data.bitmap);
+ finishTest();
+ }
+ worker.postMessage("Start Worker");
+ }
+ </script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/00_test_list.txt
new file mode 100644
index 0000000000..4b4237c9fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/00_test_list.txt
@@ -0,0 +1,2 @@
+mustpass.run.txt
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_001_to_006.html
new file mode 100644
index 0000000000..b6578ff3de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: abs_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "abs_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "abs_float_frag_xvary.frag"
+ },
+ "name": "abs_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "abs_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "abs_vec2_frag_xvary.frag"
+ },
+ "name": "abs_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "abs_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "abs_vec3_frag_xvary.frag"
+ },
+ "name": "abs_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "abs_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "abs_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "abs_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "abs_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "abs_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "abs_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "abs_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "abs_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "abs_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag
new file mode 100644
index 0000000000..23aee9561c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(abs(c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..604d0e86b0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_frag_xvary_ref.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (color.r - 0.5);
+ if(c < 0.0) c *= -1.0;
+
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert
new file mode 100644
index 0000000000..48d51ed05a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(abs(c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..71d1543400
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_float_vert_xvary_ref.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ if(c < 0.0) c *= -1.0;
+
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..ccb594c0e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(abs(c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..b0bbc5ec9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_frag_xvary_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (color.rg - 0.5);
+ if((c[0] < 0.0)) c[0] *= -1.0;
+ if((c[1] < 0.0)) c[1] *= -1.0;
+
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..9845381038
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(abs(c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..f2b3ba0b3e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec2_vert_xvary_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ if((c[0] < 0.0)) c[0] *= -1.0;
+ if((c[1] < 0.0)) c[1] *= -1.0;
+
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..5014c6045c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(abs(c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..6a587accb8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_frag_xvary_ref.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ if((c[0] < 0.0)) c[0] *= -1.0;
+ if((c[1] < 0.0)) c[1] *= -1.0;
+ if((c[2] < 0.0)) c[2] *= -1.0;
+
+
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..7a64d4efda
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(abs(c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..db5eb81863
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/abs_vec3_vert_xvary_ref.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ if((c[0] < 0.0)) c[0] *= -1.0;
+ if((c[1] < 0.0)) c[1] *= -1.0;
+ if((c[2] < 0.0)) c[2] *= -1.0;
+
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt
new file mode 100644
index 0000000000..ebf5dc91f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/abs/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+abs_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html
new file mode 100644
index 0000000000..3fae3212ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: acos_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "acos_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "acos_float_frag_xvary.frag"
+ },
+ "name": "acos_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "acos_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "acos_vec2_frag_xvary.frag"
+ },
+ "name": "acos_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "acos_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "acos_vec3_frag_xvary.frag"
+ },
+ "name": "acos_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "acos_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "acos_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "acos_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "acos_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "acos_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "acos_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "acos_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "acos_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "acos_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag
new file mode 100644
index 0000000000..db65737072
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(acos(c) / M_PI, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..3be16e453b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_frag_xvary_ref.frag
@@ -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.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_float_frag_xvary_ref.frag
+ * GL/asin/asin_float_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (color.r - 0.5);
+
+ float arrVal = (c + 1.0) * 8.0;
+ int arr0 = int(floor(arrVal));
+ float weight = arrVal - floor(arrVal);
+ float asin_c = 0.0;
+
+ if (arr0 == 0)
+ asin_c = lerp(asinValues[0], asinValues[1], weight);
+ else if (arr0 == 1)
+ asin_c = lerp(asinValues[1], asinValues[2], weight);
+ else if (arr0 == 2)
+ asin_c = lerp(asinValues[2], asinValues[3], weight);
+ else if (arr0 == 3)
+ asin_c = lerp(asinValues[3], asinValues[4], weight);
+ else if (arr0 == 4)
+ asin_c = lerp(asinValues[4], asinValues[5], weight);
+ else if (arr0 == 5)
+ asin_c = lerp(asinValues[5], asinValues[6], weight);
+ else if (arr0 == 6)
+ asin_c = lerp(asinValues[6], asinValues[7], weight);
+ else if (arr0 == 7)
+ asin_c = lerp(asinValues[7], asinValues[8], weight);
+ else if (arr0 == 8)
+ asin_c = lerp(asinValues[8], asinValues[9], weight);
+ else if (arr0 == 9)
+ asin_c = lerp(asinValues[9], asinValues[10], weight);
+ else if (arr0 == 10)
+ asin_c = lerp(asinValues[10], asinValues[11], weight);
+ else if (arr0 == 11)
+ asin_c = lerp(asinValues[11], asinValues[12], weight);
+ else if (arr0 == 12)
+ asin_c = lerp(asinValues[12], asinValues[13], weight);
+ else if (arr0 == 13)
+ asin_c = lerp(asinValues[13], asinValues[14], weight);
+ else if (arr0 == 14)
+ asin_c = lerp(asinValues[14], asinValues[15], weight);
+ else if (arr0 == 15)
+ asin_c = lerp(asinValues[15], asinValues[16], weight);
+ else if (arr0 == 16)
+ asin_c = asinValues[16];
+
+ // acos(x) = PI/2 - asin(x)
+ gl_FragColor = vec4(0.5 - asin_c / M_PI, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert
new file mode 100644
index 0000000000..57391c206a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(acos(c) / M_PI, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..a18618539f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_float_vert_xvary_ref.vert
@@ -0,0 +1,41 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (gtf_Color.r - 0.5);
+
+ float acos_c = 0.0;
+ float scale = 1.0;
+ float sign = 1.0;
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c < 0.0)
+ {
+ sign = -1.0;
+ c *= -1.0;
+ }
+
+ // Taylors series expansion for acos
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ acos_c += scale * pow(c, float(i)) / float(i);
+ scale *= float(i) / float(i + 1);
+ }
+ acos_c = M_PI / 2.0 - sign * acos_c;
+
+ color = vec4(acos_c / M_PI, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..603435cc60
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(acos(c) / M_PI, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..273f1a01a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_frag_xvary_ref.frag
@@ -0,0 +1,130 @@
+
+/*
+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.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_vec2_frag_xvary_ref.frag
+ * GL/asin/asin_vec2_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (color.rg - 0.5);
+
+ vec2 arrVal = (c + vec2(1.0, 1.0)) * 8.0;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ vec2 weight = arrVal - floor(arrVal);
+ vec2 asin_c = vec2(0.0);
+
+ if (arr0x == 0)
+ asin_c.x = lerp(asinValues[0], asinValues[1], weight.x);
+ else if (arr0x == 1)
+ asin_c.x = lerp(asinValues[1], asinValues[2], weight.x);
+ else if (arr0x == 2)
+ asin_c.x = lerp(asinValues[2], asinValues[3], weight.x);
+ else if (arr0x == 3)
+ asin_c.x = lerp(asinValues[3], asinValues[4], weight.x);
+ else if (arr0x == 4)
+ asin_c.x = lerp(asinValues[4], asinValues[5], weight.x);
+ else if (arr0x == 5)
+ asin_c.x = lerp(asinValues[5], asinValues[6], weight.x);
+ else if (arr0x == 6)
+ asin_c.x = lerp(asinValues[6], asinValues[7], weight.x);
+ else if (arr0x == 7)
+ asin_c.x = lerp(asinValues[7], asinValues[8], weight.x);
+ else if (arr0x == 8)
+ asin_c.x = lerp(asinValues[8], asinValues[9], weight.x);
+ else if (arr0x == 9)
+ asin_c.x = lerp(asinValues[9], asinValues[10], weight.x);
+ else if (arr0x == 10)
+ asin_c.x = lerp(asinValues[10], asinValues[11], weight.x);
+ else if (arr0x == 11)
+ asin_c.x = lerp(asinValues[11], asinValues[12], weight.x);
+ else if (arr0x == 12)
+ asin_c.x = lerp(asinValues[12], asinValues[13], weight.x);
+ else if (arr0x == 13)
+ asin_c.x = lerp(asinValues[13], asinValues[14], weight.x);
+ else if (arr0x == 14)
+ asin_c.x = lerp(asinValues[14], asinValues[15], weight.x);
+ else if (arr0x == 15)
+ asin_c.x = lerp(asinValues[15], asinValues[16], weight.x);
+ else if (arr0x == 16)
+ asin_c.x = asinValues[16];
+
+ if (arr0y == 0)
+ asin_c.y = lerp(asinValues[0], asinValues[1], weight.y);
+ else if (arr0y == 1)
+ asin_c.y = lerp(asinValues[1], asinValues[2], weight.y);
+ else if (arr0y == 2)
+ asin_c.y = lerp(asinValues[2], asinValues[3], weight.y);
+ else if (arr0y == 3)
+ asin_c.y = lerp(asinValues[3], asinValues[4], weight.y);
+ else if (arr0y == 4)
+ asin_c.y = lerp(asinValues[4], asinValues[5], weight.y);
+ else if (arr0y == 5)
+ asin_c.y = lerp(asinValues[5], asinValues[6], weight.y);
+ else if (arr0y == 6)
+ asin_c.y = lerp(asinValues[6], asinValues[7], weight.y);
+ else if (arr0y == 7)
+ asin_c.y = lerp(asinValues[7], asinValues[8], weight.y);
+ else if (arr0y == 8)
+ asin_c.y = lerp(asinValues[8], asinValues[9], weight.y);
+ else if (arr0y == 9)
+ asin_c.y = lerp(asinValues[9], asinValues[10], weight.y);
+ else if (arr0y == 10)
+ asin_c.y = lerp(asinValues[10], asinValues[11], weight.y);
+ else if (arr0y == 11)
+ asin_c.y = lerp(asinValues[11], asinValues[12], weight.y);
+ else if (arr0y == 12)
+ asin_c.y = lerp(asinValues[12], asinValues[13], weight.y);
+ else if (arr0y == 13)
+ asin_c.y = lerp(asinValues[13], asinValues[14], weight.y);
+ else if (arr0y == 14)
+ asin_c.y = lerp(asinValues[14], asinValues[15], weight.y);
+ else if (arr0y == 15)
+ asin_c.y = lerp(asinValues[15], asinValues[16], weight.y);
+ else if (arr0y == 16)
+ asin_c.y = asinValues[16];
+
+ // acos(x) = PI/2 - asin(x)
+ gl_FragColor = vec4(0.5 - asin_c / M_PI, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..9496225fc8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(acos(c) / M_PI, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..3afa0be392
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec2_vert_xvary_ref.vert
@@ -0,0 +1,56 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ vec2 acos_c = vec2(0.0);
+ vec2 scale = vec2(1.0);
+ vec2 sign = vec2(1.0);
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.r < 0.0)
+ {
+ sign.r = -1.0;
+ c.r *= -1.0;
+ }
+
+ // Taylors series expansion for acos
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ acos_c.r += scale.r * pow(c.r, float(i)) / float(i);
+ scale.r *= float(i) / float(i + 1);
+ }
+ acos_c.r = M_PI / 2.0 - sign.r * acos_c.r;
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.g < 0.0)
+ {
+ sign.g = -1.0;
+ c.g *= -1.0;
+ }
+
+ // Taylors series expansion for acos
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ acos_c.g += scale.g * pow(c.g, float(i)) / float(i);
+ scale.g *= float(i) / float(i + 1);
+ }
+ acos_c.g = M_PI / 2.0 - sign.g * acos_c.g;
+
+ color = vec4(acos_c / M_PI, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..a39f0a5c7a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(acos(c) / M_PI, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..5d1b390f72
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_frag_xvary_ref.frag
@@ -0,0 +1,166 @@
+
+/*
+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.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_vec3_frag_xvary_ref.frag
+ * GL/asin/asin_vec3_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (color.rgb - 0.5);
+
+ vec3 arrVal = (c + vec3(1.0, 1.0, 1.0)) * 8.0;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ int arr0z = int(floor(arrVal.z));
+ vec3 weight = arrVal - floor(arrVal);
+ vec3 asin_c = vec3(0.0);
+
+ if (arr0x == 0)
+ asin_c.x = lerp(asinValues[0], asinValues[1], weight.x);
+ else if (arr0x == 1)
+ asin_c.x = lerp(asinValues[1], asinValues[2], weight.x);
+ else if (arr0x == 2)
+ asin_c.x = lerp(asinValues[2], asinValues[3], weight.x);
+ else if (arr0x == 3)
+ asin_c.x = lerp(asinValues[3], asinValues[4], weight.x);
+ else if (arr0x == 4)
+ asin_c.x = lerp(asinValues[4], asinValues[5], weight.x);
+ else if (arr0x == 5)
+ asin_c.x = lerp(asinValues[5], asinValues[6], weight.x);
+ else if (arr0x == 6)
+ asin_c.x = lerp(asinValues[6], asinValues[7], weight.x);
+ else if (arr0x == 7)
+ asin_c.x = lerp(asinValues[7], asinValues[8], weight.x);
+ else if (arr0x == 8)
+ asin_c.x = lerp(asinValues[8], asinValues[9], weight.x);
+ else if (arr0x == 9)
+ asin_c.x = lerp(asinValues[9], asinValues[10], weight.x);
+ else if (arr0x == 10)
+ asin_c.x = lerp(asinValues[10], asinValues[11], weight.x);
+ else if (arr0x == 11)
+ asin_c.x = lerp(asinValues[11], asinValues[12], weight.x);
+ else if (arr0x == 12)
+ asin_c.x = lerp(asinValues[12], asinValues[13], weight.x);
+ else if (arr0x == 13)
+ asin_c.x = lerp(asinValues[13], asinValues[14], weight.x);
+ else if (arr0x == 14)
+ asin_c.x = lerp(asinValues[14], asinValues[15], weight.x);
+ else if (arr0x == 15)
+ asin_c.x = lerp(asinValues[15], asinValues[16], weight.x);
+ else if (arr0x == 16)
+ asin_c.x = asinValues[16];
+
+ if (arr0y == 0)
+ asin_c.y = lerp(asinValues[0], asinValues[1], weight.y);
+ else if (arr0y == 1)
+ asin_c.y = lerp(asinValues[1], asinValues[2], weight.y);
+ else if (arr0y == 2)
+ asin_c.y = lerp(asinValues[2], asinValues[3], weight.y);
+ else if (arr0y == 3)
+ asin_c.y = lerp(asinValues[3], asinValues[4], weight.y);
+ else if (arr0y == 4)
+ asin_c.y = lerp(asinValues[4], asinValues[5], weight.y);
+ else if (arr0y == 5)
+ asin_c.y = lerp(asinValues[5], asinValues[6], weight.y);
+ else if (arr0y == 6)
+ asin_c.y = lerp(asinValues[6], asinValues[7], weight.y);
+ else if (arr0y == 7)
+ asin_c.y = lerp(asinValues[7], asinValues[8], weight.y);
+ else if (arr0y == 8)
+ asin_c.y = lerp(asinValues[8], asinValues[9], weight.y);
+ else if (arr0y == 9)
+ asin_c.y = lerp(asinValues[9], asinValues[10], weight.y);
+ else if (arr0y == 10)
+ asin_c.y = lerp(asinValues[10], asinValues[11], weight.y);
+ else if (arr0y == 11)
+ asin_c.y = lerp(asinValues[11], asinValues[12], weight.y);
+ else if (arr0y == 12)
+ asin_c.y = lerp(asinValues[12], asinValues[13], weight.y);
+ else if (arr0y == 13)
+ asin_c.y = lerp(asinValues[13], asinValues[14], weight.y);
+ else if (arr0y == 14)
+ asin_c.y = lerp(asinValues[14], asinValues[15], weight.y);
+ else if (arr0y == 15)
+ asin_c.y = lerp(asinValues[15], asinValues[16], weight.y);
+ else if (arr0y == 16)
+ asin_c.y = asinValues[16];
+
+ if (arr0z == 0)
+ asin_c.z = lerp(asinValues[0], asinValues[1], weight.z);
+ else if (arr0z == 1)
+ asin_c.z = lerp(asinValues[1], asinValues[2], weight.z);
+ else if (arr0z == 2)
+ asin_c.z = lerp(asinValues[2], asinValues[3], weight.z);
+ else if (arr0z == 3)
+ asin_c.z = lerp(asinValues[3], asinValues[4], weight.z);
+ else if (arr0z == 4)
+ asin_c.z = lerp(asinValues[4], asinValues[5], weight.z);
+ else if (arr0z == 5)
+ asin_c.z = lerp(asinValues[5], asinValues[6], weight.z);
+ else if (arr0z == 6)
+ asin_c.z = lerp(asinValues[6], asinValues[7], weight.z);
+ else if (arr0z == 7)
+ asin_c.z = lerp(asinValues[7], asinValues[8], weight.z);
+ else if (arr0z == 8)
+ asin_c.z = lerp(asinValues[8], asinValues[9], weight.z);
+ else if (arr0z == 9)
+ asin_c.z = lerp(asinValues[9], asinValues[10], weight.z);
+ else if (arr0z == 10)
+ asin_c.z = lerp(asinValues[10], asinValues[11], weight.z);
+ else if (arr0z == 11)
+ asin_c.z = lerp(asinValues[11], asinValues[12], weight.z);
+ else if (arr0z == 12)
+ asin_c.z = lerp(asinValues[12], asinValues[13], weight.z);
+ else if (arr0z == 13)
+ asin_c.z = lerp(asinValues[13], asinValues[14], weight.z);
+ else if (arr0z == 14)
+ asin_c.z = lerp(asinValues[14], asinValues[15], weight.z);
+ else if (arr0z == 15)
+ asin_c.z = lerp(asinValues[15], asinValues[16], weight.z);
+ else if (arr0z == 16)
+ asin_c.z = asinValues[16];
+
+ // acos(x) = PI/2 - asin(x)
+ gl_FragColor = vec4(0.5 - asin_c / M_PI, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..5a37ca2c2d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(acos(c) / M_PI, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..37ace0f04f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/acos_vec3_vert_xvary_ref.vert
@@ -0,0 +1,72 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 acos_c = vec3(0.0);
+ vec3 scale = vec3(1.0);
+ vec3 sign = vec3(1.0);
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.r < 0.0)
+ {
+ sign.r = -1.0;
+ c.r *= -1.0;
+ }
+
+ // Taylors series expansion for acos
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ acos_c.r += scale.r * pow(c.r, float(i)) / float(i);
+ scale.r *= float(i) / float(i + 1);
+ }
+ acos_c.r = M_PI / 2.0 - sign.r * acos_c.r;
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.g < 0.0)
+ {
+ sign.g = -1.0;
+ c.g *= -1.0;
+ }
+
+ // Taylors series expansion for acos
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ acos_c.g += scale.g * pow(c.g, float(i)) / float(i);
+ scale.g *= float(i) / float(i + 1);
+ }
+ acos_c.g = M_PI / 2.0 - sign.g * acos_c.g;
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.b < 0.0)
+ {
+ sign.b = -1.0;
+ c.b *= -1.0;
+ }
+
+ // Taylors series expansion for acos
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ acos_c.b += scale.b * pow(c.b, float(i)) / float(i);
+ scale.b *= float(i) / float(i + 1);
+ }
+ acos_c.b = M_PI / 2.0 - sign.b * acos_c.b;
+
+ color = vec4(acos_c / M_PI, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt
new file mode 100644
index 0000000000..fc7eedaa08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/acos/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+acos_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html
new file mode 100644
index 0000000000..eb28d05620
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_001_to_004.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: all_001_to_004.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "all_bvec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "all_bvec2_frag.frag"
+ },
+ "name": "all_bvec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "all_bvec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "all_bvec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "all_bvec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "all_bvec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "all_bvec3_frag.frag"
+ },
+ "name": "all_bvec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "all_bvec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "all_bvec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "all_bvec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag
new file mode 100644
index 0000000000..43fe86a165
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(4.0 * color.rg); // 3/4 true, 1/4 false
+ gl_FragColor = vec4(vec3(all(bvec2(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag
new file mode 100644
index 0000000000..c9ff27bbb7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_frag_ref.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bool _all(in bvec2 a)
+{
+ bool temp = true;
+
+ if(!a[0]) temp = false;
+ if(!a[1]) temp = false;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec2 c = floor(4.0 * color.rg); // 3/4 true, 1/4 false
+ gl_FragColor = vec4(vec3(_all(bvec2(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert
new file mode 100644
index 0000000000..f22e037838
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(4.0 * gtf_Color.rg); // 3/4 true, 1/4 false
+ color = vec4(vec3(all(bvec2(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert
new file mode 100644
index 0000000000..5afd6a1a3a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec2_vert_ref.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bool _all(in bvec2 a)
+{
+ bool temp = true;
+
+ if(!a[0]) temp = false;
+ if(!a[1]) temp = false;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec2 c = floor(4.0 * gtf_Color.rg); // 3/4 true, 1/4 false
+ color = vec4(vec3(_all(bvec2(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag
new file mode 100644
index 0000000000..fdf6a0282f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(4.0 * color.rgb); // 3/4 true, 1/4 false
+ gl_FragColor = vec4(vec3(all(bvec3(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag
new file mode 100644
index 0000000000..dcb638186d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bool _all(in bvec3 a)
+{
+ bool temp = true;
+
+ if(!a[0]) temp = false;
+ if(!a[1]) temp = false;
+ if(!a[2]) temp = false;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec3 c = floor(4.0 * color.rgb); // 3/4 true, 1/4 false
+ gl_FragColor = vec4(vec3(_all(bvec3(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert
new file mode 100644
index 0000000000..76ce8c0d9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(4.0 * gtf_Color.rgb); // 3/4 true, 1/4 false
+ color = vec4(vec3(all(bvec3(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert
new file mode 100644
index 0000000000..ebe83eec91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/all_bvec3_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bool _all(in bvec3 a)
+{
+ bool temp = true;
+
+ if(!a[0]) temp = false;
+ if(!a[1]) temp = false;
+ if(!a[2]) temp = false;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec3 c = floor(4.0 * gtf_Color.rgb); // 3/4 true, 1/4 false
+ color = vec4(vec3(_all(bvec3(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt
new file mode 100644
index 0000000000..420ac35bcd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/all/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+all_001_to_004.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html
new file mode 100644
index 0000000000..094b97911d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_001_to_004.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: any_001_to_004.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "any_bvec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "any_bvec2_frag.frag"
+ },
+ "name": "any_bvec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "any_bvec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "any_bvec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "any_bvec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "any_bvec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "any_bvec3_frag.frag"
+ },
+ "name": "any_bvec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "any_bvec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "any_bvec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "any_bvec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag
new file mode 100644
index 0000000000..23648e5321
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec3(any(bvec2(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag
new file mode 100644
index 0000000000..7023c98dff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_frag_ref.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bool _any(in bvec2 a)
+{
+ bool temp = false;
+
+ if(a[0]) temp = true;
+ if(a[1]) temp = true;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec3(_any(bvec2(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert
new file mode 100644
index 0000000000..669877792c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ color = vec4(vec3(any(bvec2(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert
new file mode 100644
index 0000000000..a14c4c6a29
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec2_vert_ref.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bool _any(in bvec2 a)
+{
+ bool temp = false;
+
+ if(a[0]) temp = true;
+ if(a[1]) temp = true;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ color = vec4(vec3(_any(bvec2(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag
new file mode 100644
index 0000000000..d4859d7db9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec3(any(bvec3(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag
new file mode 100644
index 0000000000..29b07f520f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bool _any(in bvec3 a)
+{
+ bool temp = false;
+
+ if(a[0]) temp = true;
+ if(a[1]) temp = true;
+ if(a[2]) temp = true;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec3(_any(bvec3(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert
new file mode 100644
index 0000000000..6ba4e5fb85
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ color = vec4(vec3(any(bvec3(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert
new file mode 100644
index 0000000000..283c100d60
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/any_bvec3_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bool _any(in bvec3 a)
+{
+ bool temp = false;
+
+ if(a[0]) temp = true;
+ if(a[1]) temp = true;
+ if(a[2]) temp = true;
+
+ return temp;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ color = vec4(vec3(_any(bvec3(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt
new file mode 100644
index 0000000000..6ac4240676
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/any/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+any_001_to_004.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html
new file mode 100644
index 0000000000..2439fd7a61
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/array_001_to_006.html
@@ -0,0 +1,201 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: array_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "new_mad2": {
+ "count": 2,
+ "type": "uniform1fv",
+ "value": [
+ 45.0,
+ 14.0
+ ]
+ }
+ },
+ "fragmentShader": "empty_uniform_array_float_frag.frag"
+ },
+ "name": "empty_uniform_array_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "empty_uniform_array_float_vert.vert",
+ "uniforms": {
+ "new_mad2": {
+ "count": 2,
+ "type": "uniform1fv",
+ "value": [
+ 45.0,
+ 14.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "empty_uniform_array_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "empty_empty_array_float_frag.frag"
+ },
+ "name": "empty_empty_array_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "empty_empty_array_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "empty_empty_array_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "initfunc_empty_array_float_frag.frag"
+ },
+ "name": "initfunc_empty_array_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "initfunc_empty_array_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "initfunc_empty_array_float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag
new file mode 100644
index 0000000000..0210ea7c15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_frag.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int i=0;
+ float new_mad[2];
+ float gray = 0.0;
+
+ new_mad[0]=float(1);
+ new_mad[1]=float(2);
+
+ if( (new_mad[0] == 1.0) && (new_mad[1] == 2.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray,gray , gray, 1.0);
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert
new file mode 100644
index 0000000000..f5f9741dfc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_empty_array_float_vert.vert
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int i=0;
+ float new_mad[2];
+ float gray = 0.0;
+
+ new_mad[0]=float(1);
+ new_mad[1]=float(2);
+
+ if( (new_mad[0] == 1.0) && (new_mad[1] == 2.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag
new file mode 100644
index 0000000000..8960e06733
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_frag.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+uniform float new_mad2[2];
+
+void main (void)
+{
+ int i=0;
+ float new_mad[2];
+ float gray = 0.0;
+
+ new_mad[0]=new_mad2[0];
+ new_mad[1]=new_mad2[1];
+
+ if( (new_mad[0] == 45.0) && (new_mad[1] == 14.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert
new file mode 100644
index 0000000000..b81eea7f1f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/empty_uniform_array_float_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+const int array_size = 2;
+uniform float new_mad2[array_size];
+
+void main (void)
+{
+ int i=0;
+ float new_mad[array_size];
+ float gray = 0.0;
+
+ new_mad[0] = new_mad2[0];
+ new_mad[1] = new_mad2[1];
+
+ if( (new_mad[0] == 45.0) && (new_mad[1] == 14.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag
new file mode 100644
index 0000000000..93fc911ae9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_frag.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+
+void initialise_array(out float array[2], float init_val);
+void main (void)
+{
+ int i=0;
+ float new_mad[2];
+ float gray = 0.0;
+ initialise_array(new_mad,25.0);
+ if( (new_mad[0] == 25.0) && (new_mad[1] == 25.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+void initialise_array(out float array[2], float init_val)
+{
+ int i=0;
+ array[0] = init_val;
+ array[1] = init_val;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert
new file mode 100644
index 0000000000..c6347c99c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/initfunc_empty_array_float_vert.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void initialise_array(out float array[2], float init_val);
+
+void main (void)
+{
+ int i=0;
+ float new_mad[2];
+ float gray = 0.0;
+ initialise_array(new_mad,25.0);
+ if( (new_mad[0] == 25.0) && (new_mad[1] == 25.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+void initialise_array(out float array[2], float init_val)
+{
+ array[0] = init_val;
+ array[1] = init_val;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt
new file mode 100644
index 0000000000..c7cbc1049a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/array/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+array_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html
new file mode 100644
index 0000000000..4d3ebe11db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: asin_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_float_frag_xvary.frag"
+ },
+ "name": "asin_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec2_frag_xvary.frag"
+ },
+ "name": "asin_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "asin_vec3_frag_xvary.frag"
+ },
+ "name": "asin_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "asin_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "asin_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "asin_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "asin_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "asin_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "asin_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "asin_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "asin_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "asin_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag
new file mode 100644
index 0000000000..1c9cf4fe29
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(asin(c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..92c81ec5f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_frag_xvary_ref.frag
@@ -0,0 +1,93 @@
+
+/*
+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.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_float_frag_xvary_ref.frag
+ * GL/asin/asin_float_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (color.r - 0.5);
+
+ float arrVal = (c + 1.0) * 8.0;
+ int arr0 = int(floor(arrVal));
+ float weight = arrVal - floor(arrVal);
+ float asin_c = 0.0;
+
+ if (arr0 == 0)
+ asin_c = lerp(asinValues[0], asinValues[1], weight);
+ else if (arr0 == 1)
+ asin_c = lerp(asinValues[1], asinValues[2], weight);
+ else if (arr0 == 2)
+ asin_c = lerp(asinValues[2], asinValues[3], weight);
+ else if (arr0 == 3)
+ asin_c = lerp(asinValues[3], asinValues[4], weight);
+ else if (arr0 == 4)
+ asin_c = lerp(asinValues[4], asinValues[5], weight);
+ else if (arr0 == 5)
+ asin_c = lerp(asinValues[5], asinValues[6], weight);
+ else if (arr0 == 6)
+ asin_c = lerp(asinValues[6], asinValues[7], weight);
+ else if (arr0 == 7)
+ asin_c = lerp(asinValues[7], asinValues[8], weight);
+ else if (arr0 == 8)
+ asin_c = lerp(asinValues[8], asinValues[9], weight);
+ else if (arr0 == 9)
+ asin_c = lerp(asinValues[9], asinValues[10], weight);
+ else if (arr0 == 10)
+ asin_c = lerp(asinValues[10], asinValues[11], weight);
+ else if (arr0 == 11)
+ asin_c = lerp(asinValues[11], asinValues[12], weight);
+ else if (arr0 == 12)
+ asin_c = lerp(asinValues[12], asinValues[13], weight);
+ else if (arr0 == 13)
+ asin_c = lerp(asinValues[13], asinValues[14], weight);
+ else if (arr0 == 14)
+ asin_c = lerp(asinValues[14], asinValues[15], weight);
+ else if (arr0 == 15)
+ asin_c = lerp(asinValues[15], asinValues[16], weight);
+ else if (arr0 == 16)
+ asin_c = asinValues[16];
+
+ gl_FragColor = vec4(asin_c / M_PI + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert
new file mode 100644
index 0000000000..f2d55ea2e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(asin(c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..18826e3e96
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_float_vert_xvary_ref.vert
@@ -0,0 +1,40 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * (gtf_Color.r - 0.5);
+
+ float asin_c = 0.0;
+ float scale = 1.0;
+ float sign = 1.0;
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c < 0.0)
+ {
+ sign = -1.0;
+ c *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c += scale * pow(c, float(i)) / float(i);
+ scale *= float(i) / float(i + 1);
+ }
+
+ color = vec4(sign * asin_c / M_PI + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..0b70bfb337
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(asin(c) / M_PI + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..97d0b539d8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_frag_xvary_ref.frag
@@ -0,0 +1,129 @@
+
+/*
+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.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_vec2_frag_xvary_ref.frag
+ * GL/asin/asin_vec2_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (color.rg - 0.5);
+
+ vec2 arrVal = (c + vec2(1.0, 1.0)) * 8.0;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ vec2 weight = arrVal - floor(arrVal);
+ vec2 asin_c = vec2(0.0);
+
+ if (arr0x == 0)
+ asin_c.x = lerp(asinValues[0], asinValues[1], weight.x);
+ else if (arr0x == 1)
+ asin_c.x = lerp(asinValues[1], asinValues[2], weight.x);
+ else if (arr0x == 2)
+ asin_c.x = lerp(asinValues[2], asinValues[3], weight.x);
+ else if (arr0x == 3)
+ asin_c.x = lerp(asinValues[3], asinValues[4], weight.x);
+ else if (arr0x == 4)
+ asin_c.x = lerp(asinValues[4], asinValues[5], weight.x);
+ else if (arr0x == 5)
+ asin_c.x = lerp(asinValues[5], asinValues[6], weight.x);
+ else if (arr0x == 6)
+ asin_c.x = lerp(asinValues[6], asinValues[7], weight.x);
+ else if (arr0x == 7)
+ asin_c.x = lerp(asinValues[7], asinValues[8], weight.x);
+ else if (arr0x == 8)
+ asin_c.x = lerp(asinValues[8], asinValues[9], weight.x);
+ else if (arr0x == 9)
+ asin_c.x = lerp(asinValues[9], asinValues[10], weight.x);
+ else if (arr0x == 10)
+ asin_c.x = lerp(asinValues[10], asinValues[11], weight.x);
+ else if (arr0x == 11)
+ asin_c.x = lerp(asinValues[11], asinValues[12], weight.x);
+ else if (arr0x == 12)
+ asin_c.x = lerp(asinValues[12], asinValues[13], weight.x);
+ else if (arr0x == 13)
+ asin_c.x = lerp(asinValues[13], asinValues[14], weight.x);
+ else if (arr0x == 14)
+ asin_c.x = lerp(asinValues[14], asinValues[15], weight.x);
+ else if (arr0x == 15)
+ asin_c.x = lerp(asinValues[15], asinValues[16], weight.x);
+ else if (arr0x == 16)
+ asin_c.x = asinValues[16];
+
+ if (arr0y == 0)
+ asin_c.y = lerp(asinValues[0], asinValues[1], weight.y);
+ else if (arr0y == 1)
+ asin_c.y = lerp(asinValues[1], asinValues[2], weight.y);
+ else if (arr0y == 2)
+ asin_c.y = lerp(asinValues[2], asinValues[3], weight.y);
+ else if (arr0y == 3)
+ asin_c.y = lerp(asinValues[3], asinValues[4], weight.y);
+ else if (arr0y == 4)
+ asin_c.y = lerp(asinValues[4], asinValues[5], weight.y);
+ else if (arr0y == 5)
+ asin_c.y = lerp(asinValues[5], asinValues[6], weight.y);
+ else if (arr0y == 6)
+ asin_c.y = lerp(asinValues[6], asinValues[7], weight.y);
+ else if (arr0y == 7)
+ asin_c.y = lerp(asinValues[7], asinValues[8], weight.y);
+ else if (arr0y == 8)
+ asin_c.y = lerp(asinValues[8], asinValues[9], weight.y);
+ else if (arr0y == 9)
+ asin_c.y = lerp(asinValues[9], asinValues[10], weight.y);
+ else if (arr0y == 10)
+ asin_c.y = lerp(asinValues[10], asinValues[11], weight.y);
+ else if (arr0y == 11)
+ asin_c.y = lerp(asinValues[11], asinValues[12], weight.y);
+ else if (arr0y == 12)
+ asin_c.y = lerp(asinValues[12], asinValues[13], weight.y);
+ else if (arr0y == 13)
+ asin_c.y = lerp(asinValues[13], asinValues[14], weight.y);
+ else if (arr0y == 14)
+ asin_c.y = lerp(asinValues[14], asinValues[15], weight.y);
+ else if (arr0y == 15)
+ asin_c.y = lerp(asinValues[15], asinValues[16], weight.y);
+ else if (arr0y == 16)
+ asin_c.y = asinValues[16];
+
+ gl_FragColor = vec4(asin_c / M_PI + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..a253bd14ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(asin(c) / M_PI + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..1ed1d47f66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec2_vert_xvary_ref.vert
@@ -0,0 +1,54 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ vec2 asin_c = vec2(0.0);
+ vec2 scale = vec2(1.0);
+ vec2 sign = vec2(1.0);
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.r < 0.0)
+ {
+ sign.r = -1.0;
+ c.r *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.r += scale.r * pow(c.r, float(i)) / float(i);
+ scale.r *= float(i) / float(i + 1);
+ }
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.g < 0.0)
+ {
+ sign.g = -1.0;
+ c.g *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.g += scale.g * pow(c.g, float(i)) / float(i);
+ scale.g *= float(i) / float(i + 1);
+ }
+
+ color = vec4(sign * asin_c / M_PI + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..d11988539e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(asin(c) / M_PI + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..2d21f0c547
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_frag_xvary_ref.frag
@@ -0,0 +1,165 @@
+
+/*
+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.
+*/
+
+
+/* The following files are direct copies of each other:
+ *
+ * GL/acos/acos_vec3_frag_xvary_ref.frag
+ * GL/asin/asin_vec3_frag_xvary_ref.frag
+ *
+ * Care should be taken to apply any changes to both. Only the last
+ * line where gl_FragColor is assigned should be different.
+ */
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float asinValues[17];
+ asinValues[0] = -1.5708;
+ asinValues[1] = -1.06544;
+ asinValues[2] = -0.848062;
+ asinValues[3] = -0.675132;
+ asinValues[4] = -0.523599;
+ asinValues[5] = -0.384397;
+ asinValues[6] = -0.25268;
+ asinValues[7] = -0.125328;
+ asinValues[8] = 0.0;
+ asinValues[9] = 0.125328;
+ asinValues[10] = 0.25268;
+ asinValues[11] = 0.384397;
+ asinValues[12] = 0.523599;
+ asinValues[13] = 0.675132;
+ asinValues[14] = 0.848062;
+ asinValues[15] = 1.06544;
+ asinValues[16] = 1.5708;
+
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (color.rgb - 0.5);
+
+ vec3 arrVal = (c + vec3(1.0, 1.0, 1.0)) * 8.0;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ int arr0z = int(floor(arrVal.z));
+ vec3 weight = arrVal - floor(arrVal);
+ vec3 asin_c = vec3(0.0);
+
+ if (arr0x == 0)
+ asin_c.x = lerp(asinValues[0], asinValues[1], weight.x);
+ else if (arr0x == 1)
+ asin_c.x = lerp(asinValues[1], asinValues[2], weight.x);
+ else if (arr0x == 2)
+ asin_c.x = lerp(asinValues[2], asinValues[3], weight.x);
+ else if (arr0x == 3)
+ asin_c.x = lerp(asinValues[3], asinValues[4], weight.x);
+ else if (arr0x == 4)
+ asin_c.x = lerp(asinValues[4], asinValues[5], weight.x);
+ else if (arr0x == 5)
+ asin_c.x = lerp(asinValues[5], asinValues[6], weight.x);
+ else if (arr0x == 6)
+ asin_c.x = lerp(asinValues[6], asinValues[7], weight.x);
+ else if (arr0x == 7)
+ asin_c.x = lerp(asinValues[7], asinValues[8], weight.x);
+ else if (arr0x == 8)
+ asin_c.x = lerp(asinValues[8], asinValues[9], weight.x);
+ else if (arr0x == 9)
+ asin_c.x = lerp(asinValues[9], asinValues[10], weight.x);
+ else if (arr0x == 10)
+ asin_c.x = lerp(asinValues[10], asinValues[11], weight.x);
+ else if (arr0x == 11)
+ asin_c.x = lerp(asinValues[11], asinValues[12], weight.x);
+ else if (arr0x == 12)
+ asin_c.x = lerp(asinValues[12], asinValues[13], weight.x);
+ else if (arr0x == 13)
+ asin_c.x = lerp(asinValues[13], asinValues[14], weight.x);
+ else if (arr0x == 14)
+ asin_c.x = lerp(asinValues[14], asinValues[15], weight.x);
+ else if (arr0x == 15)
+ asin_c.x = lerp(asinValues[15], asinValues[16], weight.x);
+ else if (arr0x == 16)
+ asin_c.x = asinValues[16];
+
+ if (arr0y == 0)
+ asin_c.y = lerp(asinValues[0], asinValues[1], weight.y);
+ else if (arr0y == 1)
+ asin_c.y = lerp(asinValues[1], asinValues[2], weight.y);
+ else if (arr0y == 2)
+ asin_c.y = lerp(asinValues[2], asinValues[3], weight.y);
+ else if (arr0y == 3)
+ asin_c.y = lerp(asinValues[3], asinValues[4], weight.y);
+ else if (arr0y == 4)
+ asin_c.y = lerp(asinValues[4], asinValues[5], weight.y);
+ else if (arr0y == 5)
+ asin_c.y = lerp(asinValues[5], asinValues[6], weight.y);
+ else if (arr0y == 6)
+ asin_c.y = lerp(asinValues[6], asinValues[7], weight.y);
+ else if (arr0y == 7)
+ asin_c.y = lerp(asinValues[7], asinValues[8], weight.y);
+ else if (arr0y == 8)
+ asin_c.y = lerp(asinValues[8], asinValues[9], weight.y);
+ else if (arr0y == 9)
+ asin_c.y = lerp(asinValues[9], asinValues[10], weight.y);
+ else if (arr0y == 10)
+ asin_c.y = lerp(asinValues[10], asinValues[11], weight.y);
+ else if (arr0y == 11)
+ asin_c.y = lerp(asinValues[11], asinValues[12], weight.y);
+ else if (arr0y == 12)
+ asin_c.y = lerp(asinValues[12], asinValues[13], weight.y);
+ else if (arr0y == 13)
+ asin_c.y = lerp(asinValues[13], asinValues[14], weight.y);
+ else if (arr0y == 14)
+ asin_c.y = lerp(asinValues[14], asinValues[15], weight.y);
+ else if (arr0y == 15)
+ asin_c.y = lerp(asinValues[15], asinValues[16], weight.y);
+ else if (arr0y == 16)
+ asin_c.y = asinValues[16];
+
+ if (arr0z == 0)
+ asin_c.z = lerp(asinValues[0], asinValues[1], weight.z);
+ else if (arr0z == 1)
+ asin_c.z = lerp(asinValues[1], asinValues[2], weight.z);
+ else if (arr0z == 2)
+ asin_c.z = lerp(asinValues[2], asinValues[3], weight.z);
+ else if (arr0z == 3)
+ asin_c.z = lerp(asinValues[3], asinValues[4], weight.z);
+ else if (arr0z == 4)
+ asin_c.z = lerp(asinValues[4], asinValues[5], weight.z);
+ else if (arr0z == 5)
+ asin_c.z = lerp(asinValues[5], asinValues[6], weight.z);
+ else if (arr0z == 6)
+ asin_c.z = lerp(asinValues[6], asinValues[7], weight.z);
+ else if (arr0z == 7)
+ asin_c.z = lerp(asinValues[7], asinValues[8], weight.z);
+ else if (arr0z == 8)
+ asin_c.z = lerp(asinValues[8], asinValues[9], weight.z);
+ else if (arr0z == 9)
+ asin_c.z = lerp(asinValues[9], asinValues[10], weight.z);
+ else if (arr0z == 10)
+ asin_c.z = lerp(asinValues[10], asinValues[11], weight.z);
+ else if (arr0z == 11)
+ asin_c.z = lerp(asinValues[11], asinValues[12], weight.z);
+ else if (arr0z == 12)
+ asin_c.z = lerp(asinValues[12], asinValues[13], weight.z);
+ else if (arr0z == 13)
+ asin_c.z = lerp(asinValues[13], asinValues[14], weight.z);
+ else if (arr0z == 14)
+ asin_c.z = lerp(asinValues[14], asinValues[15], weight.z);
+ else if (arr0z == 15)
+ asin_c.z = lerp(asinValues[15], asinValues[16], weight.z);
+ else if (arr0z == 16)
+ asin_c.z = asinValues[16];
+
+ gl_FragColor = vec4(asin_c / M_PI + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..e49f94a085
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(asin(c) / M_PI + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..d8b6222608
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/asin_vec3_vert_xvary_ref.vert
@@ -0,0 +1,69 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 asin_c = vec3(0.0);
+ vec3 scale = vec3(1.0);
+ vec3 sign = vec3(1.0);
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.r < 0.0)
+ {
+ sign.r = -1.0;
+ c.r *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.r += scale.r * pow(c.r, float(i)) / float(i);
+ scale.r *= float(i) / float(i + 1);
+ }
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.g < 0.0)
+ {
+ sign.g = -1.0;
+ c.g *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.g += scale.g * pow(c.g, float(i)) / float(i);
+ scale.g *= float(i) / float(i + 1);
+ }
+
+ // pow can't handle negative numbers so take advantage of symmetry
+ if(c.b < 0.0)
+ {
+ sign.b = -1.0;
+ c.b *= -1.0;
+ }
+
+ // Taylors series expansion for asin
+ // 1000/2 iterations necessary to get the accuracy with this method
+ for(int i = 1; i < 1000; i += 2)
+ {
+ asin_c.b += scale.b * pow(c.b, float(i)) / float(i);
+ scale.b *= float(i) / float(i + 1);
+ }
+
+ color = vec4(sign * asin_c / M_PI + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt
new file mode 100644
index 0000000000..c2de8233ad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/asin/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+asin_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html
new file mode 100644
index 0000000000..05b3e5b461
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: atan_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_float_frag_xvary.frag"
+ },
+ "name": "atan_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec2_frag_xvary.frag"
+ },
+ "name": "atan_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec3_frag_xvary.frag"
+ },
+ "name": "atan_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_float_frag_xvaryyvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_float_frag_xvaryyvary.frag"
+ },
+ "name": "atan_float_frag_xvaryyvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec2_frag_xvaryyvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec2_frag_xvaryyvary.frag"
+ },
+ "name": "atan_vec2_frag_xvaryyvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec3_frag_xvaryyvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "atan_vec3_frag_xvaryyvary.frag"
+ },
+ "name": "atan_vec3_frag_xvaryyvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "atan_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "atan_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "atan_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "atan_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "atan_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "atan_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html
new file mode 100644
index 0000000000..201c0282cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_009_to_012.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: atan_009_to_012.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "atan_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "atan_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "atan_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "atan_float_vert_xvaryyvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "atan_float_vert_xvaryyvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "atan_float_vert_xvaryyvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "atan_vec2_vert_xvaryyvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "atan_vec2_vert_xvaryyvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "atan_vec2_vert_xvaryyvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "atan_vec3_vert_xvaryyvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "atan_vec3_vert_xvaryyvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "atan_vec3_vert_xvaryyvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag
new file mode 100644
index 0000000000..75b48dd621
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 4.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(atan(c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..83546d9d72
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvary_ref.frag
@@ -0,0 +1,55 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 4.0 * 2.0 * (color.r - 0.5);
+ float atan_c = 0.0;
+ float scale = 1.0;
+ float sign = 1.0;
+ vec4 result;
+
+ if(c < 0.0)
+ {
+ sign = -1.0;
+ c *= -1.0;
+ }
+
+ if(c <= 1.0)
+ {
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * atan_c / M_PI + 0.5, 0.0, 0.0, 1.0);
+ }
+ else
+ {
+ c = 1.0 / c;
+
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * (M_PI / 2.0 - atan_c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+ }
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag
new file mode 100644
index 0000000000..20333090b1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float x = 2.0 * (color.g - 0.5);
+ float y = 2.0 * (color.b - 0.5);
+ const float epsilon = 1.0e-4;
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x > epsilon || abs(y) > epsilon)
+ {
+ gl_FragColor = vec4(atan(y, x) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag
new file mode 100644
index 0000000000..5c341a2a52
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_frag_xvaryyvary_ref.frag
@@ -0,0 +1,71 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float x = 2.0 * (color.g - 0.5);
+ float y = 2.0 * (color.b - 0.5);
+ float atan_c = 0.0;
+ float scale = 1.0;
+ float sign = 1.0;
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+ const float epsilon = 1.0e-4;
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x > epsilon || abs(y) > epsilon)
+ {
+ if(x < 0.0 ^^ y < 0.0)
+ {
+ sign = -1.0;
+ }
+
+ if(abs(y) <= abs(x))
+ {
+ float c = abs(y / x);
+
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * atan_c / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ }
+ else
+ {
+ float c = abs(x / y);
+
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * (M_PI / 2.0 - atan_c) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ }
+
+ if(x < 0.0)
+ if(y < 0.0) result.r -= 0.5;
+ else if(y > 0.0) result.r += 0.5;
+ }
+
+ gl_FragColor = result;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert
new file mode 100644
index 0000000000..45d4753a12
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 4.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(atan(c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..98838d98c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvary_ref.vert
@@ -0,0 +1,56 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 4.0 * 2.0 * (gtf_Color.r - 0.5);
+ float atan_c = 0.0;
+ float scale = 1.0;
+ float sign = 1.0;
+ vec4 result;
+
+ if(c < 0.0)
+ {
+ sign = -1.0;
+ c *= -1.0;
+ }
+
+ if(c <= 1.0)
+ {
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * atan_c / M_PI + 0.5, 0.0, 0.0, 1.0);
+ }
+ else
+ {
+ c = 1.0 / c;
+
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * (M_PI / 2.0 - atan_c) / M_PI + 0.5, 0.0, 0.0, 1.0);
+ }
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert
new file mode 100644
index 0000000000..6da6ba13b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float x = 2.0 * (gtf_Color.g - 0.5);
+ float y = 2.0 * (gtf_Color.b - 0.5);
+ const float epsilon = 1.0e-4;
+ color = vec4(0.0, 0.0, 0.0, 1.0);
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x > epsilon || abs(y) > epsilon)
+ {
+ color = vec4(atan(y, x) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ }
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert
new file mode 100644
index 0000000000..b6c2d5f4ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_float_vert_xvaryyvary_ref.vert
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float x = 2.0 * (gtf_Color.g - 0.5);
+ float y = 2.0 * (gtf_Color.b - 0.5);
+ float atan_c = 0.0;
+ float scale = 1.0;
+ float sign = 1.0;
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+ const float epsilon = 1.0e-4;
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x > epsilon || abs(y) > epsilon)
+ {
+ if(x < 0.0 ^^ y < 0.0)
+ {
+ sign = -1.0;
+ }
+
+ if(abs(y) <= abs(x))
+ {
+ float c = abs(y / x);
+
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * atan_c / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ }
+ else
+ {
+ float c = abs(x / y);
+
+ // Taylors series expansion for atan
+ for(int i = 1; i < 12; i += 2)
+ {
+ atan_c += scale * pow(c, float(i)) / float(i);
+ scale *= -1.0;
+ }
+
+ result = vec4(sign * (M_PI / 2.0 - atan_c) / (2.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ }
+
+ if(x < 0.0)
+ if(y < 0.0) result.r -= 0.5;
+ else if(y > 0.0) result.r += 0.5;
+ }
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..46d927e57c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 4.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(atan(c) / M_PI + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..9358f869ef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvary_ref.frag
@@ -0,0 +1,115 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 4.0 * 2.0 * (color.rg - 0.5);
+ vec2 atan_c = vec2(0.0);
+ vec2 scale = vec2(1.0);
+ vec2 sign = vec2(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if(c[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ c[0] *= -1.0;
+ }
+
+ if(c[0] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / M_PI + 0.5;
+ }
+ else
+ {
+ c[0] = 1.0 / c[0];
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5;
+ }
+
+
+ if(c[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ c[1] *= -1.0;
+ }
+
+ if(c[1] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / M_PI + 0.5;
+ }
+ else
+ {
+ c[1] = 1.0 / c[1];
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5;
+ }
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag
new file mode 100644
index 0000000000..8bffcb3dad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 x = 2.0 * (color.gg - 0.5);
+ vec2 y = 2.0 * (color.bb - 0.5);
+ const float epsilon = 1.0e-4;
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ gl_FragColor[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+ gl_FragColor[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5;
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag
new file mode 100644
index 0000000000..bfd7117d48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_frag_xvaryyvary_ref.frag
@@ -0,0 +1,133 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 x = 2.0 * (color.gg - 0.5);
+ vec2 y = 2.0 * (color.bb - 0.5);
+ vec2 c;
+ vec2 atan_c = vec2(0.0);
+ vec2 scale = vec2(1.0);
+ vec2 sign = vec2(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+ const float epsilon = 1.0e-4;
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ if(x[0] < 0.0 ^^ y[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ }
+
+ if(abs(y[0]) <= abs(x[0]))
+ {
+ c[0] = abs(y[0] / x[0]);
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[0] = abs(x[0] / y[0]);
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[0] < 0.0)
+ if(y[0] < 0.0) result[0] -= 0.5;
+ else if(y[0] > 0.0) result[0] += 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+
+ if(x[1] < 0.0 ^^ y[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ }
+
+ if(abs(y[1]) <= abs(x[1]))
+ {
+ c[1] = abs(y[1] / x[1]);
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[1] = abs(x[1] / y[1]);
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] < 0.0)
+ if(y[1] < 0.0) result[1] -= 0.5;
+ else if(y[1] > 0.0) result[1] += 0.5;
+ }
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..5432f7244f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 4.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(atan(c) / M_PI + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..1ef2d5e83d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvary_ref.vert
@@ -0,0 +1,116 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 4.0 * 2.0 * (gtf_Color.rg - 0.5);
+ vec2 atan_c = vec2(0.0);
+ vec2 scale = vec2(1.0);
+ vec2 sign = vec2(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if(c[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ c[0] *= -1.0;
+ }
+
+ if(c[0] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / M_PI + 0.5;
+ }
+ else
+ {
+ c[0] = 1.0 / c[0];
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5;
+ }
+
+
+ if(c[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ c[1] *= -1.0;
+ }
+
+ if(c[1] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / M_PI + 0.5;
+ }
+ else
+ {
+ c[1] = 1.0 / c[1];
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5;
+ }
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert
new file mode 100644
index 0000000000..bfa6448968
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 x = 2.0 * (gtf_Color.gg - 0.5);
+ vec2 y = 2.0 * (gtf_Color.bb - 0.5);
+ const float epsilon = 1.0e-4;
+ color = vec4(0.0, 0.0, 0.0, 1.0);
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ color[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+ color[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5;
+ }
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert
new file mode 100644
index 0000000000..eee41526ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec2_vert_xvaryyvary_ref.vert
@@ -0,0 +1,133 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 x = 2.0 * (gtf_Color.gg - 0.5);
+ vec2 y = 2.0 * (gtf_Color.bb - 0.5);
+ vec2 c;
+ vec2 atan_c = vec2(0.0);
+ vec2 scale = vec2(1.0);
+ vec2 sign = vec2(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+ const float epsilon = 1.0e-4;
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ if(x[0] < 0.0 ^^ y[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ }
+
+ if(abs(y[0]) <= abs(x[0]))
+ {
+ c[0] = abs(y[0] / x[0]);
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[0] = abs(x[0] / y[0]);
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[0] < 0.0)
+ if(y[0] < 0.0) result[0] -= 0.5;
+ else if(y[0] > 0.0) result[0] += 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+ if(x[1] < 0.0 ^^ y[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ }
+
+ if(abs(y[1]) <= abs(x[1]))
+ {
+ c[1] = abs(y[1] / x[1]);
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[1] = abs(x[1] / y[1]);
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] < 0.0)
+ if(y[1] < 0.0) result[1] -= 0.5;
+ else if(y[1] > 0.0) result[1] += 0.5;
+ }
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..f4101e3e59
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 4.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(atan(c) / M_PI + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..d5cfd01fa1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvary_ref.frag
@@ -0,0 +1,161 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 4.0 * 2.0 * (color.rgb - 0.5);
+ vec3 atan_c = vec3(0.0);
+ vec3 scale = vec3(1.0);
+ vec3 sign = vec3(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+
+
+ if(c[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ c[0] *= -1.0;
+ }
+
+ if(c[0] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / M_PI + 0.5;
+ }
+ else
+ {
+ c[0] = 1.0 / c[0];
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5;
+ }
+
+ if(c[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ c[1] *= -1.0;
+ }
+
+ if(c[1] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / M_PI + 0.5;
+ }
+ else
+ {
+ c[1] = 1.0 / c[1];
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5;
+ }
+
+
+ if(c[2] < 0.0)
+ {
+ sign[2] = -1.0;
+ c[2] *= -1.0;
+ }
+
+ if(c[2] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * atan_c[2] / M_PI + 0.5;
+ }
+ else
+ {
+ c[2] = 1.0 / c[2];
+
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / M_PI + 0.5;
+ }
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag
new file mode 100644
index 0000000000..0db560e1df
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary.frag
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 x = 2.0 * (color.ggg - 0.5);
+ vec3 y = 2.0 * (color.bbb - 0.5);
+ const float epsilon = 1.0e-4;
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ gl_FragColor[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+ gl_FragColor[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[2] > epsilon || abs(y[2]) > epsilon)
+ {
+ gl_FragColor[2] = atan(y[2], x[2]) / (2.0 * M_PI) + 0.5;
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag
new file mode 100644
index 0000000000..c6b55f4a0c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_frag_xvaryyvary_ref.frag
@@ -0,0 +1,186 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 x = 2.0 * (color.ggg - 0.5);
+ vec3 y = 2.0 * (color.bbb - 0.5);
+ vec3 c;
+ vec3 atan_c = vec3(0.0);
+ vec3 scale = vec3(1.0);
+ vec3 sign = vec3(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+ const float epsilon = 1.0e-4;
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ if(x[0] < 0.0 ^^ y[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ }
+
+ if(abs(y[0]) <= abs(x[0]))
+ {
+ c[0] = abs(y[0] / x[0]);
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[0] = abs(x[0] / y[0]);
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[0] < 0.0)
+ if(y[0] < 0.0) result[0] -= 0.5;
+ else if(y[0] > 0.0) result[0] += 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+
+ if(x[1] < 0.0 ^^ y[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ }
+
+ if(abs(y[1]) <= abs(x[1]))
+ {
+ c[1] = abs(y[1] / x[1]);
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[1] = abs(x[1] / y[1]);
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] < 0.0)
+ if(y[1] < 0.0) result[1] -= 0.5;
+ else if(y[1] > 0.0) result[1] += 0.5;
+ }
+
+ if(x[2] > epsilon || abs(y[2]) > epsilon)
+ {
+
+ if(x[2] < 0.0 ^^ y[2] < 0.0)
+ {
+ sign[2] = -1.0;
+ }
+
+ if(abs(y[2]) <= abs(x[2]))
+ {
+ c[2] = abs(y[2] / x[2]);
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * atan_c[2] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[2] = abs(x[2] / y[2]);
+
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[2] < 0.0)
+ if(y[2] < 0.0) result[2] -= 0.5;
+ else if(y[2] > 0.0) result[2] += 0.5;
+ }
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..cf11d094d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 4.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(atan(c) / M_PI + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..4b811a1036
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvary_ref.vert
@@ -0,0 +1,161 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 4.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 atan_c = vec3(0.0);
+ vec3 scale = vec3(1.0);
+ vec3 sign = vec3(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+
+ if(c[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ c[0] *= -1.0;
+ }
+
+ if(c[0] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / M_PI + 0.5;
+ }
+ else
+ {
+ c[0] = 1.0 / c[0];
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / M_PI + 0.5;
+ }
+
+
+ if(c[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ c[1] *= -1.0;
+ }
+
+ if(c[1] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / M_PI + 0.5;
+ }
+ else
+ {
+ c[1] = 1.0 / c[1];
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / M_PI + 0.5;
+ }
+
+ if(c[2] < 0.0)
+ {
+ sign[2] = -1.0;
+ c[2] *= -1.0;
+ }
+
+ if(c[2] <= 1.0)
+ {
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * atan_c[2] / M_PI + 0.5;
+ }
+ else
+ {
+ c[2] = 1.0 / c[2];
+
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / M_PI + 0.5;
+ }
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert
new file mode 100644
index 0000000000..60d2cca63b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary.vert
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 x = 2.0 * (gtf_Color.ggg - 0.5);
+ vec3 y = 2.0 * (gtf_Color.bbb - 0.5);
+ const float epsilon = 1.0e-4;
+ color = vec4(0.0, 0.0, 0.0, 1.0);
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ color[0] = atan(y[0], x[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+ color[1] = atan(y[1], x[1]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[2] > epsilon || abs(y[2]) > epsilon)
+ {
+ color[2] = atan(y[2], x[2]) / (2.0 * M_PI) + 0.5;
+ }
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert
new file mode 100644
index 0000000000..9a46dec1ad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/atan_vec3_vert_xvaryyvary_ref.vert
@@ -0,0 +1,185 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 x = 2.0 * (gtf_Color.ggg - 0.5);
+ vec3 y = 2.0 * (gtf_Color.bbb - 0.5);
+ vec3 c;
+ vec3 atan_c = vec3(0.0);
+ vec3 scale = vec3(1.0);
+ vec3 sign = vec3(1.0);
+ vec4 result = vec4(0.0, 0.0, 0.0, 1.0);
+ const float epsilon = 1.0e-4;
+
+ // Avoid evaluating atan(0, x) for x < epsilon because it's implementation-dependent
+ if(x[0] > epsilon || abs(y[0]) > epsilon)
+ {
+ if(x[0] < 0.0 ^^ y[0] < 0.0)
+ {
+ sign[0] = -1.0;
+ }
+
+ if(abs(y[0]) <= abs(x[0]))
+ {
+ c[0] = abs(y[0] / x[0]);
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * atan_c[0] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[0] = abs(x[0] / y[0]);
+
+ // Taylors series expansion for atan
+ atan_c[0] += scale[0] * pow(c[0], float(1)) / float(1);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(3)) / float(3);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(5)) / float(5);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(7)) / float(7);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(9)) / float(9);
+ scale[0] *= -1.0;
+ atan_c[0] += scale[0] * pow(c[0], float(11)) / float(11);
+ scale[0] *= -1.0;
+
+ result[0] = sign[0] * (M_PI / 2.0 - atan_c[0]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[0] < 0.0)
+ if(y[0] < 0.0) result[0] -= 0.5;
+ else if(y[0] > 0.0) result[0] += 0.5;
+ }
+
+ if(x[1] > epsilon || abs(y[1]) > epsilon)
+ {
+ if(x[1] < 0.0 ^^ y[1] < 0.0)
+ {
+ sign[1] = -1.0;
+ }
+
+ if(abs(y[1]) <= abs(x[1]))
+ {
+ c[1] = abs(y[1] / x[1]);
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * atan_c[1] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[1] = abs(x[1] / y[1]);
+
+ // Taylors series expansion for atan
+ atan_c[1] += scale[1] * pow(c[1], float(1)) / float(1);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(3)) / float(3);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(5)) / float(5);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(7)) / float(7);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(9)) / float(9);
+ scale[1] *= -1.0;
+ atan_c[1] += scale[1] * pow(c[1], float(11)) / float(11);
+ scale[1] *= -1.0;
+
+ result[1] = sign[1] * (M_PI / 2.0 - atan_c[1]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[1] < 0.0)
+ if(y[1] < 0.0) result[1] -= 0.5;
+ else if(y[1] > 0.0) result[1] += 0.5;
+ }
+
+ if(x[2] > epsilon || abs(y[2]) > epsilon)
+ {
+ if(x[2] < 0.0 ^^ y[2] < 0.0)
+ {
+ sign[2] = -1.0;
+ }
+
+ if(abs(y[2]) <= abs(x[2]))
+ {
+ c[2] = abs(y[2] / x[2]);
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * atan_c[2] / (2.0 * M_PI) + 0.5;
+ }
+ else
+ {
+ c[2] = abs(x[2] / y[2]);
+
+ // Taylors series expansion for atan
+ atan_c[2] += scale[2] * pow(c[2], float(1)) / float(1);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(3)) / float(3);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(5)) / float(5);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(7)) / float(7);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(9)) / float(9);
+ scale[2] *= -1.0;
+ atan_c[2] += scale[2] * pow(c[2], float(11)) / float(11);
+ scale[2] *= -1.0;
+
+ result[2] = sign[2] * (M_PI / 2.0 - atan_c[2]) / (2.0 * M_PI) + 0.5;
+ }
+
+ if(x[2] < 0.0)
+ if(y[2] < 0.0) result[2] -= 0.5;
+ else if(y[2] > 0.0) result[2] += 0.5;
+ }
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt
new file mode 100644
index 0000000000..1c305f2111
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/atan/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+atan_001_to_008.html
+atan_009_to_012.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html
new file mode 100644
index 0000000000..0a07bd0f0c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_001_to_008.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: biConstants_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxCombinedTextureImageUnits_frag.frag"
+ },
+ "name": "gl_MaxCombinedTextureImageUnits_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxCombinedTextureImageUnits_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxCombinedTextureImageUnits_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxDrawBuffers_frag.frag"
+ },
+ "name": "gl_MaxDrawBuffers_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxDrawBuffers_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxDrawBuffers_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxFragmentUniformVectors_frag.frag"
+ },
+ "name": "gl_MaxFragmentUniformVectors_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxFragmentUniformVectors_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxFragmentUniformVectors_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxTextureImageUnits_frag.frag"
+ },
+ "name": "gl_MaxTextureImageUnits_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxTextureImageUnits_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxTextureImageUnits_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html
new file mode 100644
index 0000000000..22e133df44
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/biConstants_009_to_016.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: biConstants_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxVaryingVectors_frag.frag"
+ },
+ "name": "gl_MaxVaryingVectors_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxVaryingVectors_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxVaryingVectors_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxVertexAttribs_frag.frag"
+ },
+ "name": "gl_MaxVertexAttribs_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxVertexAttribs_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxVertexAttribs_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxVertexTextureImageUnits_frag.frag"
+ },
+ "name": "gl_MaxVertexTextureImageUnits_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxVertexTextureImageUnits_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxVertexTextureImageUnits_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_MaxVertexUniformVectors_frag.frag"
+ },
+ "name": "gl_MaxVertexUniformVectors_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "gl_MaxVertexUniformVectors_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "gl_MaxVertexUniformVectors_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag
new file mode 100644
index 0000000000..2770f5605b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxCombinedTextureImageUnits is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ gl_FragColor = vec4(float(gl_MaxCombinedTextureImageUnits) / 8.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert
new file mode 100644
index 0000000000..30411c8c48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxCombinedTextureImageUnits_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxCombinedTextureImageUnits is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ color = vec4(float(gl_MaxCombinedTextureImageUnits) / 8.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag
new file mode 100644
index 0000000000..fd09da1135
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxDrawBuffers is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 1.0 will get clamped to 1.0 or white.
+ gl_FragColor = vec4(float(gl_MaxDrawBuffers) / 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert
new file mode 100644
index 0000000000..d7cd426572
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxDrawBuffers_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxDrawBuffers is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 1.0 will get clamped to 1.0 or white.
+ color = vec4(float(gl_MaxDrawBuffers) / 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag
new file mode 100644
index 0000000000..1cf64a5a23
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxFragmentUniformVectors is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 16.0 will get clamped to 1.0 or white.
+ gl_FragColor = vec4(float(gl_MaxFragmentUniformVectors) / 16.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert
new file mode 100644
index 0000000000..75371e9105
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxFragmentUniformVectors_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxFragmentUniformVectors is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 16.0 will get clamped to 1.0 or white.
+ color = vec4(float(gl_MaxFragmentUniformVectors) / 16.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag
new file mode 100644
index 0000000000..2923d5faaa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxTextureImageUnits is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ gl_FragColor = vec4(float(gl_MaxTextureImageUnits) / 8.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert
new file mode 100644
index 0000000000..277821e160
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxTextureImageUnits_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxTextureImageUnits is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ color = vec4(float(gl_MaxTextureImageUnits) / 8.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag
new file mode 100644
index 0000000000..d8acbc462e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVaryingVectors is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ gl_FragColor = vec4(float(gl_MaxVaryingVectors) / 8.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert
new file mode 100644
index 0000000000..342e138ff4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVaryingVectors_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVaryingVectors is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ color = vec4(float(gl_MaxVaryingVectors) / 8.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag
new file mode 100644
index 0000000000..60b5e21248
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVertexAttribs is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ gl_FragColor = vec4(float(gl_MaxVertexAttribs) / 8.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert
new file mode 100644
index 0000000000..2bb5f5e290
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexAttribs_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVertexAttribs is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 8.0 will get clamped to 1.0 or white.
+ color = vec4(float(gl_MaxVertexAttribs) / 8.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag
new file mode 100644
index 0000000000..d36c93920a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVertexTextureImageUnits is set and that its
+ // value is greater than or equal to the minimum value.
+ if(gl_MaxVertexTextureImageUnits >= 0)
+ gl_FragColor = vec4(1.0);
+ else
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert
new file mode 100644
index 0000000000..2310369a82
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexTextureImageUnits_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVertexTextureImageUnits is set and that its
+ // value is greater than or equal to the minimum value.
+ if(gl_MaxVertexTextureImageUnits >= 0)
+ color = vec4(1.0);
+ else
+ color = vec4(0.0, 0.0, 0.0, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag
new file mode 100644
index 0000000000..7f9e4055db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVertexUniformVectors is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 128.0 will get clamped to 1.0 or white.
+ gl_FragColor = vec4(float(gl_MaxVertexUniformVectors) / 128.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert
new file mode 100644
index 0000000000..7cc6fe041f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/gl_MaxVertexUniformVectors_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // This test verifies that gl_MaxVertexUniformVectors is set and that its
+ // value is greater than or equal to the minimum value.
+ // Values greater than 128.0 will get clamped to 1.0 or white.
+ color = vec4(float(gl_MaxVertexUniformVectors) / 128.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt
new file mode 100644
index 0000000000..15c403b1a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biConstants/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+biConstants_001_to_008.html
+biConstants_009_to_016.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag
new file mode 100644
index 0000000000..2cda606455
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+void main(void)
+{
+ gl_FragColor = vec4(gl_DepthRange.near, gl_DepthRange.far, gl_DepthRange.diff, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert
new file mode 100644
index 0000000000..a095711f1d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/DepthRange_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main(void)
+{
+ color = vec4(gl_DepthRange.near, gl_DepthRange.far, gl_DepthRange.diff, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html
new file mode 100644
index 0000000000..18400ee704
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/biuDepthRange_001_to_002.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: biuDepthRange_001_to_002.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "name": "DepthRange_frag.test.html",
+ "pattern": "compare",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "DepthRange_frag.frag",
+ "builtin_uniforms": {
+ "min_required": 2,
+ "valid_values": [
+ "gl_DepthRange.near",
+ "gl_DepthRange.far",
+ "gl_DepthRange.diff"
+ ],
+ }
+ },
+ "state": {
+ "depthrange": {
+ "far": "0.75",
+ "near": "0.25"
+ }
+ },
+ "model": null
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "name": "DepthRange_vert.test.html",
+ "pattern": "compare",
+ "testProgram": {
+ "vertexShader": "DepthRange_vert.vert",
+ "fragmentShader": "../default/default.frag",
+ "builtin_uniforms": {
+ "min_required": 2,
+ "valid_values": [
+ "gl_DepthRange.near",
+ "gl_DepthRange.far",
+ "gl_DepthRange.diff"
+ ]
+ }
+ },
+ "state": {
+ "depthrange": {
+ "far": "0.75",
+ "near": "0.25"
+ }
+ },
+ "model": "grid"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt
new file mode 100644
index 0000000000..21f2fd2e19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/biuDepthRange/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+biuDepthRange_001_to_002.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag
new file mode 100644
index 0000000000..4f31090ebf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Data_Types_frag.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ half h1; // Not a basic type.
+ half2 h2; // Not a basic type.
+ half3 h3; // Not a basic type.
+ half4 h4; // Not a basic type.
+ float2 f2; // Not a basic type.
+ float3 f3; // Not a basic type.
+ float4 f4; // Not a basic type.
+ fixed fx1; // Not a basic type.
+ fixed2 fx2; // Not a basic type.
+ fixed3 fx3; // Not a basic type.
+ fixed4 fx4; // Not a basic type.
+ float3x3 f3x3; // Not a basic type.
+ float2x4 f2x4; // Not a basic type.
+ half4x4 h4x4; // Not a basic type.
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag
new file mode 100644
index 0000000000..392680ee1a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CG_Standard_Library_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i = round(1.3); // round is not a built-in function.
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag
new file mode 100644
index 0000000000..07ba3ef37b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectBuiltInOveride_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump int;
+#endif
+
+int radians(int f)
+{
+ return f;
+}
+
+void main()
+{
+ int f = 45;
+ f = radians(f);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag
new file mode 100644
index 0000000000..8b671d79b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectComma_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ float f;
+ vec3 v;
+};
+
+void main()
+{
+ const vec4 v = (vec4(1,2,3,4), vec4(5,6,7,8)); // 5,6,7,8
+ const s s1 = (s(9.0, vec3(10,11,12)), s(13.0, vec3(14,15,16))); // 13,14,15,16
+ gl_FragColor = v + vec4(s1.f, s1.v); // 18, 20, 22, 24
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert
new file mode 100644
index 0000000000..89a3bc584f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding1_vert.vert
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+
+ const struct s2 {
+ int i;
+ vec3 v3;
+ bvec4 bv4;
+ } s22 = s2(8, vec3(9, 10, 11), bvec4(true, false, true, false));
+
+ struct s4 {
+ int ii;
+ vec4 v4;
+ };
+
+ const struct s1 {
+ s2 ss;
+ int i;
+ float f;
+ mat4 m;
+ s4 s44;
+ } s11 = s1(s22, 2, 4.0, mat4(5), s4(6, vec4(7, 8, 9, 10))) ;
+
+ const int field3 = s11.i * s11.ss.i; // constant folding (int * int)
+ const vec4 field4 = s11.s44.v4 * s11.s44.v4; // constant folding (vec4 * vec4)
+ // 49, 64, 81, 100
+ const vec4 v4 = vec4(s11.ss.v3.y, s11.m[3][3], field3, field4[2]); // 10.0, 5.0, 16.0, 81.0
+ gl_Position = v4;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert
new file mode 100644
index 0000000000..55c1367245
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstFolding2_vert.vert
@@ -0,0 +1,421 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ struct s5 {
+ float k;
+ };
+ const struct s {
+ int i;
+ float j;
+ s5 s55;
+ } ss = s(4,1.0, s5(1.0));
+
+
+ const struct s2 {
+ int i;
+ vec3 v3;
+ bvec4 bv4;
+ } s22 = s2(8, vec3(9, 10, 11), bvec4(true, false, true, false));
+
+ struct s4 {
+ int ii;
+ vec4 v4;
+ };
+
+ const struct s1 {
+ s2 ss;
+ int i;
+ float f;
+ mat4 m;
+ s4 s44;
+ } s11 = s1(s22, 2, 4.0, mat4(5), s4(6, vec4(7, 8, 9, 10))) ;
+
+
+ const struct s7 {
+ int i;
+ mat3 m3;
+ } s77 = s7(12, mat3(15));
+
+ vec2 v21 = vec2(1); // Not a constant
+ const vec2 v22 = vec2(11); // 11.0, 11.0
+ const vec4 v41 = vec4(2); // 2.0, 2.0, 2.0, 2.0
+ const vec4 v43 = vec4(4,4,4,4); // 4.0, 4.0, 4.0, 4.0
+ const vec4 v44 = vec4(5.0, 5.0, 5.0, 5.0); // 5.0, 5.0, 5.0, 5.0
+ const vec4 v45 = vec4(v22, v22); // 11.0, 11.0, 11.0, 11.0
+ const vec4 v46 = vec4(vec2(20, 21), vec2(22, 23)); // 20.0, 21.0, 22.0, 23.0
+
+ const vec3 v31 = vec3(s22.v3); // 9.0, 10.0, 11.0
+ const vec3 v32 = vec3(s77.m3); // 15.0, 0, 0
+ const vec3 v33 = vec3(s77.m3[2]); // 0, 0, 15.0
+ const vec3 v34 = vec3(s77.m3[2][0]); // 0,0,0
+
+
+ const mat4 m41 = mat4(1); // 1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1
+ const mat4 m42 = mat4(v44, v44, v44, v44); // all 5s
+ const mat4 m43 = mat4( v43.x); // 4,0,0,0,0,4,0,0,0,0,0,4,0,0,0,0,0,4
+
+ const vec4 v47 = vec4(m41[0][0]); // 1.0,1.0,1.0,1.0
+
+ const mat4 m45 = mat4(s22.v3, v44, v45, v32, 50, 52); //9,10,11,5,5,5,5,11,11,11,11,15.0, 0,0, 50.0, 52.0
+ //const mat3 m31 = mat3(1, mat2(1), 2.0, vec3(1)); // 1.0, 1,0,0,1,2,1,1,1
+ const vec4 v48 = vec4(v31[0], v22[1], v41[0], v43[3]); //9, 11, 2, 4
+ const vec4 v49 = vec4(s22.v3.xy, s22.v3.zx); // 9,10,11,9
+ const vec4 v410 = vec4(v44.xy, v43.zx); //5,5,4,4
+
+ const vec4 v411 = vec4(m42[3]); // 5,5,5,5
+ const vec4 v412 = vec4(m43[2]); // 0,0,4,0
+
+ const vec2 v23 = vec2(m41); // 1,0
+
+ const vec2 v24 = vec2(33, s11.i); // 33, 2
+
+ const vec4 v413 = vec4(vec2(1.0,2.0),ivec2(3.0,4.0)); // 1,2,3,4
+ const ivec4 i41 = ivec4(1.0, 2.0, 3.0, 4.0); // 1,2,3,4
+
+ const ivec4 i42 = ivec4(6); // 6,6,6,6
+ const ivec4 i43 = ivec4(v45); //11,11,11,11
+
+ const ivec4 i44 = ivec4(v44[0]); // 5,5,5,5
+ const ivec4 i45 = ivec4(vec2(20, 21), vec2(22, 23)); // 20, 21, 22, 23
+ const vec4 v414 = vec4(ivec2(29, 30), ivec2(31, 32)); // 29.0, 30.0, 31.0, 32.0
+ const ivec4 i46 = ivec4(ivec2(2.0,3.0), ivec3(4.0,5.0,6.0));
+ const ivec4 i47 = ivec4(i46); // 2,3,4,5
+ const ivec4 i48 = ivec4(v414.x); // 29,29,29,29
+
+ const ivec4 i49 = ivec4(vec4(1)); // 1,1,1,1
+ const ivec4 i414 = ivec4(mat4(14)); // 14, 0,0,0,
+ const ivec4 i410 = ivec4(m43); // 4,0,0,0
+ const ivec4 i411 = ivec4(m43[1]); // 0, 4, 0, 0
+ const ivec4 i412 = ivec4(s77.i); // 12, 12, 12, 12
+ const ivec4 i416 = ivec4(s22.v3.zyx, 12); // 11, 10, 9, 12
+
+ const vec4 v415 = vec4(ivec2(35), ivec2(36)); // 35.0, 35.0 ,36.0 , 36.0
+
+ const bvec4 b41 = bvec4(1.0, 2.0, 3.0, 4.0); // true,true,true,true
+
+ const bvec4 b42 = bvec4(6); // true,true,true,true
+ const bvec4 b43 = bvec4(v45); //true,true,true,true
+
+ const bvec4 b44 = bvec4(v44[0]); // true,true,true,true
+ const bvec4 b45 = bvec4(vec2(0, 21), vec2(0, 1)); // false, true, false, true
+ const bvec4 b46 = bvec4(ivec2(0.0,3.0), ivec3(0,5.0,6.0)); // false, true, false, true
+ const bvec4 b47 = bvec4(i46); // true,true,true,true
+ const bvec4 b48 = bvec4(v414.x); // true,true,true,true
+
+ const bvec4 b49 = bvec4(vec4(0)); // false,false,false,false
+ const bvec4 b414 = bvec4(mat4(14)); // true, false,false,false,
+ const bvec4 b410 = bvec4(m43); // true,false,false,false
+ const bvec4 b411 = bvec4(m43[1]); // false, true, false, false
+ const bvec4 b412 = bvec4(s77.i) ; // true, true, true, true
+
+ const vec3 v35 = vec3(s11.s44.v4); // 7.0,8.0,9.0
+
+
+ struct s10 {
+ int k;
+ };
+ struct s9 {
+ float f;
+ s10 s101;
+ };
+ const struct s8 {
+ int i;
+ s9 s99;
+ } s88 = s8(1, s9(2.0, s10(5)));
+
+ struct st4 {
+ int m;
+ vec3 v3;
+ };
+ struct st3 {
+ int k;
+ int l;
+ st4 st44;
+ };
+ struct st2 {
+ float f;
+ st3 st33;
+ };
+ const struct st1 {
+ int i;
+ st2 st22;
+ } st11 = st1(1, st2(2.0, st3(5, 6, st4(7, v35))));
+
+ const vec4 v416 = vec4(s88.s99.s101.k); // all 5s
+ const vec4 v417 = vec4(st11.st22.st33.st44.v3, s88.s99.s101.k); // 7.0, 8.0, 9.0, 5.0
+ const vec3 v36 = vec3(s11.ss.v3); // 9, 10, 11
+
+ vec4 v418 = v416; // all 5s
+ const float f1 = v416[0]; // 5.0
+ vec4 v419;
+ v419.xyz = st11.st22.st33.st44.v3;
+ mat4 m47;
+
+ struct struct2 {
+ int k;
+ } struct22 = struct2(4);
+
+ const struct struct1 {
+ struct2 sst2;
+ } struct11 = struct1(struct2(2));
+
+ const vec4 v420 = v417; // 7.0, 8.0, 9.0 , 5.0
+
+ vec4 v421 = vec4(s11.m); // 5, 0, 0, 0
+ vec4 v422 = v420; // 7.0, 8.0, 9.0 , 5.0
+
+ vec4 v423 = s11.s44.v4; // 7, 8, 9, 10
+
+ int int1 = ss.i * ss.i; // 16
+ int int2 = ss.i * 2; // 8
+
+ const vec4 v425 = v420 * v420; // 49, 64, 81, 25
+ const vec4 v426 = s11.m * s11.s44.v4; // 35, 40, 45, 50
+ const vec4 v427 = s11.s44.v4 * s11.m; // 35, 40, 45, 50
+
+ float ff = 2.0;
+ const float ffConst = 2.0;
+
+ vec4 v428 = ff + v425; // ordinary assignment with binary node
+ vec3 v39 = vec3(5);
+
+ vec3 v310 = s22.v3 + v39; //14, 15, 16
+
+ const vec4 v429 = v420 + v420; // 14, 16, 18, 10
+ const vec4 v430 = v420 + ffConst; // 9, 10, 11,7
+ const vec4 v432 = v429 + s11.f; // 18, 20, 22, 14
+
+ const vec4 v433 = vec4(s11.f + s11.f); // all 8s
+ const vec4 v434 = v432 + vec4(3); // 21, 23, 25, 17
+ const mat4 m48 = s11.m + ffConst; // diagonal 7s and others 2s
+ const mat4 m49 = mat4(ffConst + s11.f); // diagonal 6s
+ const mat4 m410 = m48 + s11.f; // diagonal 11, others - 6s
+
+ const mat4 m413 = m48 + m48 ; // diagonal 14, others 4
+ const mat4 m414 = m413 + ffConst ; // diagonal 16, others 6
+
+ const vec4 v435 = ffConst + v420; // 9, 10, 11,7
+ const vec4 v436 = s11.f + v429; // 18, 20, 22, 14
+ const mat4 m415 = ffConst + s11.m; // diagonal 7s and others 2s
+ const mat4 m416 = s11.f + m48 ; // diagonal 11, others - 6s
+ const mat4 m417 = ffConst + m413 ; // diagonal 16, others 6
+
+ const vec4 v437 = v420 - v420; // 0, 0, 0, 0
+ const vec4 v438 = v420 - ffConst; // 5, 6, 7,3
+ const vec4 v440 = v429 - s11.f; // 10, 12, 14, 6
+
+ const vec4 v441 = vec4(s11.f - s11.f); // all 0s
+ const vec4 v442 = v432 - vec4(3); // 15, 17, 19, 11
+ const mat4 m418 = s11.m - ffConst; // diagonal 3s and others -2s
+ const mat4 m419 = mat4(ffConst - s11.f); // diagonal -> -2s
+ const mat4 m420 = m48 - s11.f; // diagonal 3, others -> -2
+
+ const mat4 m423 = m48 - m48 ; // All 0s
+ const mat4 m424 = m413 - ffConst ; // diagonal 12, others 2
+
+ const vec4 v443 = ffConst - v420; // -5, -6, -7,-3
+ const vec4 v444 = s11.f - v429; // -10, -12, -14, -6
+ const mat4 m425 = ffConst - s11.m; // diagonal -3s and others 2s
+ const mat4 m426 = s11.f - m48 ; // diagonal -3, others 2s
+ const mat4 m427 = ffConst - m413 ; // diagonal -12, others -2
+
+ const vec4 v445 = v420 * v420; // 49, 64, 81, 25
+ const vec4 v446 = v420 * ffConst; // 14, 16, 18,10
+ const vec4 v448 = v429 * s11.f; // 56, 46, 72, 40
+
+ const vec4 v449 = vec4(s11.f * s11.f); // all 16
+ const vec4 v450 = v432 * vec4(3); // 54, 60, 66, 42
+ const mat4 m428 = s11.m * ffConst; // diagonal 10 and others 0s
+ const mat4 m429 = mat4(ffConst * s11.f); // diagonal 8
+ const mat4 m430 = m48 * s11.f; // diagonal 28, others 8
+
+ const mat4 m433 = m48 * m48 ; // diagonal 61, others 36
+ const mat4 m434 = m413 * ffConst ; // diagonal 28, others 8
+
+ const vec4 v451 = ffConst * v420; // 14, 16, 18,10
+ const vec4 v452 = s11.f * v429; // 56, 64, 72, 40
+ const mat4 m435 = ffConst * s11.m; // diagonal 10 and others 0s
+ const mat4 m436 = s11.f * m48 ; // diagonal 28, others - 8s
+ const mat4 m437 = ffConst * m413 ; // diagonal 28, others 8
+
+ const vec4 v453 = v420 / v420; // 1, 1, 1, 1
+ const vec4 v454 = v420 / ffConst; // 3.5, 4, 4.5,2.5
+
+ const vec4 v457 = vec4(s11.f / s11.f); // all 1s
+ const vec4 v458 = v432 / vec4(3); // 6, 6.6666, 7.333, 4.6666
+ const mat4 m438 = s11.m / ffConst; // diagonal 2.5 and others 0s
+ const mat4 m439 = mat4(ffConst / s11.f); // diagonal 0.5s
+ const mat4 m440 = m48 / s11.f; // diagonal 1.75, others 0.5s
+
+ const mat4 m443 = m48 / m48 ; // All 1s
+ const mat4 m444 = m413 / ffConst ; // diagonal 7, others 2
+
+ const vec4 v459 = ffConst / v420; // .2857 , .25, .22, .4
+ const vec4 v460 = s11.f / v429; // .2857, .25, .22, .4
+ //const mat4 m445 = ffConst / s11.m; // divide by zero error
+ const mat4 m446 = s11.f / m48 ; // diagonal .571, others 2
+ const mat4 m447 = ffConst / m413 ; // diagonal .1428, others 0.5
+
+ const vec4 v461 = v453 * m428; // 10, 10, 10, 10
+ const vec4 v462 = v453 * m437; // 52, 52, 52, 52
+ const vec4 v463 = m428 * v451; // 140, 160, 180, 100
+ const vec4 v464 = m437 * v451; // 744, 784, 824, 664
+
+ int ii = 2;
+ const int iiConst = 2;
+
+ const ivec4 i420 = ivec4( 7,8,9,5); // 7, 8, 9, 5
+
+ const ivec4 i429 = i420 + i420; // 14, 16, 18, 10
+ const ivec4 i430 = i420 + iiConst; // 9, 10, 11,7
+ const ivec4 i432 = i429 + ss.i; // 18, 20, 22, 14
+
+ const ivec4 i433 = ivec4(ss.i + ss.i); // all 8s
+
+ const ivec4 i435 = iiConst + i420; // 9, 10, 11,7
+ const ivec4 i436 = ss.i + i429; // 18, 20, 22, 14
+
+ const ivec4 i437 = i420 - i420; // 0, 0, 0, 0
+ const ivec4 i438 = i420 - iiConst; // 5, 6, 7,3
+ const ivec4 i440 = i429 - ss.i; // 10, 12, 14, 6
+
+ const ivec4 i441 = ivec4(ss.i - ss.i); // all 0s
+
+ const ivec4 i443 = iiConst - i420; // -5, -6, -7,-3
+ const ivec4 i444 = ss.i - i429; // -10, -12, -14, -6
+
+ const ivec4 i445 = i420 * i420; // 49, 64, 81, 25
+ const ivec4 i446 = i420 * iiConst; // 14, 16, 18,10
+ const ivec4 i448 = i429 * ss.i; // 56, 64, 72, 40
+
+ const ivec4 i449 = ivec4(ss.i * ss.i); // all 16
+
+ const ivec4 i451 = iiConst * i420; // 14, 16, 18,10
+ const ivec4 i452 = ss.i * i429; // 56, 64, 72, 40
+
+ const ivec4 i453 = i420 / i420; // 1, 1, 1, 1
+ const ivec4 i454 = i420 / iiConst; // 3, 4, 4,2
+ const ivec4 i456 = i429 / ss.i; // 3, 4, 4, 2
+
+ const ivec4 i457 = ivec4(ss.i / ss.i); // all 1s
+
+ const ivec4 i459 = iiConst / i420; // 0 , 0, 0,0
+ const ivec4 i460 = ss.i / i429; // 0, 0, 0,0
+
+ const bvec4 b424 = bvec4(s22.bv4);
+
+ const bool b1 = s22.bv4 == b424; // true
+ const bool b2 = i420 == i420; // true
+ const bool b3 = i420 == i445; // false
+ const bool b4 = v420 == v420; // true
+ const bool b5 = m430 == m434; // true
+
+ const vec4 v465 = -v420; // -7, -8, -9, -5
+ const mat4 m448 = -m447 ; // diagonal -.1428, others -0.5
+ const ivec4 i465 = -i456 ; // -3, -4, -4,-2
+
+ const bool b7 = s22 == s22;
+
+ const vec4 v466 = v432 + vec4(3,4,5,6); // 21, 24, 27, 20
+ const vec4 v467 = v432 + vec4(vec2(3,4),5,6); // 21, 24, 27, 20
+ const vec4 v468 = v432 + vec4(3, vec2(4, 5),vec2(6,7)); // 21, 24, 27, 20
+ const vec4 v469 = vec4(v468) + vec4(3) + v468 + vec4(s77.m3[2][0]); // 45, 51, 57, 43
+
+ const bool b8 = ss == ss; // true
+
+ struct st6 {
+ vec3 v;
+ };
+
+ struct st5 {
+ int i;
+ float f;
+ st6 st66;
+ } st55;
+
+ const st5 st551 = st5(2, 4.0, st6(vec3(7)));
+ const st5 st552 = st5(2, 4.0, st6(vec3(7)));
+
+ const bool b10 = st551 == st552; // true
+
+ const bool b11 = st551.st66 == st552.st66; // true
+
+ const st5 st553 = st5(2, 4.0, st6(vec3(8)));
+
+ const bool b12 = st551.st66 == st553.st66; // false
+ const bool b13 = st551 == st553; // false
+
+ const bool b14 = st551 != st552; // false
+ const bool b15 = st551.st66 != st552.st66; // false
+ const bool b16 = st551.st66 != st553.st66; // true
+ const bool b17 = st551 != st553; // true
+
+ const bool b18 = s22.bv4 != b424; // false
+ const bool b19 = i420 != i420; // false
+ const bool b20 = i420 != i445; // true
+ const bool b21 = v420 != v420; // false
+ const bool b22 = m430 != m434; // false
+
+ const int int10 = i420.xy.y; // 8
+
+ //float f = v470.x;
+
+
+
+ const int int13 = -ss.i;
+
+ const vec4 v474 = -vec4(0.5);
+
+ int int14 = ii++;
+ int array[3];
+ array[2];
+
+ const vec4 v478 = v466 * 2.0; // 42, 48, 54, 40
+
+ const vec4 v479 = iiConst > 1 ? v466 : v478; // 21, 24, 27, 20
+
+ const struct st7 {
+ int i;
+ bool b;
+ } st77 = st7(ss.i, true);
+
+ const vec4 v481 = vec4(st77.i);
+
+ const struct st8 {
+ int i;
+ } ;
+
+
+ const struct st9 {
+ s2 ss;
+ } st99 = st9(s22);
+
+ const vec3 v312 = st99.ss.v3; // 9, 10, 11
+ const vec4 v482 = mat4(1)[0]; // 1, 0, 0 , 0
+
+ const mat4 m450 = mat4(ss.i); // mat4(4)
+ const mat4 m451 = mat4(b20); // mat4(1)
+ const mat4 m452 = mat4(st77.b); // mat4(1)
+
+ const vec4 v483 = vec4(vec4(3).x); // 3,3,3,3
+ const mat4 m453 = mat4(vec4(5).x); // mat5(5)
+
+ const vec4 v484 = vec4(mat4(6)[1]); // 0,6,0,0
+ const mat4 m454 = mat4(mat4(6)[1][1]); // mat4(6)
+
+ const vec4 v485 = vec4(st7(8, true).b); // 1,1,1,1
+
+ const vec4 v487 = vec4(vec4(12, 13, 14, 15).ab, 12, 14);
+
+ int i20 = ss.i;
+ const vec4 v489 = -vec4(7,8,9,5); // -7, -8, -9, -5
+
+ gl_Position = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert
new file mode 100644
index 0000000000..e8d9b378e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectConstruct_vert.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+struct s {
+ float f;
+} s1 = s(1.0);
+
+struct s3 {
+ int i;
+} s3Inst;
+
+struct s2 {
+ float f;
+ s3 s3Inst;
+} s2Inst = s2(1.0, s3(1));
+
+void main()
+{
+ vec3 i = vec3(5.0, 4.0, ivec2(2.0, 1.0));
+ ivec4 v2 = ivec4(1.0);
+ vec4 v4 = vec4(v2);
+ bvec4 v5 = bvec4(v2);
+ vec3 v6 = vec3(v5);
+ vec3 v = vec3(2, 2.0, 1);
+ vec3 v1 = vec3(1.2, v);
+
+ mat3 m1 = mat3(v,v,v);
+ mat2 m2 = mat2(v, v6.x);
+
+ gl_Position = vec4(1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag
new file mode 100644
index 0000000000..9f7eb6a022
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension10_V100_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#version 100
+#extension extensionfoo : enable // warning extension not supported
+#extension extensionfoo : disable // warning extension not supported
+#extension extensionfoo : warn // warning extension not supported
+
+#extension all : disable // no error in the program
+#extension all : warn // no error in the program
+
+#extension extensionfoo : enable // warning extension not supported
+#extension extensionfoo : disable // warning extension not supported
+#extension extensionfoo : warn // warning extension not supported
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag
new file mode 100644
index 0000000000..34d497d433
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension1_V100_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#extension all : disable // no error in the program
+#extension all : warn // no error in the program
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag
new file mode 100644
index 0000000000..e013e85f89
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectExtension4_V100_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#extension extensionfoo : enable // warning extension not supported
+#extension extensionfoo : disable // warning extension not supported
+#extension extensionfoo : warn // warning extension not supported
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert
new file mode 100644
index 0000000000..30f14ad27b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFull_vert.vert
@@ -0,0 +1,654 @@
+
+/*
+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.
+*/
+
+
+struct gtf_MaterialParameters
+{
+vec4 emission;
+vec4 ambient;
+vec4 diffuse;
+vec4 specular;
+float shininess;
+};
+struct gtf_LightSourceParameters
+{
+vec4 ambient;
+vec4 diffuse;
+vec4 specular;
+vec4 position;
+vec4 halfVector;
+vec3 spotDirection;
+float spotExponent;
+float spotCutoff;
+float spotCosCutoff;
+float constantAttenuation;
+float linearAttenuation;
+float quadraticAttenuation;
+};
+struct gtf_PointParameters {
+float size;
+float sizeMin;
+float sizeMax;
+float fadeThresholdSize;
+float distanceConstantAttenuation;
+float distanceLinearAttenuation;
+float distanceQuadraticAttenuation;
+};
+struct gtf_DepthRangeParameters {
+float near;
+float far;
+float diff;
+};
+struct gtf_LightModelParameters {
+vec4 ambient;
+};
+struct gtf_LightModelProducts {
+vec4 sceneColor;
+};
+struct gtf_LightProducts {
+vec4 ambient;
+vec4 diffuse;
+vec4 specular;
+};
+struct gtf_FogParameters {
+vec4 color;
+float density;
+float start;
+float end;
+float scale;
+};
+uniform int gtf_MaxFragmentUniformComponents;
+uniform int gtf_MaxVertexUniformComponents;
+uniform int gtf_MaxVertexTextureImageUnits;
+uniform int gtf_MaxLights;
+uniform int gtf_MaxClipPlanes;
+uniform int gtf_MaxCombinedTextureImageUnits;
+uniform int gtf_MaxTextureCoords;
+uniform int gtf_MaxVertexAttribs;
+uniform int gtf_MaxVaryingFloats;
+uniform int gtf_MaxTextureUnits;
+uniform int gtf_MaxDrawBuffers;
+uniform int gtf_MaxTextureImageUnits;
+uniform gtf_LightProducts gtf_FrontLightProduct[8];
+uniform gtf_LightModelProducts gtf_FrontLightModelProduct;
+uniform gtf_DepthRangeParameters gtf_DepthRange;
+uniform gtf_FogParameters gtf_Fog;
+uniform gtf_PointParameters gtf_Point;
+uniform gtf_LightModelParameters gtf_LightModel;
+varying vec4 gtf_FogFragCoord;
+varying vec4 gtf_BackColor;
+varying vec4 gtf_BackSecondaryColor;
+varying vec4 gtf_FrontSecondaryColor;
+varying vec4 gtf_TexCoord[2];
+varying vec4 gtf_FrontColor;
+uniform gtf_MaterialParameters gtf_FrontMaterial;
+uniform gtf_LightSourceParameters gtf_LightSource[8];
+attribute vec4 gtf_MultiTexCoord1;
+attribute vec4 gtf_MultiTexCoord2;
+attribute vec4 gtf_SecondaryColor;
+attribute vec4 gtf_Color;
+attribute vec4 gtf_MultiTexCoord3;
+attribute vec4 gtf_MultiTexCoord0;
+attribute vec4 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_NormalMatrix;
+uniform mat4 gtf_ProjectionMatrix;
+uniform mat4 gtf_TextureMatrix[8];
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+void test_function(const in int in_int, inout int out_int);
+int test_function1(in int in_int1, inout int in_out_int);
+
+uniform float array_float[2];
+
+struct nested
+{
+ int a;
+ float f;
+};
+
+struct light1
+{
+ float intensity;
+ vec3 position;
+ int test_int[2];
+ nested light2;
+} lightVar;
+light1 ll2;
+
+void Assign (out light1 out1, in light1 in1)
+{
+ out1.intensity = in1.intensity;
+ out1.position = in1.position;
+ out1.test_int[0] = in1.test_int[0];
+ out1.test_int[1] = in1.test_int[1];
+ out1.light2 = in1.light2;
+}
+
+struct light3 {
+ float i;
+};
+
+struct light4 {
+ float i;
+};
+
+struct light5 {
+ float i ;
+ float a[2];
+} light5_inst;
+
+uniform light3 uniformLight3;
+
+struct light6 {
+ float i;
+};
+uniform light6 uniformLight6;
+
+struct slight10{
+ float f;
+ };
+struct slight9{
+ slight10 light10;
+ };
+struct slight8{
+ slight9 light9;
+ };
+struct light7 {
+ slight8 light8;
+} ;
+
+
+light3 struct_var = light3(5.0);
+
+// Attribtue variables can only be Global
+attribute float flt_attrib;
+attribute vec2 vec2_attrib;
+attribute vec3 vec3_attrib;
+attribute vec4 vec4_attrib;
+attribute mat2 mat2_attrib;
+attribute mat3 mat3_attrib;
+attribute mat4 mat4_attrib;
+
+uniform float flt_uniform;
+uniform vec3 uniform_vec3;
+uniform mat3 uniform_mat3;
+
+uniform sampler2D samp[3];
+uniform sampler2D samp1;
+
+const struct light12 {
+ int a;
+} uniform_struct = light12(2);
+
+varying vec3 varying_vec3;
+varying vec2 varying_vec2;
+varying vec4 varying_vec4;
+varying mat4 varying_mat4;
+varying mat2 varying_mat2;
+varying mat3 varying_mat3;
+varying float varying_flt;
+
+float frequencies[2];
+
+void test_function2(int func_int)
+{
+}
+
+void test_function3(light3);
+void test_function4(light5 ll20);
+void test_function5(light1);
+light6 test_function6(int a);
+
+const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0;
+const bool BoolConst1 = true && true || false;
+const bool BoolConst2 = false || !false && false;
+
+void main(void)
+{
+
+ int test_int1 = 2;
+ const int const_test_int1 = 2;
+
+ struct structMain {
+ float i;
+ } testStruct;
+
+ struct {
+ structMain a;
+ } aStruct;
+
+ testStruct.i = 5.0 ;
+ struct_var.i = 5.0;
+
+ structMain newStruct, newStruct1;
+ testStruct = newStruct;
+ newStruct = newStruct1;
+
+ lightVar.light2.f = 1.1;
+
+ light1 ll1;
+ ll1.light2.a = 1;
+
+ const struct const_struct {
+ float i;
+ } const_struct_inst = const_struct(1.0);
+
+ //ll1 = ll2;
+ Assign (ll1, ll2);
+ ll1.light2 = ll2.light2;
+ ll1.light2 = ll1.light2;
+ ll1.light2.f = ll2.light2.f;
+ ll1.light2.f = ll1.light2.f;
+
+ // lightVar = ll2;
+ // ll2 = lightVar;
+ Assign (lightVar, ll2);
+ Assign (ll2, lightVar);
+
+ light5 ll10;
+
+ light7 ll7[4];
+ structMain newStruct2[2];
+ newStruct2[0].i = 1.1;
+
+ ll7[0].light8.light9.light10.f = 1.1;
+
+
+ bool test_bool4 = false ;
+
+ bool test_bool5 = 1.2 > 3.0 ;
+
+ int test_int2 = 047;
+ int test_int4 = 0xa8; // testing for hexadecimal numbers
+
+ float test_float1 = 1.5;
+ float test_float2 = .01;
+ float test_float3 = 10.;
+ float test_float4 = 10.01;
+ float test_float5 = 23e+2;
+ float test_float6 = 23E-3;
+ float test_float8 = 23E2;
+ bool test_bool6 = BoolConst1 && ! (test_int1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (test_float1 != 0.0);
+
+ vec4 color = vec4(0.0, 1.0, 0.0, 1.0);
+ vec4 color2 = vec4(0.0);
+
+ vec3 color4 = vec3(test_float8);
+
+ ivec4 test_int_vect1 = ivec4(1.0,1.0,1.0,1.0);
+ ivec3 test_int_vec3 = ivec3(1, 1, 1) ;
+
+ bvec4 test_bool_vect1 = bvec4(1., 1., 1. , 1. );
+
+ vec2 test_vec2 = vec2(1., 1.);
+ vec2 test_vec3 = vec2(1., 1);
+ vec4 test_vec4 = vec4(test_int_vect1);
+
+ vec2 test_vec5 = vec2(color4);
+ vec3 test_vec7 = vec3(color);
+ vec3 test_vec8 = vec3(test_vec2, test_float4);
+ vec3 test_vec9 = vec3(test_float4, test_vec2);
+
+ vec4 test_vec10 = vec4(test_vec9, 0.01);
+ vec4 test_vec11 = vec4(0.01, test_vec9);
+
+ vec4 test_vec12 = vec4(test_vec2, test_vec2);
+
+ mat2 test_mat2 = mat2(test_float3);
+ mat3 test_mat3 = mat3(test_float3);
+ mat4 test_mat4 = mat4(test_float3);
+
+ mat2 test_mat7 = mat2(test_vec2, test_vec2);
+ mat2 test_mat8 = mat2(01.01, 2.01, 3.01, 4.01);
+
+ mat3 test_mat9 = mat3(test_vec7, test_vec7, test_vec7);
+ mat4 test_mat10 = mat4(test_vec10, test_vec10, test_vec10, test_vec10);
+ test_mat10[1] = test_vec10;
+
+
+ mat2 test_mat12 = mat2(test_vec2, 0.01, 0.01);
+ mat2 test_mat13 = mat2(0.01, 5., test_vec2);
+ mat2 test_mat15 = mat2(0.1, 5., test_vec2 );
+
+ //mat2 test_mat16 = mat2(test_mat9);
+ //mat2 test_mat17 = mat2(test_mat10);
+
+ float freq1[2];
+ float freq2[25];
+
+ for (int i=0; i<100; i++)
+ {
+ if (test_float1 < 1.0)
+ {
+
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ freq2[1] = 1.9 ;
+ const int array_index = 2;
+ freq2[const_test_int1] = 1.9 ;
+ freq2[array_index] = 1.8;
+
+ const int const_int = 5;
+
+ test_float1 = varying_flt;
+
+ int out_int;
+ int intArray[6];
+ test_function(test_int1, test_int1);
+ test_function(test_int1, intArray[2]);
+
+ vec3 vv = vec3(test_function1(test_int1, out_int));
+ bool bool_var = true;
+ int test_int6 = int(bool_var);
+ test_float1 = float(bool_var);
+ test_float1 = float(test_int6);
+ test_int6 = int(test_float1);
+ bool_var = bool(test_int6);
+ bool_var = bool(test_float1);
+ test_float1 = float(test_vec9);
+
+ test_vec2.x = 1.2;
+ test_vec2.y = 1.4;
+ test_vec2.xy;
+
+
+ color.zy = test_vec2;
+
+ test_vec2[1] = 1.1;
+
+ test_mat2[0][0] = 1.1;
+
+ test_float1 += 1.0;
+ test_float1 -= 1.0;
+ test_float1 *= 1.0;
+ test_float1 /= 1.0;
+
+ test_mat12 *= test_mat13 ;
+ test_mat12 *= test_float1;
+ test_vec2 *= test_float1;
+ test_vec2 *= test_mat12;
+ test_float1++;
+ test_float1--;
+ --test_float1;
+ ++test_float1;
+ test_float1;
+ test_int1++;
+ test_int1--;
+
+ test_vec2 = test_vec2 + test_float1;
+ test_vec2 = test_float1 + test_vec2;
+
+ test_mat12 = test_mat12 * test_mat13;
+ test_vec2 = test_vec2 * test_vec5;
+
+ test_vec2++;
+ test_mat2++;
+
+ bool test_bool2 = test_float2 > test_float3;
+
+ bool test_bool3 = test_int1 > test_int6 ;
+
+ test_bool3 = test_vec2 == test_vec5;
+
+ test_bool2 = test_bool3 && test_bool4;
+ test_bool2 = test_bool3 || test_bool4;
+ test_bool2 = test_bool3 ^^ test_bool4;
+
+ test_bool2 = !test_bool3;
+
+ test_bool3 = !(test_int1 > test_int6) ;
+
+ test_float1 = test_int1 > test_int6 ? test_float2 : test_float3;
+ test_vec2 = test_int1 > test_int6 ? test_vec2 : test_vec5;
+ if(test_bool2)
+ test_float1++;
+ else
+ test_float1--;
+
+ if(test_float1 > test_float2)
+ test_float1++;
+
+ if( test_bool2 )
+ {
+ int if_int;
+ test_float1++;
+ }
+
+ if(test_bool2)
+ if(test_bool3)
+ if(test_bool3)
+ test_float1++;
+
+ for(int for_int=0; for_int < 5; for_int++)
+ {
+ // do nothing as such
+ }
+
+
+ for(int x1=0; x1 < 10; x1++)
+ {
+ if (!test_bool2)
+ break;
+
+ int for_int;
+ }
+
+ for(int x2=-10; x2 < 100; x2++)
+ {
+ test_bool2 = (test_float1 > test_float2);
+ if (!test_bool2)
+ break;
+ }
+
+ for(int for_int1 = 0; for_int1 < 100; for_int1++)
+ {
+ if (!test_bool2)
+ break;
+
+ int for_int;
+ }
+
+ for(int for_int1 = 0; for_int1 < 100; for_int1++)
+ {
+ if (!test_bool2)
+ continue;
+
+ int for_int;
+ }
+
+
+ for(int i=0; i<100; i++)
+ {
+ if (!(test_float1 > test_float2))
+ {
+ break;
+ }
+
+ break;
+ continue;
+ }
+
+ for(int i=0; i<100; i++)
+ {
+ if (!test_bool2)
+ break;
+
+ break;
+ }
+
+ for (int i=0; i<100; i++)
+ {
+ int dowhile_int;
+ dowhile_int = 3;
+
+ if (!test_bool2)
+ break;
+ }
+
+ gl_Position = vec4(2.0, 3.0, 1.0, 1.1);
+ gl_Position = gtf_Vertex;
+
+
+ // VERTEX SHADER BUILT-IN ATTRIBUTES
+
+ vec4 builtInV4 = gtf_Color + gtf_SecondaryColor + gtf_Vertex + gtf_MultiTexCoord0 + gtf_MultiTexCoord1 + gtf_MultiTexCoord2 + gtf_MultiTexCoord3;
+
+
+ int builtInI = gtf_MaxLights + gtf_MaxClipPlanes + gtf_MaxTextureUnits + gtf_MaxTextureCoords + gtf_MaxVertexAttribs + gtf_MaxVertexUniformComponents + gtf_MaxVaryingFloats + gtf_MaxVertexTextureImageUnits + gtf_MaxCombinedTextureImageUnits + gtf_MaxTextureImageUnits + gtf_MaxFragmentUniformComponents + gtf_MaxDrawBuffers ;
+
+
+ mat4 builtInM4 = gtf_ModelViewMatrix + gtf_ModelViewProjectionMatrix + gtf_ProjectionMatrix;
+
+ gtf_NormalMatrix;
+
+ gtf_TextureMatrix[gtf_MaxTextureCoords-1];
+ gtf_TextureMatrix;
+
+ gtf_DepthRange.near ;
+
+ test_float1 = gtf_DepthRange.near;
+ test_float1 = gtf_DepthRange.far;
+ test_float1 = gtf_DepthRange.diff;
+
+ gtf_Point.size;
+ gtf_Point.sizeMin;
+ gtf_Point.sizeMax;
+ gtf_Point.fadeThresholdSize ;
+ gtf_Point.distanceConstantAttenuation;
+ gtf_Point.distanceLinearAttenuation ;
+ gtf_Point.distanceQuadraticAttenuation;
+
+ gtf_MaterialParameters test;
+ gtf_FrontMaterial.emission;
+
+ color = gtf_FrontMaterial.emission;
+ color = gtf_FrontMaterial.ambient;
+ color = gtf_FrontMaterial.diffuse;
+ color = gtf_FrontMaterial.specular;
+ test_float1 = gtf_FrontMaterial.shininess;
+
+ gtf_LightSourceParameters lightSource;
+
+ float builtInFloat1 = gtf_LightSource[0].spotExponent;
+ color = gtf_LightSource[0].ambient;
+ color = lightSource.ambient;
+ color = lightSource.diffuse;
+ color = lightSource.specular;
+ color = lightSource.position;
+ color = lightSource.halfVector;
+ color4 = lightSource.spotDirection;
+ test_float1 = lightSource.spotExponent;
+ test_float1 = lightSource.spotCutoff;
+ test_float1 = lightSource.spotCosCutoff;
+ test_float1 = lightSource.constantAttenuation;
+ test_float1 = lightSource.linearAttenuation;
+ test_float1 = lightSource.quadraticAttenuation;
+
+ color = gtf_LightModel.ambient;
+
+ gtf_LightModelParameters lightModel;
+ color = gtf_LightModel.ambient;
+ color = lightModel.ambient;
+
+ color = gtf_FrontLightModelProduct.sceneColor ;
+
+ gtf_LightModelProducts lightModelProd;
+
+ color = lightModelProd.sceneColor;
+ color = gtf_FrontLightModelProduct.sceneColor;
+
+ color = gtf_FrontLightProduct[0].ambient;
+ color = gtf_FrontLightProduct[0].ambient;
+ gtf_LightProducts lightProd;
+
+ color = lightProd.ambient;
+ color = lightProd.diffuse;
+ color = lightProd.specular;
+
+
+ test_float1 = gtf_Fog.density ;
+ test_float1 = gtf_Fog.start ;
+ test_float1 = gtf_Fog.end ;
+ test_float1 = gtf_Fog.scale ;
+ color = gtf_Fog.color ;
+
+ gtf_FrontColor = vec4(1.0, 1.0, 1.0, 1.0);
+ gtf_BackColor = vec4(1.0, 1.0, 1.0, 1.0);
+ gtf_FrontSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0);
+ gtf_BackSecondaryColor = vec4(1.0, 1.0, 1.0, 1.0);
+
+
+ // VARYING VARIABLES AVAILABLE IN FRAGMENT AND VERTEX SHADERS BOTH
+ gtf_TexCoord[0] = vec4(1.0, 1.0, 1.0, 1.0);
+ gtf_FogFragCoord = vec4(1.0, 1.0, 1.0, 1.0);
+
+}
+
+void test_function(const in int in_int, inout int out_int)
+{
+ out_int = 5;
+ int i = 5;
+ return ;
+}
+
+int test_function1(in int in_int1, inout int in_out_int)
+{
+ float ff;
+ in_int1 = 5;
+ return in_int1;
+}
+
+void test_function3(light3 ll)
+{
+ ll.i = 5.0;
+ varying_flt = 1.2;
+}
+
+void test_function4(light5 ll20)
+{
+ ll20.i = 10.0;
+}
+
+void test_function5(light1 struct_light1)
+{
+ struct_light1.light2.a = 1;
+ light5 ll5;
+ struct_light1.light2.f = ll5.i;
+ struct_light1.light2.f++;
+ struct_light1.light2.a++;
+}
+
+light6 test_function6(int a)
+{
+ int x;
+ light6 funcStruct;
+ light7 funcStruct1;
+ -x;
+ x = x - x ;
+ mat2 m;
+ m++;
+ -m;
+ (m)++;
+ return funcStruct;
+}
+
+float test_function7(light1 ll1, int light1 )
+{
+ float f;
+
+ struct ss1 {
+ int a;
+ };
+
+ return float(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag
new file mode 100644
index 0000000000..58e9a9554b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_frag.frag
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void testVoid (vec4 v, vec4 v1)
+{
+}
+
+void testVoid (ivec4 v, ivec4 v1)
+{
+}
+
+void main(void)
+{
+ vec4 v;
+ ivec4 i;
+ testVoid(i, i);
+ testVoid(v, v);
+ gl_FragColor = v;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert
new file mode 100644
index 0000000000..752f7e607b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFuncOverload_vert.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+struct S2
+{
+ float f;
+};
+
+struct S1
+{
+ float f;
+ S2 s2;
+};
+
+float process(S1 s1);
+float process(S2 s2);
+
+void main()
+{
+ S1 s1 = S1(1.0, S2(1.0));
+ gl_Position = vec4(process(s1));
+}
+
+float process(S1 s1)
+{
+ return s1.f + process(s1.s2);
+}
+
+float process(S2 s2)
+{
+ return s2.f;
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert
new file mode 100644
index 0000000000..f384cc57b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectFunction1_vert.vert
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+vec3 bar(vec3, vec3);
+
+uniform vec2 v;
+
+bool foo(out vec3);
+
+void main()
+{
+ bool b1, b2, b3, b4, b5, b6;
+
+ b1 = any(lessThan(v, v));
+
+ b2 = all(lessThanEqual(v, v));
+
+ b3 = any(not(greaterThan(v, v)));
+
+ b4 = any(greaterThanEqual(v, v));
+
+ b5 = any(notEqual(v, v));
+
+ b6 = any(equal(v, v));
+
+ vec2 u;
+ if (b1 && b2 && b3 && b4 && b5 && b6)
+ u = v;
+
+ gl_Position = vec4(u, u);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag
new file mode 100644
index 0000000000..d3bc69815f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectModule_frag.frag
@@ -0,0 +1,64 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+vec4 test_function4(float);
+vec4 test_function1(float);
+vec4 test_function2(float);
+vec4 test_function3(float);
+float f = 2.6;
+
+
+vec4 test_function1(float ff)
+{
+ vec4 func_vec4 = vec4(ff+f);
+ return func_vec4;
+}
+
+float f1 = 1.5;
+
+vec4 test_function4(float ff)
+{
+ vec4 func_vec4 = vec4(f1);
+ return func_vec4;
+}
+
+float f2 = 3.5;
+
+void main()
+{
+ vec4 v1 = test_function4(f2);
+ vec4 v2 = test_function1(f2);
+ vec4 v3 = test_function2(f2);
+ vec4 v4 = test_function3(f2);
+
+ if (f1 > f2) {
+ gl_FragColor = v1 + v2 + v3 + v4;
+ } else
+ gl_FragColor = v1 + v2 + v3 + v4;
+}
+
+float f4 = 5.5;
+vec4 test_function3(float ff)
+{
+ if (ff > f4)
+ return vec4(ff);
+ else
+ return vec4(f4);
+}
+
+float f3 = 4.5;
+vec4 test_function2(float ff)
+{
+ vec4 func_vec4 = vec4(ff+f3);
+ return func_vec4;
+}
+
+float f5 = 6.5;
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag
new file mode 100644
index 0000000000..65a9fb07fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse1_frag.frag
@@ -0,0 +1,51 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec3 a[8];
+
+uniform bool ub;
+varying mat4 vm;
+
+int foo(float);
+
+float bar(int i)
+{
+ return float(i);
+}
+
+void main (void)
+{
+ const int x = 3;
+ mat4 a[4];
+ vec4 v;
+
+ for (float f = 0.0; f != 3.0; ++f)
+ {
+ }
+
+ vec3 v3[x + x];
+
+ int vi = foo(2.3);
+
+ vec3 v3_1 = v3[x];
+
+ float f1 = a[x][2].z * float(x);
+ f1 = a[x][2][2] * float(x);
+ f1 = v[2] * v[1];
+
+ const int ci = 2;
+
+}
+
+int foo(float f)
+{
+ return 2;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag
new file mode 100644
index 0000000000..6bfe2ec57a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_frag.frag
@@ -0,0 +1,136 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0;
+const bool BoolConst1 = true && true || false;
+const bool BoolConst2 = false || !false && false;
+
+void main (void)
+{
+ float float1 = 4.0, float2 = floatConst2;
+ int int_1 = int(FloatConst1);
+ vec4 vec4_1;
+ vec3 vec3_1;
+// unsigned int unsigned_int_1;
+ bool bool4, bool5;
+
+ bool4 = bool5;
+ //float1 = bool5;
+ //bool5 = float1;
+
+ bool4 = 4.0 > 5.0;
+ bool4 = !(3.2 != 0.0);
+ bool4 = bool(float1);
+ bool4 = bool(int_1);
+ float1 = float(bool4);
+ float1 = float(int_1);
+ int_1 = int(float1);
+ int_1 = int(bool4);
+
+ {
+ int a, b, c;
+
+ a = b;
+ b = c;
+ {
+ int b, c, d;
+
+ b = c;
+ c = d;
+ {
+ int a, d, e;
+
+ a = d;
+ d = e;
+ }
+ {
+ int a, b, c;
+ a = b;
+ b = c;
+ }
+ }
+ a = b;
+ b = c;
+ }
+
+ {
+ float f1, f2;
+ vec3 v31, v32;
+
+ max(f1, f2);
+ max(v31, v32);
+
+ vec4 v4 = vec4(3.0);
+ vec3 v3 = -vec3(2.0, 1.0, 3.0);
+ mat2 m2 = mat2(3.0, 4.0, 6.0, 3.0);
+ //mat4 m4 = mat4(1.0, m2, v3, v4, m2);
+ }
+
+ if (BoolConst1)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (BoolConst2)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (BoolConst1 || BoolConst2)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (BoolConst2 && BoolConst1)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (FloatConst1 != 0.0)
+ --int_1;
+ else
+ ++int_1;
+
+ if (0 != 0)
+ ++int_1;
+ else
+ --int_1;
+
+ bool4 = BoolConst1 && ! (int_1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (float1 != 0.0);
+
+ float1 = 5 != 0 ? float1 : float(int_1);
+ float1 = 0 != 0 ? float1 : float(int_1);
+
+ if (float1 != float1)
+ ++int_1;
+ else
+ --int_1;
+
+ float1 = float1 != float1 ? float1 : float(int_1);
+
+ --int_1;
+ ++float1;
+ (vec4_1.x)--;
+ vec3_1++;
+
+ if (int_1 != 4)
+ discard;
+
+ float1 = 4.0 + 6.0;
+ int ii,jj,kk;
+ float ff;
+ ii = jj, kk, ff;
+
+ vec4_1 = vec4_1 + 2.0;
+ ivec4 iv;
+ iv = iv + 2;
+ gl_FragColor = vec4(float1+float1, float1, float1, float(int_1));
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert
new file mode 100644
index 0000000000..d2686442a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParse2_vert.vert
@@ -0,0 +1,149 @@
+
+/*
+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.
+*/
+
+
+const float FloatConst1 = 3.0 * 8.0, floatConst2 = 4.0;
+const bool BoolConst1 = true && true || false;
+const bool BoolConst2 = false || !false && false;
+
+void main (void)
+{
+ float float1 = 4.0, float2 = floatConst2;
+ int int_1 = int(FloatConst1);
+ vec4 vec4_1;
+ vec3 vec3_1 = vec3(1, 1, 1);
+ vec3 vec3_2 = vec3(0, 0, 0);
+// unsigned int unsigned_int_1;
+ bool bool4, bool5;
+
+ bool4 = bool5;
+ //float1 = bool5;
+ //bool5 = float1;
+
+ bool4 = 4 > 5;
+ bool4 = !(3.2 != 0.0);
+ bool4 = bool(float1);
+ bool4 = bool(int_1);
+ float1 = float(bool4);
+ float1 = float(int_1);
+ int_1 = int(float1);
+ int_1 = int(bool4);
+
+ {
+ int a, b, c;
+
+ a = b;
+ b = c;
+ {
+ int b, c, d;
+
+ b = c;
+ c = d;
+ {
+ int a, d, e;
+
+ a = d;
+ d = e;
+ }
+ {
+ int a, b, c;
+ a = b;
+ b = c;
+ }
+ }
+ a = b;
+ b = c;
+ }
+
+ {
+ float f1, f2;
+ vec3 v31, v32;
+
+ max(f1, f2);
+ max(v31, v32);
+
+ vec4 v4 = vec4(3.0);
+ vec3 v3 = -vec3(2.0, 1.0, 3.0);
+ mat2 m2 = mat2(3.0, 4.0, 6.0, 3.0);
+ //mat4 m4 = mat4(1.0, m2, v3, v4, m2);
+ }
+
+ if (BoolConst1)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (BoolConst2)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (BoolConst1 || BoolConst2)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (BoolConst2 && BoolConst1)
+ ++vec3_1;
+ else
+ --vec3_1;
+
+ if (FloatConst1 != 0.0)
+ --int_1;
+ else
+ ++int_1;
+
+ if (0 != 0)
+ ++int_1;
+ else
+ --int_1;
+
+ bool4 = BoolConst1 && ! (int_1 != 0) && ! BoolConst1 && ! (FloatConst1 != 0.0) && (FloatConst1 != 0.0) && (float1 != 0.0);
+
+ float1 = 5 != 0 ? float1 : float(int_1);
+ float1 = BoolConst1 ? float1 : float(int_1);
+
+ if (float1 != float1)
+ ++int_1;
+ else
+ --int_1;
+
+ float1 = float1 != float1 ? float1 : float(int_1);
+
+ --int_1;
+ ++float1;
+ (vec4_1.x)--;
+ vec3_1++;
+
+ if (vec3_1.x > vec3_2.x)
+ float1 = 4.0 + 6.0;
+
+ if (bool4 ^^ bool5)
+ float1 *= 2.4;
+
+ if (false ^^ false)
+ float1 *= 2.5;
+
+ if (true ^^ false)
+ float1 *= 2.6;
+
+ {
+ int i;
+ }
+
+ if (bool4) {
+ int i;
+ } else {
+ int i;
+ i = 5;
+ }
+
+ mat4 m1;
+ m1[2][1] = 4.0;
+
+ gl_Position = vec4(float1+float1, float1, float1, float(int_1));
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag
new file mode 100644
index 0000000000..05c106103b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest1_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ vec4 v;
+} s2;
+
+void main()
+{
+ s s1 = s(vec4(ivec4(4.0, vec2(5,6), 7.0)));
+ vec4 v = vec4(2,ivec2(3.0, 4.0), 5.0);
+ vec4 v4 = vec4(ivec4(8.0));
+
+ gl_FragColor = v4 + v + s1.v;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag
new file mode 100644
index 0000000000..46b6ddc601
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectParseTest_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s{
+ float f;
+ vec3 v;
+} s1 ;
+void main()
+{
+ vec4 v = vec4(float(vec2(1,2)), 5,6,7); // 1, 5, 6, 7
+ vec4 v1 = vec4(3, vec2(ivec2(1,2)), 4); // 3, 1, 2, 4
+ vec4 v2 = vec4(8, 9, vec4(ivec4(1,2,3,4))); // 8,9, 1,2
+ vec2 v3 = vec2(v2); // 8,9
+ vec4 v4 = vec4(v3, v2.z, v2.w); // 8,9,1,2
+
+ const vec4 v5 = vec4(2.0, s(2.0, vec3(3,4,5)).v); // 2,3,4,5
+ gl_FragColor = v5 + v + v1 + v4 ; // 14, 18, 13, 18
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag
new file mode 100644
index 0000000000..1dbac1a011
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess5_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//mutiple line macros - test case.
+
+#define test 5
+#define t1 1
+#define t2 2
+#define token (t1+t2)
+#define test1 int sum =1; sum = test; sum = test+test;
+
+#define test2 { test1 sum = sum +token; sum = t2*t1; }
+
+void main(void)
+{
+ int test3=1;
+ test1
+ test2;
+ test3 = test;
+ sum = test3;
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag
new file mode 100644
index 0000000000..01a3466e9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess8_frag.frag
@@ -0,0 +1,115 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// Extensive testing on #if #else #elif #ifdef, #ifndef and #endif.
+
+
+#define t1 1
+
+#if(t1==1)
+ #define t2 2
+#endif
+
+#if (t2!=2)
+ #define t3 33
+#else
+ #define t3 3
+#endif
+
+#if (t3!=3)
+ #define t4 4
+#elif (t3==3)
+ #define t4 44
+#else
+ #define t4 0
+#endif
+
+#if defined(t5)
+ #define t6 6
+#elif (t3!=3)
+ #define t5 5
+#elif (t3==3)
+ #define t5 5
+#endif
+
+#ifdef t5
+ #define t6 6
+#else
+ #define t7 7
+#endif
+
+#ifndef t8
+ #define t8 8
+#endif
+
+#if defined t8
+ #define t9
+ #ifdef t9
+ #define t10 10
+ #endif
+#elif
+ #define t11 11
+#endif
+
+#ifndef t8
+ #define t12 12
+#else
+ #define t12 12
+ #ifndef t13
+ #define t13 13
+ #endif
+ #ifdef t14
+ #define t15 15
+ #else
+ #if defined t8
+ #define t16 16
+ #endif
+ #endif
+#endif
+
+#ifdef t1
+ #ifdef t10
+ #if defined t8
+ #if defined(t3)
+ #ifndef t20
+ #define t25 25
+ #endif
+ #else
+ #define t15 15
+ #define t24 24
+ #endif
+ #endif
+ #endif
+#else
+ #ifdef t21
+ #define t22 22
+ #else
+ #define t23 23
+ #endif
+#endif
+#define t7 7
+#define t11 11
+#define t14 14
+#define t15 15
+#define t20 20
+#define t22 22
+#define t23 23
+#define t24 42
+
+void main(void)
+{
+ int sum =0;
+ sum = t1+t2+t3+t4+t5;
+ sum = t6+t7+t8+t9+t10;
+ sum = t11+t12+t13+t14+t15;
+ sum = t16+t20+t22+t23+t25+t24;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag
new file mode 100644
index 0000000000..4946312934
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectPreprocess9_frag.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#define t1 2.3333333333333333
+#define t2 (0.978293600-1.0)
+#define t3 .9090909090
+#define t4 26578235.000000083487
+#define t5 78e-03
+#define t6 78.100005E+05
+#define t7 6278.78e-5
+
+void main(void){
+ float tes=2e-3;
+ float test=3.2e-5;
+ float test1=0.99995500;
+ float test2=6789.983;
+
+ test = t1+t2;
+ test = t3-t4;
+ tes = t5 * t6;
+ test2 = t7;
+
+ gl_FragColor = vec4(test, tes, test1, test2);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag
new file mode 100644
index 0000000000..9226f186c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v = vec2(1,5);
+ // at the end of next statement, values in
+ // v.x = 12, v.y = 12
+ v.xy += v.yx += v.xy;
+ // v1 and v2, both are initialized with 12
+ vec2 v1 = v, v2 = v;
+
+ v1.xy += v2.yx += ++(v.xy); // v1 = 37, v2 = 25 each
+ v1.xy += v2.yx += (v.xy)++; // v1 = 75, v2 = 38 each
+ gl_FragColor = vec4(v1,v2); // 75, 75, 38, 38
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert
new file mode 100644
index 0000000000..06ce3b3ee3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle1_vert.vert
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Normal;
+uniform mat4 gtf_NormalMatrix;
+void main(void)
+{
+ vec4 v = vec4(1,2,3,4);
+ vec3 v3 = vec3(5,6,7);
+ vec4 v4 = vec4(normalize(v3.yzy).xyz.zyx, 1.0);
+ gl_Position = v4 + vec4(normalize(gtf_NormalMatrix * gtf_Normal).xyz.zyx, v4.y);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag
new file mode 100644
index 0000000000..24074aa2a7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_frag.frag
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f, f1, f2;
+ f = f1 = f2;
+ f += f1 += f2;
+
+ vec4 v, v1, v2;
+ v = v1 = v2;
+ v += v1 += v2;
+ v.wx = v1.zx = v2.yx;
+ v.wx += v1.zx += v2.yx;
+
+ mat4 m, m1, m2;
+ m = m1 = m2;
+ m += m1 += m2;
+ m[3].wx = m1[2].zx = m2[1].yx;
+ m[3].wx += m1[2].zx += m2[1].yx;
+
+ mat4 am[4], am1[4], am2[4];
+ am[3] = am1[2] = am2[1];
+ am[3] += am1[2] += am2[1];
+ am[3][3].wx = am1[2][2].zx = am2[1][1].yx;
+ am[3][3].wx += am1[2][2].zx += am2[1][1].yx;
+ am[3][3].wx += am1[2][2].zx += ++(am2[1][1].yx);
+ am[3][3].wx += am1[2][2].zx += (am2[1][1].yx)++;
+
+ gl_FragColor = vec4(am[3][3].z, m[3].w, v.w, f);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert
new file mode 100644
index 0000000000..b197cc0bac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle2_vert.vert
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ vec4 v1 = vec4(5,6,7,8);
+ vec4 v2 = vec4(9,10, 11, 12);
+ vec3 v3 = (v1 * v2).ywx;
+ float f = (v2 * v1).z;
+ vec3 v4 = normalize((v1.ywx * v3).xyz).xyz;
+ gl_Position = vec4(v4, f);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag
new file mode 100644
index 0000000000..4f2665c13e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectSwizzle3_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec4 v = vec4(5,6,7,8);
+ // value changes for lhs
+ // 8765, 6758, 857, 75 i.e. replace v.zx
+ // value changes for rhs
+ // 8765, 6758, 86 i.e replace with v.wy
+ // replace v.z with v.w
+ // replace v.x with v.y
+ // add 1.000000 to v.w and v.y
+ v.wzyx.zywx.wzy.zy = (v.wzyx.zywx.wx)++;
+ gl_FragColor = vec4(v); // 6,7,8,9
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag
new file mode 100644
index 0000000000..1a0405a264
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/CorrectVersion_V100_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#version 100
+#ifdef GL_ES
+precision mediump float;
+#endif
+/* #version can only be followed by number 100. The only statements before
+ #version can be comment or white spaces */
+
+void main()
+{
+ gl_FragColor = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag
new file mode 100644
index 0000000000..fce81e58b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/DuplicateVersion1_V100_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#version 100
+#version 100
+#ifdef GL_ES
+precision mediump float;
+#endif
+/* Two version statements are not allowed since any #version must be the first non-whitespace, non-comment */
+
+void main()
+{
+ gl_FragColor = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert
new file mode 100644
index 0000000000..4b74943bdf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/FunctionParam_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+int y = 1;
+
+int foo(int, int b[y]) // array size should be constant
+{
+ return 1;
+}
+
+void main()
+{
+ int a[1];
+
+ gl_Position = vec4(1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag
new file mode 100644
index 0000000000..0b7d674b8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Include_Preprocessor_Directive_frag.frag
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#include "GL/build/NVIDIA_Test_Include_frag.frag"
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag
new file mode 100644
index 0000000000..4086830477
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Low_Level_Assembly_Reserved_Words_frag.frag
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float MIN;
+uniform float R0;
+uniform float FOGC;
+uniform float CUBE;
+uniform float f;
+uniform float o;
+uniform float p;
+uniform float w;
+uniform float x;
+uniform float y;
+uniform float z;
+
+void main()
+{
+ gl_FragColor = vec4(f, o, p, w);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert
new file mode 100644
index 0000000000..200f39d74b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Main_Parameters_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main(vec4 position : POSITION)
+{
+ gl_Position = position;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag
new file mode 100644
index 0000000000..1242467a08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest3_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ const vec4 v = vec4(normalize(vec4(1))); // Builtin functions are constant expressions if all their parameters are constant expressions - code ok
+ const vec4 v1 = vec4(clamp(1.0, .20, 3.0)); // Builtin functions are constant expressions if all their parameters are constant expressions - code ok
+ float f = 1.0;
+ const vec4 v2 = vec4(float(vec4(1,2,3,f))); // f is not constant - code fails and test does not compile (expected)
+
+ gl_FragColor = v + v1 + v2;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag
new file mode 100644
index 0000000000..60ef6d31b1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/ParseTest4_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ const vec4 v = vec2(2.0, 3.0);
+ gl_FragColor = v;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag
new file mode 100644
index 0000000000..526d62b20d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Constant_Conversions_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f = 2; // Should be 2.0
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag
new file mode 100644
index 0000000000..cc67c7ffb1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Permissive_Scalar_Vector_Expressions_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v = vec2(1.0, 2.0);
+ v *= 2.0; // Legal in GLSL.
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag
new file mode 100644
index 0000000000..2356f00596
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/TernaryOp_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ mat4 m;
+ vec4 v;
+ bool b;
+ gl_FragColor = b ? v : m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag
new file mode 100644
index 0000000000..48bb0d609e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/Texture_Rectangle_Samplers_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2DRect samp;
+
+void main()
+{
+ gl_FragColor = texture2DRect(samp, vec2(0.0, 0.0));
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag
new file mode 100644
index 0000000000..a46681cf36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array10_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+void main()
+{
+ float f[];
+ float flt = f[5];
+ float f[3]; // higher array index has already been used
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag
new file mode 100644
index 0000000000..dfd7abdadf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array11_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f[];
+ int f[4]; // array redeclared with a different type
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag
new file mode 100644
index 0000000000..ab402ba92b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array1_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int array[2][2]; // two dimentional arrays are not allowed
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag
new file mode 100644
index 0000000000..37d0cbc242
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array2_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ const int array[2]; // cannot declare const arrays
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag
new file mode 100644
index 0000000000..d8d7061bd1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array3_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int array1[2], array2[2];
+ bool b = array1 == array2; // equality operator does not work on arrays but works on array elements
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag
new file mode 100644
index 0000000000..92abeb826c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array4_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f[-2]; // cannot declare arrays with negative size
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag
new file mode 100644
index 0000000000..e413562084
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array5_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i = 3;
+ float f[i]; // arrays should be declared with a constant size
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag
new file mode 100644
index 0000000000..483f49af9e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array6_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ const float index = 3.0;
+ float f[index]; // arrays should be declared with an integer expression not float
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag
new file mode 100644
index 0000000000..44dd6e6d9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array7_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f[5];
+ f[]; // array used without a size
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag
new file mode 100644
index 0000000000..97db8819d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array8_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f[5];
+ float f[]; // redeclaration of array already declared with a size
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag
new file mode 100644
index 0000000000..f75edc75dc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/array9_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 array[2];
+ array.xy; // arrays cannot directly be swizzled, however, an element of array can be swizzled
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert
new file mode 100644
index 0000000000..bb2f1be6d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute1_vert.vert
@@ -0,0 +1,14 @@
+
+/*
+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.
+*/
+
+
+attribute int i; // attributes cannot be int or bool
+
+void main()
+{
+ gl_Position = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert
new file mode 100644
index 0000000000..2e3309b530
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute2_vert.vert
@@ -0,0 +1,14 @@
+
+/*
+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.
+*/
+
+
+attribute float f[2]; // attributes cannot be arrays
+
+void main()
+{
+ gl_Position = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag
new file mode 100644
index 0000000000..894197be37
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ attribute float foo; // attributes can be declared at global scope in vertex shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert
new file mode 100644
index 0000000000..9cf16299a2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/attribute_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ attribute float foo; // attributes can be declared at a global scope only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag
new file mode 100644
index 0000000000..6bfdcbd367
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/break_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ break; // break keyword allowed only inside the loops
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html
new file mode 100644
index 0000000000..3ff10f436e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_001_to_008.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectBuiltInOveride_frag.frag"
+ },
+ "name": "CorrectBuiltInOveride_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectComma_frag.frag"
+ },
+ "name": "CorrectComma_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectConstFolding1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectConstFolding1_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectConstFolding2_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectConstFolding2_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectConstruct_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectConstruct_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectExtension10_V100_frag.frag"
+ },
+ "name": "CorrectExtension10_V100_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectExtension1_V100_frag.frag"
+ },
+ "name": "CorrectExtension1_V100_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectExtension4_V100_frag.frag"
+ },
+ "name": "CorrectExtension4_V100_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html
new file mode 100644
index 0000000000..c3f6658290
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_009_to_016.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectFull_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectFull_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectFuncOverload_frag.frag"
+ },
+ "name": "CorrectFuncOverload_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectFuncOverload_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectFuncOverload_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectFunction1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectFunction1_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectModule_frag.frag"
+ },
+ "name": "CorrectModule_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectParse1_frag.frag"
+ },
+ "name": "CorrectParse1_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectParse2_frag.frag"
+ },
+ "name": "CorrectParse2_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectParse2_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectParse2_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html
new file mode 100644
index 0000000000..1869eca48c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_017_to_024.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_017_to_024.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectParseTest1_frag.frag"
+ },
+ "name": "CorrectParseTest1_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectParseTest_frag.frag"
+ },
+ "name": "CorrectParseTest_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectPreprocess5_frag.frag"
+ },
+ "name": "CorrectPreprocess5_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectPreprocess8_frag.frag"
+ },
+ "name": "CorrectPreprocess8_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectPreprocess9_frag.frag"
+ },
+ "name": "CorrectPreprocess9_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectSwizzle1_frag.frag"
+ },
+ "name": "CorrectSwizzle1_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectSwizzle1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectSwizzle1_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectSwizzle2_frag.frag"
+ },
+ "name": "CorrectSwizzle2_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html
new file mode 100644
index 0000000000..132f0ce734
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_025_to_032.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_025_to_032.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "CorrectSwizzle2_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "CorrectSwizzle2_vert.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectSwizzle3_frag.frag"
+ },
+ "name": "CorrectSwizzle3_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "DuplicateVersion1_V100_frag.frag"
+ },
+ "name": "DuplicateVersion1_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "CorrectVersion_V100_frag.frag"
+ },
+ "name": "CorrectVersion_V100_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "FunctionParam_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "FunctionParam_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ParseTest3_frag.frag"
+ },
+ "name": "ParseTest3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ParseTest4_frag.frag"
+ },
+ "name": "ParseTest4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array10_frag.frag"
+ },
+ "name": "array10_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html
new file mode 100644
index 0000000000..52c70b73f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_033_to_040.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_033_to_040.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array11_frag.frag"
+ },
+ "name": "array11_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array1_frag.frag"
+ },
+ "name": "array1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array2_frag.frag"
+ },
+ "name": "array2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array3_frag.frag"
+ },
+ "name": "array3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array4_frag.frag"
+ },
+ "name": "array4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array5_frag.frag"
+ },
+ "name": "array5_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array6_frag.frag"
+ },
+ "name": "array6_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array7_frag.frag"
+ },
+ "name": "array7_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html
new file mode 100644
index 0000000000..c516edb190
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_041_to_048.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_041_to_048.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array8_frag.frag"
+ },
+ "name": "array8_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array9_frag.frag"
+ },
+ "name": "array9_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "attribute1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "attribute1_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "attribute2_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "attribute2_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "attribute_frag.frag"
+ },
+ "name": "attribute_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "attribute_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "attribute_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "break_frag.frag"
+ },
+ "name": "break_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "comma1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "comma1_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html
new file mode 100644
index 0000000000..db09be970e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_049_to_056.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_049_to_056.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "comma2_frag.frag"
+ },
+ "name": "comma2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "comma2_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "comma2_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "comma3_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "comma3_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "comment_frag.frag"
+ },
+ "name": "comment_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "conditional1_frag.frag"
+ },
+ "name": "conditional1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "conditional2_frag.frag"
+ },
+ "name": "conditional2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "conditional3_frag.frag"
+ },
+ "name": "conditional3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "constFunc_frag.frag"
+ },
+ "name": "constFunc_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html
new file mode 100644
index 0000000000..8ce48b7a17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_057_to_064.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_057_to_064.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "constructor1_frag.frag"
+ },
+ "name": "constructor1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "constructor2_frag.frag"
+ },
+ "name": "constructor2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "constructor3_V100_frag.frag"
+ },
+ "name": "constructor3_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "continue_frag.frag"
+ },
+ "name": "continue_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType10_frag.frag"
+ },
+ "name": "dataType10_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType11_frag.frag"
+ },
+ "name": "dataType11_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType12_frag.frag"
+ },
+ "name": "dataType12_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType13_frag.frag"
+ },
+ "name": "dataType13_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html
new file mode 100644
index 0000000000..cf5b0217df
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_065_to_072.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_065_to_072.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType19_frag.frag"
+ },
+ "name": "dataType19_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType1_frag.frag"
+ },
+ "name": "dataType1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType2_frag.frag"
+ },
+ "name": "dataType2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType3_frag.frag"
+ },
+ "name": "dataType3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType4_frag.frag"
+ },
+ "name": "dataType4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType5_frag.frag"
+ },
+ "name": "dataType5_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType6_frag.frag"
+ },
+ "name": "dataType6_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType7_frag.frag"
+ },
+ "name": "dataType7_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html
new file mode 100644
index 0000000000..a09643f167
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_073_to_080.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_073_to_080.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType8_frag.frag"
+ },
+ "name": "dataType8_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dataType9_frag.frag"
+ },
+ "name": "dataType9_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dowhile_frag.frag"
+ },
+ "name": "dowhile_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dvec2_frag.frag"
+ },
+ "name": "dvec2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dvec3_frag.frag"
+ },
+ "name": "dvec3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dvec4_frag.frag"
+ },
+ "name": "dvec4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "extension2_V100_frag.frag"
+ },
+ "name": "extension2_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "extension3_V100_frag.frag"
+ },
+ "name": "extension3_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html
new file mode 100644
index 0000000000..3a06c23a38
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_081_to_088.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_081_to_088.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "extension5_V100_frag.frag"
+ },
+ "name": "extension5_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "extension6_V100_frag.frag"
+ },
+ "name": "extension6_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "extension7_V100_frag.frag"
+ },
+ "name": "extension7_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "extension8_V100_frag.frag"
+ },
+ "name": "extension8_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "extension9_V100_frag.frag"
+ },
+ "name": "extension9_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float2_frag.frag"
+ },
+ "name": "float2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float3_frag.frag"
+ },
+ "name": "float3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float4_frag.frag"
+ },
+ "name": "float4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html
new file mode 100644
index 0000000000..992594a604
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_089_to_096.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_089_to_096.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "fragmentOnly1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "fragmentOnly1_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "fragmentOnly2_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "fragmentOnly2_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "fragmentOnly3_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "fragmentOnly3_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "fragmentOnly4_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "fragmentOnly4_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "fragmentOnly_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "fragmentOnly_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function10_frag.frag"
+ },
+ "name": "function10_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function1_frag.frag"
+ },
+ "name": "function1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function2_V100_frag.frag"
+ },
+ "name": "function2_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html
new file mode 100644
index 0000000000..27ce540c91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_097_to_104.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_097_to_104.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function3_frag.frag"
+ },
+ "name": "function3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function4_frag.frag"
+ },
+ "name": "function4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function6_frag.frag"
+ },
+ "name": "function6_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function7_frag.frag"
+ },
+ "name": "function7_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function8_frag.frag"
+ },
+ "name": "function8_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "function9_frag.frag"
+ },
+ "name": "function9_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "hvec2_frag.frag"
+ },
+ "name": "hvec2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "hvec3_frag.frag"
+ },
+ "name": "hvec3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html
new file mode 100644
index 0000000000..684fa98f86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_105_to_112.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_105_to_112.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "hvec4_frag.frag"
+ },
+ "name": "hvec4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "identifier1_frag.frag"
+ },
+ "name": "identifier1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "identifier2_frag.frag"
+ },
+ "name": "identifier2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "identifier3_frag.frag"
+ },
+ "name": "identifier3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "if1_frag.frag"
+ },
+ "name": "if1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "if2_frag.frag"
+ },
+ "name": "if2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "increment1_frag.frag"
+ },
+ "name": "increment1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "increment2_frag.frag"
+ },
+ "name": "increment2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html
new file mode 100644
index 0000000000..5c18100083
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_113_to_120.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_113_to_120.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "increment3_frag.frag"
+ },
+ "name": "increment3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "increment4_frag.frag"
+ },
+ "name": "increment4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "increment6_frag.frag"
+ },
+ "name": "increment6_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "main1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "main1_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "main2_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "main2_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "main3_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "main3_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrix_V100_frag.frag"
+ },
+ "name": "matrix_V100_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "normal_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "normal_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html
new file mode 100644
index 0000000000..d645465e27
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_121_to_128.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_121_to_128.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser10_frag.frag"
+ },
+ "name": "parser10_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "parser1_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "parser1_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser3_frag.frag"
+ },
+ "name": "parser3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser4_frag.frag"
+ },
+ "name": "parser4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser5_frag.frag"
+ },
+ "name": "parser5_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser6_frag.frag"
+ },
+ "name": "parser6_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser7_frag.frag"
+ },
+ "name": "parser7_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser8_frag.frag"
+ },
+ "name": "parser8_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html
new file mode 100644
index 0000000000..9abe40c351
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_129_to_136.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_129_to_136.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "parser9_frag.frag"
+ },
+ "name": "parser9_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess0_frag.frag"
+ },
+ "name": "preprocess0_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess10_frag.frag"
+ },
+ "name": "preprocess10_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess1_frag.frag"
+ },
+ "name": "preprocess1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess2_frag.frag"
+ },
+ "name": "preprocess2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess3_frag.frag"
+ },
+ "name": "preprocess3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess4_frag.frag"
+ },
+ "name": "preprocess4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess6_frag.frag"
+ },
+ "name": "preprocess6_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html
new file mode 100644
index 0000000000..48d233809f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_137_to_144.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_137_to_144.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "preprocess7_frag.frag"
+ },
+ "name": "preprocess7_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "scoping1_frag.frag"
+ },
+ "name": "scoping1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "scoping2_frag.frag"
+ },
+ "name": "scoping2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct10_frag.frag"
+ },
+ "name": "struct10_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct11_frag.frag"
+ },
+ "name": "struct11_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct1_frag.frag"
+ },
+ "name": "struct1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct2_frag.frag"
+ },
+ "name": "struct2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct3_frag.frag"
+ },
+ "name": "struct3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html
new file mode 100644
index 0000000000..08920dd824
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_145_to_152.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_145_to_152.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct4_frag.frag"
+ },
+ "name": "struct4_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct5_frag.frag"
+ },
+ "name": "struct5_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct6_frag.frag"
+ },
+ "name": "struct6_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct7_frag.frag"
+ },
+ "name": "struct7_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct8_frag.frag"
+ },
+ "name": "struct8_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct9_frag.frag"
+ },
+ "name": "struct9_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "swizzle1_frag.frag"
+ },
+ "name": "swizzle1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "swizzle2_frag.frag"
+ },
+ "name": "swizzle2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html
new file mode 100644
index 0000000000..eb950e3cfa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_153_to_160.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_153_to_160.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "swizzle3_frag.frag"
+ },
+ "name": "swizzle3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "typecast_frag.frag"
+ },
+ "name": "typecast_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "uniform1_frag.frag"
+ },
+ "name": "uniform1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "uniform_frag.frag"
+ },
+ "name": "uniform_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "varying1_frag.frag"
+ },
+ "name": "varying1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "varying2_frag.frag"
+ },
+ "name": "varying2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "varying3_frag.frag"
+ },
+ "name": "varying3_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "varying_frag.frag"
+ },
+ "name": "varying_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html
new file mode 100644
index 0000000000..9c66171bfc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_161_to_168.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_161_to_168.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vector_frag.frag"
+ },
+ "name": "vector_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "version2_V100_frag.frag"
+ },
+ "name": "version2_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "version3_V100_frag.frag"
+ },
+ "name": "version3_V100_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vertexOnly2_frag.frag"
+ },
+ "name": "vertexOnly2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vertexOnly_frag.frag"
+ },
+ "name": "vertexOnly_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "vertex_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "vertex_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "while1_frag.frag"
+ },
+ "name": "while1_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "while2_frag.frag"
+ },
+ "name": "while2_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html
new file mode 100644
index 0000000000..1bd3c63c47
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_169_to_176.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_169_to_176.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "while_frag.frag"
+ },
+ "name": "while_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "TernaryOp_frag.frag"
+ },
+ "name": "TernaryOp_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "CG_Data_Types_frag.frag"
+ },
+ "name": "CG_Data_Types_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "CG_Standard_Library_frag.frag"
+ },
+ "name": "CG_Standard_Library_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "Include_Preprocessor_Directive_frag.frag"
+ },
+ "name": "Include_Preprocessor_Directive_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "Low_Level_Assembly_Reserved_Words_frag.frag"
+ },
+ "name": "Low_Level_Assembly_Reserved_Words_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "Main_Parameters_vert.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "Main_Parameters_vert.test.html",
+ "linkstat": false,
+ "compstat": false
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "Permissive_Constant_Conversions_frag.frag"
+ },
+ "name": "Permissive_Constant_Conversions_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html
new file mode 100644
index 0000000000..cdc2b38bcc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/build_177_to_178.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: build_177_to_178.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "Permissive_Scalar_Vector_Expressions_frag.frag"
+ },
+ "name": "Permissive_Scalar_Vector_Expressions_frag.test.html",
+ "linkstat": true,
+ "compstat": true
+ },
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "Texture_Rectangle_Samplers_frag.frag"
+ },
+ "name": "Texture_Rectangle_Samplers_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert
new file mode 100644
index 0000000000..26473e46e9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma1_vert.vert
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ int i, j, k;
+ float f;
+ i = j, k, f;
+ i = (j, k, f); // float cannot be assigned to int
+ gl_Position = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag
new file mode 100644
index 0000000000..c7061f7ae7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ const vec4 v = (vec4(1,2,3,4), vec4(5,6,7,8), 1.2); // right most value of comma operator shoul be a vec4
+ const vec4 v1 = (vec3(0.2, 2.0), vec4(1,2,3,4), vec4(5,6,7,8));
+ const vec4 v2 = (vec4(1,2,3,4), vec2(2.1, 2), vec4(5,6,7,8));
+ gl_FragColor = v + v1 + v2;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert
new file mode 100644
index 0000000000..9c323689f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma2_vert.vert
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ int i, j, k;
+ float f;
+ i = j, k, f;
+ i = (j = k, f = 1.0); // float cannot be assigned to int
+ gl_Position = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert
new file mode 100644
index 0000000000..9edcb98b21
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comma3_vert.vert
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ int i, j, k;
+ float f;
+ i = j, k, f;
+ i = j = k, f = 1.0;
+ i = j, k = (3, f); // float cannot be assigned to int
+ gl_Position = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag
new file mode 100644
index 0000000000..8d0a382874
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/comment_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ /****** // comment not closed
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag
new file mode 100644
index 0000000000..eb830f4fcc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional1_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f1,f2;
+ int i;
+ float f3 = i ? f1 : f2; // expression must be boolean and not int
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag
new file mode 100644
index 0000000000..451a8bd9eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional2_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f1,f2;
+ int i;
+ bool b;
+ float f3 = b ? i : f2; // second and third expression should of the type float
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag
new file mode 100644
index 0000000000..65b1b46bbb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/conditional3_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f1,f2;
+ bool b;
+ int i = b ? f1 : f2; // second and third expression type does not match the lvalue type
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag
new file mode 100644
index 0000000000..8e3a2a6524
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constFunc_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+vec2 func()
+{
+ vec2 v;
+ return v;
+}
+
+void main()
+{
+ const vec3 v = vec3(1.0, func()); // user defined functions do not return const value
+ gl_FragColor = vec4(v, v);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag
new file mode 100644
index 0000000000..ff73bcdeae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor1_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec4 v = vec4(1,2,3); // insufficient data provided for constructor, 4 values are required
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag
new file mode 100644
index 0000000000..127bdba564
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor2_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec3 v;
+ vec4 v1 = vec4(v); // insufficient data specified for construction
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag
new file mode 100644
index 0000000000..5312587710
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/constructor3_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec3 v;
+ vec4 v1 = vec4(v,v,v); // too many arguments in the constructor
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag
new file mode 100644
index 0000000000..bdf83e2abe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/continue_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ continue; // continue keyword allowed only inside the loops
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag
new file mode 100644
index 0000000000..4456d64178
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType10_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f;
+ float f; // redeclaration of a variable
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag
new file mode 100644
index 0000000000..ffecbbf8f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType11_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i = 08; // invalid octal number
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag
new file mode 100644
index 0000000000..4cf8b18af0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType12_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i = 0xa8g; // invalid hexadecimal number
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag
new file mode 100644
index 0000000000..7a21e6f633
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType13_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i = 1;
+ float f = 1.2;
+ float result = f * i; // auto promotion now allowed
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag
new file mode 100644
index 0000000000..fb98c75308
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType19_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D s;
+void main()
+{
+ int i = int(s); // conversion not allowed
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag
new file mode 100644
index 0000000000..6f3baa2b19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType1_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ void v; // variable cannot be declared of the type void
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag
new file mode 100644
index 0000000000..dec2aa0574
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType2_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D samp1;
+uniform sampler2D samp2 = samp1; // uniforms are read only
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag
new file mode 100644
index 0000000000..726ba88814
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType3_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform int i = 1; // uniforms are read only
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag
new file mode 100644
index 0000000000..8baea0a624
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType4_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i = 1.0; // automatic type conversion does not take place, float cannot be converted to int
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag
new file mode 100644
index 0000000000..7e1ff75209
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType5_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f = 1; // int cannot be converted to float, use constructor to do the conversion explicitly
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag
new file mode 100644
index 0000000000..e6ff4213e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType6_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ const float f; // constants must be initialized
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag
new file mode 100644
index 0000000000..be31a3cba1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType7_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float f;
+void main()
+{
+ f = 1.0; // uniforms are read only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag
new file mode 100644
index 0000000000..dddecc4a17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType8_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying float f;
+void main()
+{
+ f = 1.0; // varyings cannot be written to in a fragment shader, they can be written to in a vertex shader
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag
new file mode 100644
index 0000000000..1029d3d445
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dataType9_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying float f;
+void main()
+{
+ float flt = 1.0;
+ flt++;
+ f++; // varyings in a fragment shader are read only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag
new file mode 100644
index 0000000000..af7b0e05a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main (void)
+{
+ gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert
new file mode 100644
index 0000000000..8c736abd5f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/default.vert
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+void main (void)
+{
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag
new file mode 100644
index 0000000000..4143dc4c36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dowhile_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f;
+ do {
+ } while(f); // condition should be boolean
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag
new file mode 100644
index 0000000000..9451b55d6f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec2_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ dvec2 d; // dvec2 is not a valid datatype, reserved for future use
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag
new file mode 100644
index 0000000000..b7f7817168
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec3_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ dvec3 d; // dvec3 is not a valid datatype, reserved for future use
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag
new file mode 100644
index 0000000000..56beb6a5a7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/dvec4_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ dvec4 d; // dvec4 is not a valid datatype, reserved for future use
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag
new file mode 100644
index 0000000000..085a7e3535
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension2_V100_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#extension all : require // cannot use require or enable with all
+#extension all : enable // cannot use require or enable with all
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag
new file mode 100644
index 0000000000..0005c14edf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension3_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#extension foo : require // error extension not supported
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag
new file mode 100644
index 0000000000..6198d6ffe3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension5_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#extension all : ddisablee // error, behavior is not supported
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag
new file mode 100644
index 0000000000..6a33fa4feb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension6_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#extension // error name and behavior not specified
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag
new file mode 100644
index 0000000000..0e636d5125
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension7_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#extension foo // ":" missing after extension name
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag
new file mode 100644
index 0000000000..7c12432568
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension8_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#extension foo : // behavior not specified
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag
new file mode 100644
index 0000000000..dd7d69dcaf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/extension9_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+#extension foo behavior // ":" missing after extension name
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag
new file mode 100644
index 0000000000..23a31ca990
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float2_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float2 f; // float2 is not a valid datatype
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag
new file mode 100644
index 0000000000..a73d3d4454
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float3_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float3 f; // float3 is not a valid datatype
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag
new file mode 100644
index 0000000000..d381373ad8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/float4_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float4 f; // float4 is not a valid datatype
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert
new file mode 100644
index 0000000000..5ebba33d94
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly1_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ gl_FrontFacing = true; // can be used in fragment shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert
new file mode 100644
index 0000000000..480056b079
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly2_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ gl_FragCoord = vec4(1.0); // can be used in fragment shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert
new file mode 100644
index 0000000000..8e9cb00815
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly3_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ gl_FragColor = vec4(1.0); // can be used in fragment shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert
new file mode 100644
index 0000000000..4f6448369f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly4_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ discard; // can be used in fragment shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert
new file mode 100644
index 0000000000..28ea00ef4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/fragmentOnly_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ gl_FragDepth = 1.0; // can be used in fragment shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag
new file mode 100644
index 0000000000..17dfadbfd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function10_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(in int i);
+
+void main()
+{
+ float f;
+ // overloaded function not present
+ function(f);
+}
+
+void function(in int i)
+{
+ i = 3;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag
new file mode 100644
index 0000000000..a3327a6adb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function1_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(int i)
+{
+ return i; // void function cannot return a value
+}
+
+void main()
+{
+ int i;
+ function(i);
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag
new file mode 100644
index 0000000000..5b9d57dc51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function2_V100_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(int i[]) // size of array must be specified
+{
+}
+
+void main()
+{
+ int i[2];
+ function(i);
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag
new file mode 100644
index 0000000000..44835de7fa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function3_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(const int i)
+{
+ i = 3; // const value cant be modified
+}
+
+void main()
+{
+ int i;
+ function(i);
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag
new file mode 100644
index 0000000000..eeabde9b7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function4_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform int uniformInt;
+
+void function(out int i)
+{
+ i = 1;
+}
+
+void main()
+{
+ function(uniformInt); // out and inout parameters cannot be uniform since uniforms cannot be modified
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag
new file mode 100644
index 0000000000..cbcc433eb3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function6_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(const out int i)
+{ // out parameters cannot be const
+ i = 3;
+}
+
+void main()
+{
+ int i;
+ function(i);
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag
new file mode 100644
index 0000000000..4c0902881c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function7_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(uniform int i)
+{ // uniform qualifier cannot be used with function parameters
+}
+
+void main()
+{
+ int i;
+ function(i);
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag
new file mode 100644
index 0000000000..debe6e8058
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function8_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(const inout int i)
+{ // inout parameters cannot be const
+ i = 3;
+}
+
+void main()
+{
+ int i;
+ function(i);
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag
new file mode 100644
index 0000000000..96af74bf97
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/function9_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void function(inout int i);
+
+void main()
+{
+ int i;
+ function(i);
+}
+
+// function definition has different parameter qualifiers than function declaration
+void function(in int i)
+{
+ i = 3;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag
new file mode 100644
index 0000000000..8911b69e64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec2_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ hvec2 f; // hvec2 is not a valid datatype, reserved for future use
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag
new file mode 100644
index 0000000000..a3b61df2e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec3_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ hvec3 f; // hvec3 is not a valid datatype, reserved for future use
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag
new file mode 100644
index 0000000000..94e7970fa8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/hvec4_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ hvec4 f; // hvec4 is not a valid datatype, reserved for future use
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag
new file mode 100644
index 0000000000..70d1d9c80e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier1_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int 1i; // incorrect identifier name
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag
new file mode 100644
index 0000000000..316e934519
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier2_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int gl_int; // identifier name cannot begin with "gl_"
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag
new file mode 100644
index 0000000000..9bbeaf6520
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/identifier3_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i;
+ x; // identifier x used without being declared
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag
new file mode 100644
index 0000000000..0301684831
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if1_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i;
+ if (i) // condition of if statement must be a boolean
+ i++;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag
new file mode 100644
index 0000000000..04fbfdfc23
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/if2_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v;
+ int i;
+ if (v) // vectors cannot be used as conditional expression for if statement
+ i++;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag
new file mode 100644
index 0000000000..4eeb5b60bf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment1_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ int i;
+} s1;
+
+void main()
+{
+ s1.i++;
+ s1++; // structure cannot be incremented
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag
new file mode 100644
index 0000000000..561678b0ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment2_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i;
+ (i+i)++; // i+i is not an l-value
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag
new file mode 100644
index 0000000000..0a32504734
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment3_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D sampler2d;
+
+void main()
+{
+ sampler2d++; // uniforms cannot be modified
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag
new file mode 100644
index 0000000000..23ff6b43e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment4_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i;
+ i++ = 5; // i++ is not an l-value
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag
new file mode 100644
index 0000000000..0bc50043ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/increment6_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i;
+ ++i++; // ++i++ is equivalent to ++(i++) which fails because i++ is not an lvalue. (++i)++; is legal.
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt
new file mode 100644
index 0000000000..78dde7d629
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/input.run.txt
@@ -0,0 +1,24 @@
+# this file is auto-generated. DO NOT EDIT.
+build_001_to_008.html
+build_009_to_016.html
+build_017_to_024.html
+build_025_to_032.html
+build_033_to_040.html
+build_041_to_048.html
+build_049_to_056.html
+build_057_to_064.html
+build_065_to_072.html
+build_073_to_080.html
+build_081_to_088.html
+build_089_to_096.html
+build_097_to_104.html
+build_105_to_112.html
+build_113_to_120.html
+build_121_to_128.html
+build_129_to_136.html
+build_137_to_144.html
+build_145_to_152.html
+build_153_to_160.html
+build_161_to_168.html
+build_169_to_176.html
+build_177_to_178.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert
new file mode 100644
index 0000000000..95c266310a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main1_vert.vert
@@ -0,0 +1,11 @@
+
+/*
+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.
+*/
+
+
+main() // return type of main should be void
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert
new file mode 100644
index 0000000000..8cdfe98b46
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main2_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+void main(int i) // main function cannot take any parameters
+{
+ gl_Position = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert
new file mode 100644
index 0000000000..09a21a9e92
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/main3_vert.vert
@@ -0,0 +1,12 @@
+
+/*
+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.
+*/
+
+
+int main() // return type of main should be void
+{
+ return 1;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag
new file mode 100644
index 0000000000..f3dc0adb64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/matrix_V100_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ mat3 m;
+ mat4 m1 = mat4(m);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert
new file mode 100644
index 0000000000..369bce99f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/normal_vert.vert
@@ -0,0 +1,13 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Normal;
+void main()
+{
+ gtf_Normal = vec3(1.0,2.0,3.0); // cannot be modified an attribute
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag
new file mode 100644
index 0000000000..6c25734473
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser10_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ 5 += 5; // l-value missing
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert
new file mode 100644
index 0000000000..90a6263dd2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser1_vert.vert
@@ -0,0 +1,13 @@
+
+/*
+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.
+*/
+
+
+void main()
+{
+ int a // semicolon missing at the end of the statement
+ gl_Position = vec4(a);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag
new file mode 100644
index 0000000000..7b543ad8fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser3_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f[3];
+ f[3] = 1.0; // index of array greater than the size of the array
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag
new file mode 100644
index 0000000000..c73e4b3d31
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser4_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ const int i = 5;
+ i++; // const cannot be modified
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag
new file mode 100644
index 0000000000..ee9cbdaac5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser5_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v;
+ v.z = 1.2; // vec2 does not have a z component
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag
new file mode 100644
index 0000000000..2d4d021fd2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser6_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f1,f2,f3;
+ f3 = f1 > f2; // f1 > f2 result in a bool that cannot be assigned to a float
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag
new file mode 100644
index 0000000000..49032310cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser7_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ mat2 m1,m2;
+ bool b = m1 > m2; // greater-than operator can not operate on matrices, however, equal (==) and not equal (!=) operators can be used with matrices
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag
new file mode 100644
index 0000000000..76649c54ee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser8_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v2;
+ vec3 v3;
+ bool b = v2 == v3; // equal operator cannot operator on vectors of different sizes
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag
new file mode 100644
index 0000000000..1283c2268d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/parser9_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f1,f2;
+ bool b = f1 && f2; // &&, || and ^^ operate on a boolean expression only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag
new file mode 100644
index 0000000000..e9d1d9fcd1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess0_frag.frag
@@ -0,0 +1,63 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//test for else elif mismatch
+#define test(x,y) (x+y)
+
+void main(void){
+ int sum =0;
+ #define x 8
+ #endif
+ #if (x==8)
+ #undef x
+ #endif
+
+ #if 1
+ #undef x
+ #endif
+
+ #if 1
+ #define t4 4
+ #endif
+
+ sum=test(3,6)+t4;
+ #if 1
+ #if 1
+ #if 1
+ #if 1
+ #if 0
+ #undef test
+ #else
+ #if 1
+ #undef test
+ #endif
+ #if 0
+ #undef test
+ #else
+ #if 0
+ #undef test
+ #else
+ #if 1
+ #undef test
+ #else
+ #undef test
+ #else
+ #jdhgj
+ #endif
+ #endif
+ #endif
+ #endif
+ #endif
+ #endif
+ #endif
+ #endif
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag
new file mode 100644
index 0000000000..feb227970d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess10_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+/* The program should terminate with an error message and not get into an
+ infinite loop */
+#ifdef name
+
+void main()
+{
+ gl_FragColor = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag
new file mode 100644
index 0000000000..72f4d14258
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess1_frag.frag
@@ -0,0 +1,64 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// tests for macro redifinition (t2) and the #if and #else nestings.
+// takes care of elif also.
+
+#define t1 (1+2)
+#define t2 2
+#define t2 3
+
+// testing the if depth
+#if (t1==3)
+ #define t3 3
+ #if defined t2
+ #define t4 4
+ #if defined(t3)
+ #define t5 5
+ #ifdef t5
+ #define t6 6
+ #ifndef t7
+ #define t7 7
+ #else
+ #define t8 8
+ #endif
+ #endif
+ #else
+ #ifndef t8
+ #define t8 8
+ #elif (t8==8)
+ #define t9 9
+ #else
+ #if defined t7
+ #define t9 9
+ #endif
+ #endif
+ #endif
+ #else
+ #define t10 10
+ #endif
+#endif
+
+
+#define t8 8
+#define t9 9
+#define t10 10
+
+void main(void)
+{
+ int sum=1 ;
+ sum = t1+t2;
+ sum = t3+t4;
+ sum = t5+t6;
+ sum = t7+t8;
+ sum = t9+t10;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag
new file mode 100644
index 0000000000..9aa00e849d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess2_frag.frag
@@ -0,0 +1,60 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// #line directive-- test cases.
+// chks for Invalid directives, all possible #line errors
+// Also checks the correct verions of #line dorective.
+
+#define t1 1
+#define t2 2
+
+#
+#
+#
+#
+#line 8
+#line ""
+#line 3 3
+
+#linekfj
+#line c c
+#line t1 t2
+#line 77 89
+#line 65.4
+#line message to the user
+#line
+#line345
+
+void main(void)
+{
+ int sum =1;
+ sum = __LINE__;
+ sum = __FILE__;
+ #line 4 5
+ sum = __LINE__;
+ sum = __FILE__;
+ #line 9
+ sum = __LINE__ + __FILE__ ;
+ sum = __FILE__;
+ #
+ #
+ sum = __VERSION__;
+ sum = sum + __LINE__ ;
+ #line 4 5
+ #line 5 8
+ sum = __LINE__;
+ sum = __FILE__;
+ sum = __VERSION__;
+
+}
+
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag
new file mode 100644
index 0000000000..c9e2006a97
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess3_frag.frag
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// simple macro expansions.
+// Tests for Too few macro arguments, too many macro arguments.
+// Macros with no arguments.
+
+#define t1 -1
+#define t2 2
+
+#define test -258
+#define test1 (test*test)
+#define test2(x) (x+test1)
+#define test3() (test2(8)*(test*test1))
+#define test4(x,y) (x+y)
+
+void main(void)
+{
+ int sum =0;
+ sum = test3();
+ sum = test3(3);
+
+ sum = test2(9);
+ sum = test2(9,8);
+
+ sum = test4;
+ sum = test2(8,5,78,9);
+ sum = sum + test1;
+ sum = 8+58+sum;
+ sum = sum +test;
+ sum = (t1+t2);
+ sum = test4(test3(),test2(test3()));
+ sum = test4(3,8,5);
+ sum = test4();
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag
new file mode 100644
index 0000000000..5d9c756a63
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess4_frag.frag
@@ -0,0 +1,60 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// #error and #pragma directives -- test cases.
+// tests for errors in #pragma directive.
+
+#pragma optimize(on)
+#pragma debug(off)
+
+int foo(int);
+
+void main(void)
+{
+ int sum =0;
+ #error ;
+ #error 78
+ #error c
+ #error "message to the user "
+ #error message to the user
+ #error
+ #error
+ #define t1 1
+ sum = t1*t1;
+ foo(sum);
+
+}
+
+#pragma optimize(off)
+#pragma bind(on)
+#pragma pack(off)
+
+int foo(int test)
+{
+ int binding=0;
+ binding = test;
+ return binding;
+}
+
+#line 4
+#pragma
+#line 5 6
+#pragma optmimize on
+#pragma debug off
+#pragma debug(off
+#line 9
+#prgma bind(off)
+#pragma bind
+#pragma (on)
+#pragma on (on)
+#pragma optmize(on
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag
new file mode 100644
index 0000000000..836bd0223f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess6_frag.frag
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// operator precedence and some macro expansions.
+
+#define test (1+2)
+#define test1 (test*4)
+#define test2 (test1/test)
+//#define test3 (-1+2*3/4%test)
+#define test3 (-1+2*3/4)
+//#define test4 (test & test1 |test2)
+#define test4 (test)
+#define test5 (!8+~4+4-6)
+#define test6 (test1>>1)
+#define test7 (test1<<1)
+#define test8 (test2^6)
+#define test9 (test4 || test5 && test1)
+#define test10 (0)
+
+void main(void)
+{
+ int sum =0;
+ sum = test4;
+ sum = test3*test2+test1-test;
+// sum = test3/test6 + test4*test7 - test7 % test9;
+// sum = test3/test6 + test4*test7 - test7;
+ sum = test10*test5;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag
new file mode 100644
index 0000000000..08f62b1110
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/preprocess7_frag.frag
@@ -0,0 +1,51 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// testing for char constants in #if and #elif
+// Also checking whether reserved words can be redefined.
+
+#define t1 c
+#define t2 d
+#define asm a
+
+ #if(t1==c)
+ #define t3 3
+ #elif(t1==d)
+ #define t4 4
+ #elif(t2==c)
+ #define t5 5
+ #endif
+
+ #ifndef t1
+ #define t7 7
+ #elif (t2==d)
+ #define t6 6
+ #endif
+
+ #if (t2=='d')
+ #define half 5
+ #else
+ #define half 8
+ #endif
+
+ #ifdef t22
+ #define x 5
+ #endif
+
+ void main(void)
+ {
+ int sum =0,a=9;
+
+ sum = half + sum;
+ sum = asm + a;
+
+ }
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag
new file mode 100644
index 0000000000..89c9a51209
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping1_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ bool b;
+ if (b)
+ {
+ int i = 1;
+ i++;
+ }
+ i++; // i is not declared in this scope
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag
new file mode 100644
index 0000000000..8667f40061
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/scoping2_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ {
+ int i = 1;
+ i++;
+ }
+ i++; // i is not declared in this scope
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag
new file mode 100644
index 0000000000..fb0c78299d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct10_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ int i;
+} s1[2];
+
+void main()
+{
+ s1.i = 1; // s1 is an array. s1[0].i is correct to use
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag
new file mode 100644
index 0000000000..152ce49aed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct11_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ int i;
+} s1;
+
+void main()
+{
+ s1 = -s1; // cannot calculate negative of a structure
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag
new file mode 100644
index 0000000000..0fcbb8599f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct1_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ int i;
+} uniform uniformStruct; // uniform keyword should be used before the keyword struct
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag
new file mode 100644
index 0000000000..5682f67dfc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct2_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ int i = 1.0; // struct members cannot be initialized at the time of structure declaration
+} s1;
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag
new file mode 100644
index 0000000000..2ec1e53616
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct3_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ uniform int i; // structure members cannot be declared with const qualifier
+} s1;
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag
new file mode 100644
index 0000000000..ae7d547ae1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct4_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ const int i = 1; // structure members cannot be declared with const qualifier
+} s1;
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag
new file mode 100644
index 0000000000..fd62320761
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct5_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform struct s {
+ int i;
+} s1;
+
+void main()
+{
+ s1.i = 1; // uniforms are read only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag
new file mode 100644
index 0000000000..dd98cc01c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct6_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying struct s {
+ int i;
+} s1; // structures cannot be declared with varying qualifier
+
+void main()
+{
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag
new file mode 100644
index 0000000000..01a3206505
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct7_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ struct s {
+ } s1; // structures have to be declared with atleast one member
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag
new file mode 100644
index 0000000000..c900bc90c3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct8_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct s {
+ int i;
+} s1;
+
+struct ss {
+ int i;
+} s2;
+
+void main()
+{
+ s1 = s2; // two different structures cannot be assigned to each other
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag
new file mode 100644
index 0000000000..c661d25012
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/struct9_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+const struct s {
+ int i;
+} s1 = s(1);
+
+void main()
+{
+ s1.i = 1; // const struct members cannot be modified
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag
new file mode 100644
index 0000000000..b11ea3cf91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle1_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v;
+ v.xy = 1.2; // swizzle needs two values, v.xy = vec2(1.2) is correct
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag
new file mode 100644
index 0000000000..705bd18776
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle2_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v;
+ v.xx = vec2(1,1); // x cannot be used twice in l-value
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag
new file mode 100644
index 0000000000..b5b9fd6048
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/swizzle3_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec2 v;
+ vec3 v3 = v.xyz; // v is a vec2 and does not have a z component
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag
new file mode 100644
index 0000000000..fa1b124f66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/typecast_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ vec4 v;
+ vec4 v1 = (vec4) v; // incorrect typecasting, vec4(v) is correct
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag
new file mode 100644
index 0000000000..1270647faa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform1_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct gtf_FogParameters {
+vec4 color;
+float density;
+float start;
+float end;
+float scale;
+};
+uniform gtf_FogParameters gtf_Fog;
+void main()
+{
+ gtf_Fog.density = 1.0; // cannot modify a uniform
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag
new file mode 100644
index 0000000000..195eaced46
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/uniform_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ uniform float foo; // uniforms can only be declared at a global scope
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag
new file mode 100644
index 0000000000..9f5122ea98
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying1_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying float foo;
+
+void main()
+{
+ foo = 5.0; // varying cannot be written by a fragment shader
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag
new file mode 100644
index 0000000000..74cc9f49f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying2_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying int foo; // varyings cannot be int or bool
+
+void main()
+{
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag
new file mode 100644
index 0000000000..62ab65ec99
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying3_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 v = vec4(1,1,1,1);//gl_TexCoord[0]; // varyings cannot be initialized
+
+void main()
+{
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag
new file mode 100644
index 0000000000..f85d9fdb7b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/varying_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ varying float foo; // varyings can only be declared at a global scope
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag
new file mode 100644
index 0000000000..62c298eb1d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vector_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ ivec4 v4;
+ v4 = v4 + 2.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag
new file mode 100644
index 0000000000..b83fc6a467
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version2_V100_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#pragma debug(on)
+#version 100 // error #version should be the first statement in the program
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+
+void main()
+{
+ gl_FragColor = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag
new file mode 100644
index 0000000000..21dfcc33ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/version3_V100_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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 is a comment*/ int i; // This is a global decl
+#version 100 // error #version should be the first statement in the program
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+
+void main()
+{
+ gl_FragColor = vec4(1);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag
new file mode 100644
index 0000000000..1c85e221ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly2_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ gl_Position = vec4(4.0); // can be used in vertex shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag
new file mode 100644
index 0000000000..41ada2bf08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertexOnly_frag.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct gtf_PointParameters {
+float size;
+float sizeMin;
+float sizeMax;
+float fadeThresholdSize;
+float distanceConstantAttenuation;
+float distanceLinearAttenuation;
+float distanceQuadraticAttenuation;
+};
+uniform gtf_FogParameters gtf_Point;
+void main()
+{
+ gtf_PointSize = 4.0; // can be used in vertex shader only
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert
new file mode 100644
index 0000000000..ab8cc4555e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/vertex_vert.vert
@@ -0,0 +1,13 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+void main()
+{
+ gtf_Vertex = vec4(1.0,2.0,3.0, 4.0); // cannot modify an attribute
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag
new file mode 100644
index 0000000000..89e2c6bbb2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while1_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ int i;
+ while(i) { // condition should be boolean
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag
new file mode 100644
index 0000000000..31e75cfa90
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while2_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ while(float f = 5.0) { // cannot declare variables in condition
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag
new file mode 100644
index 0000000000..891d0992b0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/build/while_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main()
+{
+ float f;
+ while(f) { // condition should be boolean
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html
new file mode 100644
index 0000000000..2477c00ddd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/built_in_varying_array_out_of_bounds_001_to_001.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: built_in_varying_array_out_of_bounds_001_to_001.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "pattern": "build",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_Color_array_index_out_of_bounds_frag.frag"
+ },
+ "name": "gl_Color_array_index_out_of_bounds_frag.test.html",
+ "linkstat": false,
+ "compstat": false
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag
new file mode 100644
index 0000000000..311ac4b559
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/gl_Color_array_index_out_of_bounds_frag.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main(void)
+{
+ gl_FragColor = vec4(color[1], color[2], color[3], color[4]);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt
new file mode 100644
index 0000000000..be6485a1f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/built_in_varying_array_out_of_bounds/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+built_in_varying_array_out_of_bounds_001_to_001.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html
new file mode 100644
index 0000000000..8b63e0789b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: ceil_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ceil_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ceil_float_frag_xvary.frag"
+ },
+ "name": "ceil_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ceil_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ceil_vec2_frag_xvary.frag"
+ },
+ "name": "ceil_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ceil_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ceil_vec3_frag_xvary.frag"
+ },
+ "name": "ceil_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "ceil_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "ceil_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ceil_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "ceil_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "ceil_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ceil_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "ceil_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "ceil_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ceil_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag
new file mode 100644
index 0000000000..c58b7464d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4((ceil(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..234b80aa4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_frag_xvary_ref.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float ceil_ref(float x)
+{
+ if(x != floor(x)) x = floor(x) + 1.0;
+ return x;
+}
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert
new file mode 100644
index 0000000000..cdcb87cdd1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4((ceil(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..b6926d6a4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_float_vert_xvary_ref.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+float ceil_ref(float x)
+{
+ if(x != floor(x)) x = floor(x) + 1.0;
+ return x;
+}
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..1746348114
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4((ceil(c) + 10.0) / 20.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..d037971dbe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_frag_xvary_ref.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+vec2 ceil_ref(vec2 x)
+{
+ if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0;
+ if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0;
+ return x;
+}
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..8c5a773779
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4((ceil(c) + 10.0) / 20.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..c79d18a6a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec2_vert_xvary_ref.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+vec2 ceil_ref(vec2 x)
+{
+ if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0;
+ if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0;
+ return x;
+}
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4((ceil_ref(c) + 10.0) / 20.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..c7597619d8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4((ceil(c) + 10.0) / 20.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..638c735a73
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_frag_xvary_ref.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+vec3 ceil_ref(vec3 x)
+{
+ if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0;
+ if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0;
+ if(x[2] != floor(x[2])) x[2] = floor(x[2]) + 1.0;
+ return x;
+}
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4((ceil_ref(c) + 10.0) / 20.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..0304b41782
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4((ceil(c) + 10.0) / 20.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..c8a8fcd859
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/ceil_vec3_vert_xvary_ref.vert
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+vec3 ceil_ref(vec3 x)
+{
+ if(x[0] != floor(x[0])) x[0] = floor(x[0]) + 1.0;
+ if(x[1] != floor(x[1])) x[1] = floor(x[1]) + 1.0;
+ if(x[2] != floor(x[2])) x[2] = floor(x[2]) + 1.0;
+ return x;
+}
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4((ceil_ref(c) + 10.0) / 20.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt
new file mode 100644
index 0000000000..ed1a87ffad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/ceil/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+ceil_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html
new file mode 100644
index 0000000000..3a7a027c09
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: clamp_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "clamp_float_frag_xvary_yconstquarter_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "clamp_float_frag_xvary_yconstquarter.frag"
+ },
+ "name": "clamp_float_frag_xvary_yconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "clamp_vec2_frag_xvary_yconstquarter_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "clamp_vec2_frag_xvary_yconstquarter.frag"
+ },
+ "name": "clamp_vec2_frag_xvary_yconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "clamp_vec3_frag_xvary_yconstquarter_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "clamp_vec3_frag_xvary_yconstquarter.frag"
+ },
+ "name": "clamp_vec3_frag_xvary_yconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "clamp_float_vert_xvary_yconstquarter_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "clamp_float_vert_xvary_yconstquarter.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "clamp_float_vert_xvary_yconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "clamp_vec2_vert_xvary_yconstquarter_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "clamp_vec2_vert_xvary_yconstquarter.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "clamp_vec2_vert_xvary_yconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "clamp_vec3_vert_xvary_yconstquarter_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "clamp_vec3_vert_xvary_yconstquarter.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "clamp_vec3_vert_xvary_yconstquarter.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag
new file mode 100644
index 0000000000..97c16a5ace
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ float c = color.r;
+ gl_FragColor = vec4(clamp(c, min_c, max_c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag
new file mode 100644
index 0000000000..beba604303
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_frag_xvary_yconstquarter_ref.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ float c = color.r;
+ if(c > max_c) c = max_c;
+ if(c < min_c) c = min_c;
+
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert
new file mode 100644
index 0000000000..37b17f8f45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ float c = gtf_Color.r;
+ color = vec4(clamp(c, min_c, max_c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert
new file mode 100644
index 0000000000..5ba7a86b1c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_float_vert_xvary_yconstquarter_ref.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ float c = gtf_Color.r;
+ if(c > max_c) c = max_c;
+ if(c < min_c) c = min_c;
+
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag
new file mode 100644
index 0000000000..78c4fa92b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 min_c = vec2(0.25, 0.25);
+ const vec2 max_c = vec2(0.75, 0.75);
+ vec2 c = color.rg;
+ gl_FragColor = vec4(clamp(c, min_c, max_c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag
new file mode 100644
index 0000000000..2e445dfbcb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_frag_xvary_yconstquarter_ref.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 min_c = vec2(0.25, 0.25);
+ const vec2 max_c = vec2(0.75, 0.75);
+ vec2 c = color.rg;
+ if(c[0] < min_c[0]) c[0] = min_c[0];
+ if(c[1] < min_c[1]) c[1] = min_c[1];
+ if(c[0] > max_c[0]) c[0] = max_c[0];
+ if(c[1] > max_c[1]) c[1] = max_c[1];
+
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert
new file mode 100644
index 0000000000..a4e2719168
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ vec2 c = gtf_Color.rg;
+ color = vec4(clamp(c, min_c, max_c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert
new file mode 100644
index 0000000000..e98e400d49
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec2_vert_xvary_yconstquarter_ref.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ vec2 c = gtf_Color.rg;
+ if(c[0] > max_c) c[0] = max_c;
+ if(c[0] < min_c) c[0] = min_c;
+ if(c[1] > max_c) c[1] = max_c;
+ if(c[1] < min_c) c[1] = min_c;
+
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag
new file mode 100644
index 0000000000..9b67fee7cf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 min_c = vec3(0.25, 0.25, 0.25);
+ const vec3 max_c = vec3(0.75, 0.75, 0.75);
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(clamp(c, min_c, max_c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag
new file mode 100644
index 0000000000..88341fc06a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_frag_xvary_yconstquarter_ref.frag
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 min_c = vec3(0.25, 0.25, 0.25);
+ const vec3 max_c = vec3(0.75, 0.75, 0.75);
+ vec3 c = color.rgb;
+ if(c[0] < min_c[0]) c[0] = min_c[0];
+ if(c[1] < min_c[1]) c[1] = min_c[1];
+ if(c[2] < min_c[2]) c[2] = min_c[2];
+ if(c[0] > max_c[0]) c[0] = max_c[0];
+ if(c[1] > max_c[1]) c[1] = max_c[1];
+ if(c[2] > max_c[2]) c[2] = max_c[2];
+
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert
new file mode 100644
index 0000000000..d9052ed643
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ vec3 c = gtf_Color.rgb;
+ color = vec4(clamp(c, min_c, max_c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert
new file mode 100644
index 0000000000..735597e449
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/clamp_vec3_vert_xvary_yconstquarter_ref.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.25;
+ const float max_c = 0.75;
+ vec3 c = gtf_Color.rgb;
+ if(c[0] > max_c) c[0] = max_c;
+ if(c[0] < min_c) c[0] = min_c;
+ if(c[1] > max_c) c[1] = max_c;
+ if(c[1] < min_c) c[1] = min_c;
+ if(c[2] > max_c) c[2] = max_c;
+ if(c[2] < min_c) c[2] = min_c;
+
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt
new file mode 100644
index 0000000000..2fafa275a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/clamp/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+clamp_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html
new file mode 100644
index 0000000000..c2ce553938
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_001_to_008.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: control_flow_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "for_break_frag.frag"
+ },
+ "name": "for_break_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "for_break_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "for_break_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "for_continue_frag.frag"
+ },
+ "name": "for_continue_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "for_continue_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "for_continue_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "for_nested_break_frag.frag"
+ },
+ "name": "for_nested_break_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "for_nested_break_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "for_nested_break_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "for_nested_continue_frag.frag"
+ },
+ "name": "for_nested_continue_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "for_nested_continue_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "for_nested_continue_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html
new file mode 100644
index 0000000000..8c15bf9c4d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/control_flow_009_to_010.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: control_flow_009_to_010.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "nested_if_else_frag.frag"
+ },
+ "name": "nested_if_else_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "nested_if_else_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "nested_if_else_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag
new file mode 100644
index 0000000000..1efed30ea7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_frag.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int count = 0;
+ for(int i=0;i<5;i++)
+ {
+ count++;
+ if(count == 3)
+ break;
+ }
+
+ float gray;
+ if( count == 3)
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert
new file mode 100644
index 0000000000..b25c3bf323
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_break_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int count = 0;
+ for(int i=0;i<45;i++)
+ {
+ count++;
+ if(count == 29)
+ break;
+ }
+ float gray;
+ if( count == 29)
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag
new file mode 100644
index 0000000000..ba9d84df33
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_frag.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int count=0;
+ int val=0;
+
+ for(int i=0;i<10;i++)
+ {
+ count++;
+ if(count == 5)
+ continue;
+ else
+ val += count;
+ }
+
+ float gray;
+ if( val == 50)
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert
new file mode 100644
index 0000000000..93b4dfee01
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_continue_vert.vert
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int count=0;
+ int val=0;
+ for(int i=0;i<10;i++)
+ {
+ count++;
+ if(count == 5)
+ continue;
+ else
+ val += count;
+ }
+
+
+ float gray;
+ if( val == 50)
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag
new file mode 100644
index 0000000000..63525fdfe4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_frag.frag
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int count1 = 0, count2 = 0;
+ for(int i=0;i<4;i++)
+ {
+ count1++;
+ count2 = 0;
+ for(int j=0;j<4;j++)
+ {
+ count2++;
+ if(count2 == 3)
+ break;
+ }
+ if(count1 == 2)
+ break;
+ }
+ float gray;
+ if( (count1 == 2) && (count2 == 3))
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert
new file mode 100644
index 0000000000..871be994b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_break_vert.vert
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int count1 = 0, count2 = 0;
+ for(int i=0;i<45;i++)
+ {
+ count1++;
+ count2 = 0;
+ for(int j=0;j<45;j++)
+ {
+ count2++;
+ if(count2 == 29)
+ break;
+ }
+ if(count1 == 29)
+ break;
+ }
+ float gray;
+ if( (count1 == 29) && (count2 == 29))
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag
new file mode 100644
index 0000000000..7c952c1633
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_frag.frag
@@ -0,0 +1,44 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int count1 = 0, count2 = 0;
+ int val1 = 0, val2 = 0;
+ for(int i=0;i<4;i++)
+ {
+ count1++;
+ count2 = 0;
+ for(int j=0;j<4;j++)
+ {
+ count2++;
+ if(count2 == 2)
+ continue;
+ else
+ val2 += count2;
+
+ }
+
+
+ if(count1 == 2)
+ continue;
+ else
+ val1 += count1;
+
+ }
+ float gray;
+ if( (val1 == 8) && (val2 == 32) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert
new file mode 100644
index 0000000000..2496202eb7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/for_nested_continue_vert.vert
@@ -0,0 +1,44 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int count1 = 0, count2 = 0;
+ int val1 = 0, val2 = 0;
+ for(int i=0;i<10;i++)
+ {
+ count1++;
+ count2 = 0;
+ for(int j=0;j<10;j++)
+ {
+ count2++;
+ if(count2 == 5)
+ continue;
+ else
+ val2 += count2;
+
+ }
+
+
+ if(count1 == 5)
+ continue;
+ else
+ val1 += count1;
+
+ }
+ float gray;
+ if( (val1 == 50) && (val2 == 500) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt
new file mode 100644
index 0000000000..fddcaa48ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+control_flow_001_to_008.html
+control_flow_009_to_010.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag
new file mode 100644
index 0000000000..bac0d0596c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_frag.frag
@@ -0,0 +1,40 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int setval = 30;
+
+ if(--setval!=29)
+ if( (setval+=11) == 40)
+ if(setval/4 == 11)
+ setval = 11;
+ else if(setval/4 == 10)
+ if(setval-3 == 37)
+ setval=12;
+ else setval = 9;
+ else setval = 10;
+ else setval = 30;
+ else if(setval == 29)
+ if((setval+=19) != 48)
+ setval = 13;
+ else if((setval+=19) == 29)
+ setval = 28;
+ else setval = 53;
+ else setval = 32;
+ float gray;
+ if( setval == 53 )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert
new file mode 100644
index 0000000000..12b66d8b79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/control_flow/nested_if_else_vert.vert
@@ -0,0 +1,40 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int setval = 30;
+
+ if(--setval!=29)
+ if( (setval+=11) == 40)
+ if(setval/4 == 11)
+ setval = 11;
+ else if(setval/4 == 10)
+ if(setval-3 == 37)
+ setval=12;
+ else setval = 9;
+ else setval = 10;
+ else setval = 30;
+ else if(setval == 29)
+ if((setval+=19) != 48)
+ setval = 13;
+ else if((setval+=19) == 29)
+ setval = 28;
+ else setval = 53;
+ else setval = 32;
+ float gray;
+ if( setval == 53 )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html
new file mode 100644
index 0000000000..d15f070e75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: cos_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cos_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cos_float_frag_xvary.frag"
+ },
+ "name": "cos_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cos_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cos_vec2_frag_xvary.frag"
+ },
+ "name": "cos_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cos_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cos_vec3_frag_xvary.frag"
+ },
+ "name": "cos_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "cos_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "cos_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "cos_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "cos_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "cos_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "cos_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "cos_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "cos_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "cos_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag
new file mode 100644
index 0000000000..c1f5bcad68
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ gl_FragColor = vec4(0.5 * cos(2.0 * M_PI * color.r) + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..6dace29eb4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_frag_xvary_ref.frag
@@ -0,0 +1,53 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * ( fract(abs(color.r)) - 0.5 );
+ float sign = 1.0;
+ float cos_c = -1.0;
+ float fact_even = 1.0;
+ float fact_odd = 1.0;
+ float sum;
+
+ // At this point c is in the range [-PI, PI)
+
+ // Taylor-Maclaurin series expansion for cosine
+ //
+ // Apply the property that pow(a, b + c) = pow(a, b) * pow(a, c)
+ // and the property that 1.0/(a*b) = 1.0/a * 1.0/b
+ // to make sure no register ever overflows the range (-16384, +16384)
+ // mandated for mediump variables.
+
+ for(int i = 2; i <= 10; i += 2)
+ {
+ // fact_even will hold at most the value 3840.
+ fact_even *= float(i);
+
+ // fact_odd will always be smaller than fact_even
+ fact_odd *= float(i-1);
+
+ // pow(c, float(i/2)) takes at most the value pow(PI, 5), which is approx. 306
+ // abs(sum) is at most PI/2.0
+ sum = sign * pow(abs(c), float(i/2))/fact_even;
+
+ // abs(sum/fact_odd) is at most PI/2.0
+ // cos_c is always bound in the range [-1.0, 1.0)
+ cos_c += pow(abs(c), float(i/2))*(sum/fact_odd);
+
+ sign = -sign;
+ }
+
+ gl_FragColor = vec4(0.5 * cos_c + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert
new file mode 100644
index 0000000000..e240263025
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ color = vec4(0.5 * cos(2.0 * M_PI * gtf_Color.r) + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..38b68b78ad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_float_vert_xvary_ref.vert
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * gtf_Color.r;
+ float sign = -1.0;
+ float cos_c = 1.0;
+ float fact = 1.0;
+
+ // Taylor-Maclaurin series expansion for cosine
+ for(int i = 2; i <= 20; i += 2)
+ {
+ fact *= float(i)*float(i-1);
+ cos_c += sign*pow(c, float(i))/fact;
+ sign = -sign;
+ }
+
+ color = vec4(0.5 * cos_c + 0.5, 0.0, 0.0, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..92f3d3990a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ gl_FragColor = vec4(0.5 * cos(2.0 * M_PI * color.rg) + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..ad44ee73f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_frag_xvary_ref.frag
@@ -0,0 +1,57 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * ( fract(abs(color.rg)) - 0.5 );
+ float sign = 1.0;
+ vec2 cos_c = vec2(-1.0, -1.0);
+ float fact_even = 1.0;
+ float fact_odd = 1.0;
+ vec2 sum;
+ vec2 exp;
+
+ // At this point c is in the range [-PI, PI)
+
+ // Taylor-Maclaurin series expansion for cosine
+ //
+ // Apply the property that pow(a, b + c) = pow(a, b) * pow(a, c)
+ // and the property that 1.0/(a*b) = 1.0/a * 1.0/b
+ // to make sure no register ever overflows the range (-16384, +16384)
+ // mandated for mediump variables.
+
+ for(int i = 2; i <= 10; i += 2)
+ {
+ // fact_even will hold at most the value 3840.
+ fact_even *= float(i);
+
+ // fact_odd will always be smaller than fact_even
+ fact_odd *= float(i-1);
+
+ // exp is at most (5,5)
+ exp = vec2(float(i/2), float(i/2));
+
+ // pow(c, exp) takes at most the value pow(PI, 5), which is approx. 306
+ // abs(sum) is at most PI/2.0
+ sum = sign * pow(abs(c), exp)/fact_even;
+
+ // abs(sum/fact_odd) is at most PI/2.0
+ // cos_c is always bound in the range [-1.0, 1.0)
+ cos_c += pow(abs(c), exp)*(sum/fact_odd);
+
+ sign = -sign;
+ }
+
+ gl_FragColor = vec4(0.5 * cos_c + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..c3aeba8ccd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ color = vec4(0.5 * cos(2.0 * M_PI * gtf_Color.rg) + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..4aa50e3b88
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec2_vert_xvary_ref.vert
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * gtf_Color.rg;
+ float sign = -1.0;
+ vec2 cos_c = vec2(1.0, 1.0);
+ float fact = 1.0;
+
+ // Taylor-Maclaurin series expansion for cosine
+ for(int i = 2; i <= 20; i += 2)
+ {
+ fact *= float(i)*float(i-1);
+ cos_c += sign*pow(c, vec2(float(i), float(i)))/fact;
+ sign = -sign;
+ }
+
+ color = vec4(0.5 * cos_c + 0.5, 0.0, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..a51a52db02
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ gl_FragColor = vec4(0.5 * cos(2.0 * M_PI * color.rgb) + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..c228a078e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_frag_xvary_ref.frag
@@ -0,0 +1,57 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * ( fract(abs(color.rgb)) - 0.5 );
+ float sign = 1.0;
+ vec3 cos_c = vec3(-1.0, -1.0, -1.0);
+ float fact_even = 1.0;
+ float fact_odd = 1.0;
+ vec3 sum;
+ vec3 exp;
+
+ // At this point c is in the range [-PI, PI)
+
+ // Taylor-Maclaurin series expansion for cosine
+ //
+ // Apply the property that pow(a, b + c) = pow(a, b) * pow(a, c)
+ // and the property that 1.0/(a*b) = 1.0/a * 1.0/b
+ // to make sure no register ever overflows the range (-16384, +16384)
+ // mandated for mediump variables.
+
+ for(int i = 2; i <= 10; i += 2)
+ {
+ // fact_even will hold at most the value 3840.
+ fact_even *= float(i);
+
+ // fact_odd will always be smaller than fact_even
+ fact_odd *= float(i-1);
+
+ // exp is at most (5,5,5)
+ exp = vec3(float(i/2), float(i/2), float(i/2));
+
+ // pow(c, exp) takes at most the value pow(PI, 5), which is approx. 306
+ // abs(sum) is at most PI/2.0
+ sum = sign * pow(abs(c), exp)/fact_even;
+
+ // abs(sum/fact_odd) is at most PI/2.0
+ // cos_c is always bound in the range [-1.0, 1.0)
+ cos_c += pow(abs(c), exp)*(sum/fact_odd);
+
+ sign = -sign;
+ }
+
+ gl_FragColor = vec4(0.5 * cos_c + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..7c1d8b6270
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ color = vec4(0.5 * cos(2.0 * M_PI * gtf_Color.rgb) + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..63ebd02500
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/cos_vec3_vert_xvary_ref.vert
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * gtf_Color.rgb;
+ float sign = -1.0;
+ vec3 cos_c = vec3(1.0,1.0,1.0);
+ float fact = 1.0;
+
+ // Taylor-Maclaurin series expansion for cosine
+ for(int i = 2; i <= 20; i += 2)
+ {
+ fact *= float(i)*float(i-1);
+ cos_c += sign*pow(c, vec3(float(i),float(i),float(i)))/fact;
+ sign = -sign;
+ }
+
+ color = vec4(0.5 * cos_c + 0.5, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt
new file mode 100644
index 0000000000..64f23d8c39
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cos/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+cos_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html
new file mode 100644
index 0000000000..210807e5e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_001_to_002.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: cross_001_to_002.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cross_vec3_frag_xvaryyconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "cross_vec3_frag_xvaryyconst.frag"
+ },
+ "name": "cross_vec3_frag_xvaryyconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "cross_vec3_vert_xvaryyconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "cross_vec3_vert_xvaryyconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "cross_vec3_vert_xvaryyconst.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag
new file mode 100644
index 0000000000..5109326e41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = vec3(1.0, 0.0, 0.0);
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ gl_FragColor = vec4((cross(v1, v2) + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag
new file mode 100644
index 0000000000..024710b282
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_frag_xvaryyconst_ref.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = vec3(1.0, 0.0, 0.0);
+ vec3 v3;
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+ v3.x = v1.y * v2.z - v2.y * v1.z;
+ v3.y = v2.x * v1.z - v1.x * v2.z;
+ v3.z = v1.x * v2.y - v2.x * v1.y;
+ gl_FragColor = vec4((v3 + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert
new file mode 100644
index 0000000000..4faad3c659
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = vec3(1.0, 0.0, 0.0);
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+ color = vec4((cross(v1, v2) + 1.0) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert
new file mode 100644
index 0000000000..8e02aecc17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/cross_vec3_vert_xvaryyconst_ref.vert
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = vec3(1.0, 0.0, 0.0);
+ vec3 v3;
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+ v3.x = v1.y * v2.z - v2.y * v1.z;
+ v3.y = v2.x * v1.z - v1.x * v2.z;
+ v3.z = v1.x * v2.y - v2.x * v1.y;
+ color = vec4((v3 + 1.0) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt
new file mode 100644
index 0000000000..4ce9794db5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/cross/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+cross_001_to_002.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag
new file mode 100644
index 0000000000..48175cd07e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert
new file mode 100644
index 0000000000..319999cb93
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html
new file mode 100644
index 0000000000..7b41e42798
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_001_to_001.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: default_001_to_001.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "default.vert",
+ "fragmentShader": "default.frag"
+ },
+ "name": "default.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag
new file mode 100644
index 0000000000..48cd225675
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D gtf_Texture0;
+varying vec4 color;
+varying vec4 gtf_TexCoord[1];
+
+void main (void)
+{
+ gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].xy);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert
new file mode 100644
index 0000000000..0088a62147
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/default_textured.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 gtf_TexCoord[1];
+attribute vec4 gtf_MultiTexCoord0;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gtf_TexCoord[0] = gtf_MultiTexCoord0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag
new file mode 100644
index 0000000000..a57779cd1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/expected.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec4 result;
+
+void main (void)
+{
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt
new file mode 100644
index 0000000000..44c03e906b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/default/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+default_001_to_001.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html
new file mode 100644
index 0000000000..503996c534
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: degrees_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "degrees_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "degrees_float_frag_xvary.frag"
+ },
+ "name": "degrees_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "degrees_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "degrees_vec2_frag_xvary.frag"
+ },
+ "name": "degrees_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "degrees_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "degrees_vec3_frag_xvary.frag"
+ },
+ "name": "degrees_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "degrees_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "degrees_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "degrees_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "degrees_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "degrees_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "degrees_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "degrees_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "degrees_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "degrees_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag
new file mode 100644
index 0000000000..977123df4c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..1c19a3811e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert
new file mode 100644
index 0000000000..25f0e95d84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..dabf62da94
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_float_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..24df526729
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..cbff75621f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..57f5af257f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..28bafb275b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec2_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..b57c486a74
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..855d837054
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..d3089d30c3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(degrees(c) / (2.0 * 360.0) + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..a8aeff87f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/degrees_vec3_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4((c * 180.0 / M_PI) / (2.0 * 360.0) + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt
new file mode 100644
index 0000000000..caa0c110d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/degrees/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+degrees_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html
new file mode 100644
index 0000000000..d976162551
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_001_to_002.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: discard_001_to_002.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "discard_frag.frag"
+ },
+ "name": "discard_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "discard_cond_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "discard_cond_frag.frag"
+ },
+ "name": "discard_cond_frag.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag
new file mode 100644
index 0000000000..31de4525c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ bool toDiscard = false;
+ if(color.r > 0.75) toDiscard = true;
+ else if(color.g > 0.75) toDiscard = true;
+ else if(color.b > 0.75) toDiscard = true;
+
+ if (toDiscard) discard;
+
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag
new file mode 100644
index 0000000000..f455d1f57e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_cond_frag_ref.frag
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ if(color.r > 0.75 || color.g > 0.75 || color.b > 0.75)
+ {
+ /* The background color is black by default.
+ * Setting the fragment color to it simulates a discarded fragment.
+ */
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ }
+ else
+ {
+ gl_FragColor = color;
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag
new file mode 100644
index 0000000000..c88776fb38
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/discard_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+ discard;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt
new file mode 100644
index 0000000000..ff9bfa993d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/discard/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+discard_001_to_002.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html
new file mode 100644
index 0000000000..04d2aee15f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: distance_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "distance_float_frag_xvaryyhalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "distance_float_frag_xvaryyhalf.frag"
+ },
+ "name": "distance_float_frag_xvaryyhalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "distance_vec2_frag_xvaryyhalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "distance_vec2_frag_xvaryyhalf.frag"
+ },
+ "name": "distance_vec2_frag_xvaryyhalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "distance_vec3_frag_xvaryyhalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "distance_vec3_frag_xvaryyhalf.frag"
+ },
+ "name": "distance_vec3_frag_xvaryyhalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "distance_float_vert_xvaryyhalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "distance_float_vert_xvaryyhalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "distance_float_vert_xvaryyhalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "distance_vec2_vert_xvaryyhalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "distance_vec2_vert_xvaryyhalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "distance_vec2_vert_xvaryyhalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "distance_vec3_vert_xvaryyhalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "distance_vec3_vert_xvaryyhalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "distance_vec3_vert_xvaryyhalf.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag
new file mode 100644
index 0000000000..0d0a2e8a4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(distance(color.r, 0.5)), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag
new file mode 100644
index 0000000000..46d1e32f30
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_frag_xvaryyhalf_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(sqrt(pow(abs(color.r - 0.5), 2.0))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert
new file mode 100644
index 0000000000..9c915dc981
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(distance(gtf_Color.r, 0.5)), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert
new file mode 100644
index 0000000000..a66dee0a24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_float_vert_xvaryyhalf_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(sqrt(pow(abs(gtf_Color.r - 0.5), 2.0))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag
new file mode 100644
index 0000000000..bec06c2a9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(distance(color.rg, vec2(0.5))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag
new file mode 100644
index 0000000000..ff73840933
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_frag_xvaryyhalf_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(sqrt(pow(abs(color.r - 0.5), 2.0) + pow(abs(color.g - 0.5), 2.0))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert
new file mode 100644
index 0000000000..398e1cfb7a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(distance(gtf_Color.rg, vec2(0.5))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert
new file mode 100644
index 0000000000..c2cd4c9361
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec2_vert_xvaryyhalf_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(sqrt(pow(abs(gtf_Color.r - 0.5), 2.0) + pow(abs(gtf_Color.g - 0.5), 2.0))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag
new file mode 100644
index 0000000000..b65a37d5aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(distance(color.rgb, vec3(0.5))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag
new file mode 100644
index 0000000000..a4517828d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_frag_xvaryyhalf_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(sqrt(pow(abs(color.r - 0.5), 2.0) + pow(abs(color.g - 0.5), 2.0) + pow(abs(color.b - 0.5), 2.0))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert
new file mode 100644
index 0000000000..2efe949b12
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(distance(gtf_Color.rgb, vec3(0.5))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert
new file mode 100644
index 0000000000..0d24c7ce82
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/distance_vec3_vert_xvaryyhalf_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(sqrt(pow(abs(gtf_Color.r - 0.5), 2.0) + pow(abs(gtf_Color.g - 0.5), 2.0) + pow(abs(gtf_Color.b - 0.5), 2.0))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt
new file mode 100644
index 0000000000..bfbce99ed1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/distance/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+distance_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html
new file mode 100644
index 0000000000..975dde6742
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: dot_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dot_float_frag_xvaryyone_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dot_float_frag_xvaryyone.frag"
+ },
+ "name": "dot_float_frag_xvaryyone.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dot_vec2_frag_xvaryyhalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dot_vec2_frag_xvaryyhalf.frag"
+ },
+ "name": "dot_vec2_frag_xvaryyhalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dot_vec3_frag_xvaryythird_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "dot_vec3_frag_xvaryythird.frag"
+ },
+ "name": "dot_vec3_frag_xvaryythird.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "dot_float_vert_xvaryyone_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "dot_float_vert_xvaryyone.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "dot_float_vert_xvaryyone.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "dot_vec2_vert_xvaryyhalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "dot_vec2_vert_xvaryyhalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "dot_vec2_vert_xvaryyhalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "dot_vec3_vert_xvaryythird_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "dot_vec3_vert_xvaryythird.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "dot_vec3_vert_xvaryythird.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag
new file mode 100644
index 0000000000..ddb6ade7c4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(dot(color.r, 1.0)), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag
new file mode 100644
index 0000000000..9e5672b1d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_frag_xvaryyone_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(color.r), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert
new file mode 100644
index 0000000000..3c3e8d0c86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(dot(gtf_Color.r, 1.0)), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert
new file mode 100644
index 0000000000..940b53e278
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_float_vert_xvaryyone_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(gtf_Color.r), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag
new file mode 100644
index 0000000000..de74683979
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(dot(color.rg, vec2(0.5))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag
new file mode 100644
index 0000000000..82935af669
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_frag_xvaryyhalf_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(color.r + color.g) * 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert
new file mode 100644
index 0000000000..8098142fab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(dot(gtf_Color.rg, vec2(0.5))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert
new file mode 100644
index 0000000000..81206d3dfb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec2_vert_xvaryyhalf_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(gtf_Color.r + gtf_Color.g) * 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag
new file mode 100644
index 0000000000..13e1ac8134
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(dot(color.rgb, vec3(0.3333))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag
new file mode 100644
index 0000000000..d3a96d5be5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_frag_xvaryythird_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(color.r + color.g + color.b) * 0.3333, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert
new file mode 100644
index 0000000000..506d16c89e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(dot(gtf_Color.rgb, vec3(0.3333))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert
new file mode 100644
index 0000000000..daba538dab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/dot_vec3_vert_xvaryythird_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(gtf_Color.r + gtf_Color.g + gtf_Color.b) * 0.3333, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt
new file mode 100644
index 0000000000..e87547fd33
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/dot/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+dot_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html
new file mode 100644
index 0000000000..40ab967057
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: equal_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_vec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_vec2_frag.frag"
+ },
+ "name": "equal_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "equal_vec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "equal_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "equal_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_vec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_vec3_frag.frag"
+ },
+ "name": "equal_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "equal_vec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "equal_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "equal_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_ivec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_ivec2_frag.frag"
+ },
+ "name": "equal_ivec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "equal_ivec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "equal_ivec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "equal_ivec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_ivec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_ivec3_frag.frag"
+ },
+ "name": "equal_ivec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "equal_ivec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "equal_ivec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "equal_ivec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html
new file mode 100644
index 0000000000..6d61182c36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_009_to_012.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: equal_009_to_012.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_bvec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_bvec2_frag.frag"
+ },
+ "name": "equal_bvec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "equal_bvec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "equal_bvec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "equal_bvec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_bvec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equal_bvec3_frag.frag"
+ },
+ "name": "equal_bvec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "equal_bvec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "equal_bvec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "equal_bvec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag
new file mode 100644
index 0000000000..572c0646dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(equal(bvec2(c), bvec2(true)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag
new file mode 100644
index 0000000000..5433b3967a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 eq(in bvec2 a, in bvec2 b)
+{
+ bvec2 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(eq(bvec2(c), bvec2(true)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert
new file mode 100644
index 0000000000..50cf29351a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(equal(bvec2(c), bvec2(true)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert
new file mode 100644
index 0000000000..015c0cbb36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 eq(in bvec2 a, in bvec2 b)
+{
+ bvec2 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(eq(bvec2(c), bvec2(true)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag
new file mode 100644
index 0000000000..abce71547a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(equal(bvec3(c), bvec3(true)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag
new file mode 100644
index 0000000000..b8b7137e5d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 eq(in bvec3 a, in bvec3 b)
+{
+ bvec3 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] == b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(eq(bvec3(c), bvec3(true)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert
new file mode 100644
index 0000000000..85872d7d52
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(equal(bvec3(c), bvec3(true)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert
new file mode 100644
index 0000000000..d37018d75b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_bvec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 eq(in bvec3 a, in bvec3 b)
+{
+ bvec3 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] == b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(eq(bvec3(c), bvec3(true)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag
new file mode 100644
index 0000000000..4ed1070ef4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(equal(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag
new file mode 100644
index 0000000000..0c32cb1061
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec2 eq(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(eq(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert
new file mode 100644
index 0000000000..fde98be8b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(equal(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert
new file mode 100644
index 0000000000..65983106ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 eq(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(eq(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag
new file mode 100644
index 0000000000..dab4bc460f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(equal(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag
new file mode 100644
index 0000000000..2af8c6dd1f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 eq(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] == b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(eq(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert
new file mode 100644
index 0000000000..914b7e92a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(equal(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert
new file mode 100644
index 0000000000..53f8da4e29
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_ivec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 eq(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] == b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(eq(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag
new file mode 100644
index 0000000000..3c45eda536
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(equal(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag
new file mode 100644
index 0000000000..f59b45642d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 eq(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(eq(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert
new file mode 100644
index 0000000000..2477448f50
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(equal(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert
new file mode 100644
index 0000000000..845aeaf897
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 eq(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(eq(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag
new file mode 100644
index 0000000000..95c11a4ec9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(equal(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag
new file mode 100644
index 0000000000..b71c3e6f07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 eq(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] == b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(eq(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert
new file mode 100644
index 0000000000..3d7c06cb73
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(equal(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert
new file mode 100644
index 0000000000..ae86feabf3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/equal_vec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 eq(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] == b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] == b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] == b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(eq(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt
new file mode 100644
index 0000000000..cd4a81eb51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/equal/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+equal_001_to_008.html
+equal_009_to_012.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html
new file mode 100644
index 0000000000..4e2bca1c08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: exp_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_float_frag_xvary.frag"
+ },
+ "name": "exp_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec2_frag_xvary.frag"
+ },
+ "name": "exp_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec3_frag_xvary.frag"
+ },
+ "name": "exp_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_float_frag_xvaryneg_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_float_frag_xvaryneg.frag"
+ },
+ "name": "exp_float_frag_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec2_frag_xvaryneg_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec2_frag_xvaryneg.frag"
+ },
+ "name": "exp_vec2_frag_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec3_frag_xvaryneg_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp_vec3_frag_xvaryneg.frag"
+ },
+ "name": "exp_vec3_frag_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html
new file mode 100644
index 0000000000..95531a316f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_009_to_012.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: exp_009_to_012.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "exp_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp_float_vert_xvaryneg_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp_float_vert_xvaryneg.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp_float_vert_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp_vec2_vert_xvaryneg_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp_vec2_vert_xvaryneg.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp_vec2_vert_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp_vec3_vert_xvaryneg_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp_vec3_vert_xvaryneg.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp_vec3_vert_xvaryneg.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag
new file mode 100644
index 0000000000..3e25c3022d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp3 = 20.0855;
+ float c = color.r;
+ gl_FragColor = vec4(exp(3.0 * c) / exp3, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..5fb281520b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvary_ref.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ const float exp3 = 20.0855;
+ float c = color.r;
+ gl_FragColor = vec4(pow(exp1, 3.0 * c) / exp3, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag
new file mode 100644
index 0000000000..92f3e8fb79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = -color.r;
+ gl_FragColor = vec4(exp(3.0 * c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag
new file mode 100644
index 0000000000..f165cebe8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_frag_xvaryneg_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ float c = color.r;
+ gl_FragColor = vec4(1.0 / pow(exp1, 3.0 * c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert
new file mode 100644
index 0000000000..70700362a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp3 = 20.0855;
+ float c = gtf_Color.r;
+ color = vec4(exp(3.0 * c) / exp3, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..9928f9b245
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvary_ref.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ const float exp3 = 20.0855;
+ float c = gtf_Color.r;
+ color = vec4(pow(exp1, 3.0 * c) / exp3, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert
new file mode 100644
index 0000000000..c5e2ea8b76
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = -gtf_Color.r;
+ color = vec4(exp(3.0 * c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert
new file mode 100644
index 0000000000..8fb130dec5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_float_vert_xvaryneg_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ float c = gtf_Color.r;
+ color = vec4(1.0 / pow(exp1, 3.0 * c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..f330458f15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp3 = 20.0855;
+ vec2 c = color.rg;
+ gl_FragColor = vec4(exp(3.0 * c) / exp3, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..c263a4c88f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvary_ref.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ const float exp3 = 20.0855;
+ vec2 c = color.rg;
+ gl_FragColor = vec4(pow(vec2(exp1), 3.0 * c) / exp3, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag
new file mode 100644
index 0000000000..895a88b055
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = -color.rg;
+ gl_FragColor = vec4(exp(3.0 * c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag
new file mode 100644
index 0000000000..8e408bc9bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_frag_xvaryneg_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ vec2 c = color.rg;
+ gl_FragColor = vec4(1.0 / pow(vec2(exp1), 3.0 * c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..ee96286fd8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp3 = 20.0855;
+ vec2 c = gtf_Color.rg;
+ color = vec4(exp(3.0 * c) / exp3, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..313fad0127
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvary_ref.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ const float exp3 = 20.0855;
+ vec2 c = gtf_Color.rg;
+ color = vec4(pow(vec2(exp1), 3.0 * c) / exp3, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert
new file mode 100644
index 0000000000..c4ed25c8f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = -gtf_Color.rg;
+ color = vec4(exp(3.0 * c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert
new file mode 100644
index 0000000000..2d26b842ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec2_vert_xvaryneg_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ vec2 c = gtf_Color.rg;
+ color = vec4(1.0 / pow(vec2(exp1), 3.0 * c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..df08194b65
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp3 = 20.0855;
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(exp(3.0 * c) / exp3, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..2bfe2e58d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvary_ref.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ const float exp3 = 20.0855;
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(pow(vec3(exp1), 3.0 * c) / exp3, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag
new file mode 100644
index 0000000000..d4f553fec6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = -color.rgb;
+ gl_FragColor = vec4(exp(3.0 * c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag
new file mode 100644
index 0000000000..af2433457c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_frag_xvaryneg_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(1.0 / pow(vec3(exp1), 3.0 * c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..fa8b8e82ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp3 = 20.0855;
+ vec3 c = gtf_Color.rgb;
+ color = vec4(exp(3.0 * c) / exp3, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..22e8f94256
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvary_ref.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ const float exp3 = 20.0855;
+ vec3 c = gtf_Color.rgb;
+ color = vec4(pow(vec3(exp1), 3.0 * c) / exp3, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert
new file mode 100644
index 0000000000..c49da07289
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = -gtf_Color.rgb;
+ color = vec4(exp(3.0 * c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert
new file mode 100644
index 0000000000..c078b1aa72
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/exp_vec3_vert_xvaryneg_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float exp1 = 2.7183;
+ vec3 c = gtf_Color.rgb;
+ color = vec4(1.0 / pow(vec3(exp1), 3.0 * c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt
new file mode 100644
index 0000000000..4f56a2b329
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+exp_001_to_008.html
+exp_009_to_012.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html
new file mode 100644
index 0000000000..0c4be1d366
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: exp2_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_float_frag_xvary.frag"
+ },
+ "name": "exp2_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec2_frag_xvary.frag"
+ },
+ "name": "exp2_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec3_frag_xvary.frag"
+ },
+ "name": "exp2_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_float_frag_xvaryneg_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_float_frag_xvaryneg.frag"
+ },
+ "name": "exp2_float_frag_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec2_frag_xvaryneg_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec2_frag_xvaryneg.frag"
+ },
+ "name": "exp2_vec2_frag_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec3_frag_xvaryneg_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "exp2_vec3_frag_xvaryneg.frag"
+ },
+ "name": "exp2_vec3_frag_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp2_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp2_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp2_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp2_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp2_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp2_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html
new file mode 100644
index 0000000000..331710c39c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_009_to_012.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: exp2_009_to_012.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "exp2_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp2_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp2_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp2_float_vert_xvaryneg_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp2_float_vert_xvaryneg.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp2_float_vert_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp2_vec2_vert_xvaryneg_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp2_vec2_vert_xvaryneg.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp2_vec2_vert_xvaryneg.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "exp2_vec3_vert_xvaryneg_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "exp2_vec3_vert_xvaryneg.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "exp2_vec3_vert_xvaryneg.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag
new file mode 100644
index 0000000000..c3e2d04a6a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = color.r;
+ gl_FragColor = vec4(exp2(5.0 * c) / 32.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..cdad89f953
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = color.r;
+ gl_FragColor = vec4(pow(2.0, 5.0 * c) / 32.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag
new file mode 100644
index 0000000000..8d285849aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = -color.r;
+ gl_FragColor = vec4(exp2(5.0 * c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag
new file mode 100644
index 0000000000..efad77cddb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_frag_xvaryneg_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = color.r;
+ gl_FragColor = vec4(1.0 / pow(2.0, 5.0 * c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert
new file mode 100644
index 0000000000..393a4f42e6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = gtf_Color.r;
+ color = vec4(exp2(5.0 * c) / 32.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..3a95dc1a14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = gtf_Color.r;
+ color = vec4(pow(2.0, 5.0 * c) / 32.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert
new file mode 100644
index 0000000000..5e3ce879ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = -gtf_Color.r;
+ color = vec4(exp2(5.0 * c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert
new file mode 100644
index 0000000000..4303b64954
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_float_vert_xvaryneg_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = gtf_Color.r;
+ color = vec4(1.0 / pow(2.0, 5.0 * c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..436c856de2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = color.rg;
+ gl_FragColor = vec4(exp2(5.0 * c) / 32.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..58fc9b2a11
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = color.rg;
+ gl_FragColor = vec4(pow(vec2(2.0), 5.0 * c) / 32.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag
new file mode 100644
index 0000000000..d3112c7991
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = -color.rg;
+ gl_FragColor = vec4(exp2(5.0 * c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag
new file mode 100644
index 0000000000..ca1a4e2424
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_frag_xvaryneg_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = color.rg;
+ gl_FragColor = vec4(1.0 / pow(vec2(2.0), 5.0 * c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..dffd2f6b8a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = gtf_Color.rg;
+ color = vec4(exp2(5.0 * c) / 32.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..f9ae9fa180
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = gtf_Color.rg;
+ color = vec4(pow(vec2(2.0), 5.0 * c) / 32.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert
new file mode 100644
index 0000000000..5b46f97f82
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = -gtf_Color.rg;
+ color = vec4(exp2(5.0 * c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert
new file mode 100644
index 0000000000..15a19d450f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec2_vert_xvaryneg_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = gtf_Color.rg;
+ color = vec4(1.0 / pow(vec2(2.0), 5.0 * c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..bbe41d3002
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(exp2(5.0 * c) / 32.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..51719fc226
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(pow(vec3(2.0), 5.0 * c) / 32.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag
new file mode 100644
index 0000000000..6f799874ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = -color.rgb;
+ gl_FragColor = vec4(exp2(5.0 * c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag
new file mode 100644
index 0000000000..b7807d4c6b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_frag_xvaryneg_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(1.0 / pow(vec3(2.0), 5.0 * c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..ace9f91be0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = gtf_Color.rgb;
+ color = vec4(exp2(5.0 * c) / 32.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..020a56e708
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = gtf_Color.rgb;
+ color = vec4(pow(vec3(2.0), 5.0 * c) / 32.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert
new file mode 100644
index 0000000000..708cd0494c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = -gtf_Color.rgb;
+ color = vec4(exp2(5.0 * c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert
new file mode 100644
index 0000000000..3a0238f59c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/exp2_vec3_vert_xvaryneg_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = gtf_Color.rgb;
+ color = vec4(1.0 / pow(vec3(2.0), 5.0 * c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt
new file mode 100644
index 0000000000..f893cd413e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/exp2/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+exp2_001_to_008.html
+exp2_009_to_012.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html
new file mode 100644
index 0000000000..911e8cfebb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: faceforward_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "faceforward_float_frag_nvaryiconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "faceforward_float_frag_nvaryiconst.frag"
+ },
+ "name": "faceforward_float_frag_nvaryiconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "faceforward_float_vert_nvaryiconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "faceforward_float_vert_nvaryiconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "faceforward_float_vert_nvaryiconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "faceforward_vec2_frag_nvaryiconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "faceforward_vec2_frag_nvaryiconst.frag"
+ },
+ "name": "faceforward_vec2_frag_nvaryiconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "faceforward_vec2_vert_nvaryiconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "faceforward_vec2_vert_nvaryiconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "faceforward_vec2_vert_nvaryiconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "faceforward_vec3_frag_nvaryiconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "faceforward_vec3_frag_nvaryiconst.frag"
+ },
+ "name": "faceforward_vec3_frag_nvaryiconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "faceforward_vec3_vert_nvaryiconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "faceforward_vec3_vert_nvaryiconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "faceforward_vec3_vert_nvaryiconst.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag
new file mode 100644
index 0000000000..41fb495458
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (color.g * 2.0) - 1.0;
+ float v2 = (color.b * 2.0) - 1.0;
+
+ gl_FragColor = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag
new file mode 100644
index 0000000000..788d24b1e9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_frag_nvaryiconst_ref.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (color.g * 2.0) - 1.0;
+ float v2 = (color.b * 2.0) - 1.0;
+
+ if(dot(v1, v2) >= 0.0) v1 *= -1.0;
+ gl_FragColor = vec4((v1 + 1.0) / 2.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert
new file mode 100644
index 0000000000..9f806e727e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (gtf_Color.g * 2.0) - 1.0;
+ float v2 = (gtf_Color.b * 2.0) - 1.0;
+
+ color = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert
new file mode 100644
index 0000000000..df8ccb1fd5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_float_vert_nvaryiconst_ref.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (gtf_Color.g * 2.0) - 1.0;
+ float v2 = (gtf_Color.b * 2.0) - 1.0;
+
+ if(dot(v1, v2) >= 0.0) v1 *= -1.0;
+ color = vec4((v1 + 1.0) / 2.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag
new file mode 100644
index 0000000000..d877115396
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ gl_FragColor = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag
new file mode 100644
index 0000000000..16cf215c66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_frag_nvaryiconst_ref.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ if(dot(v1, v2) >= 0.0) v1 *= -1.0;
+ gl_FragColor = vec4((v1 + 1.0) / 2.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert
new file mode 100644
index 0000000000..18d5e26477
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ color = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert
new file mode 100644
index 0000000000..3a102015bb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec2_vert_nvaryiconst_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ if(dot(v1, v2) >= 0.0) v1 *= -1.0;
+ color = vec4((v1 + 1.0) / 2.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag
new file mode 100644
index 0000000000..dd50453018
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ gl_FragColor = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag
new file mode 100644
index 0000000000..6316f78ba3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_frag_nvaryiconst_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ if(dot(v1, v2) >= 0.0) v1 *= -1.0;
+ gl_FragColor = vec4((v1 + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert
new file mode 100644
index 0000000000..30cb98c6e0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ color = vec4((faceforward(v1, v2, v1) + 1.0) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert
new file mode 100644
index 0000000000..a6c8e6b2ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/faceforward_vec3_vert_nvaryiconst_ref.vert
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ if(dot(v1, v2) >= 0.0) v1 *= -1.0;
+ color = vec4((v1 + 1.0) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt
new file mode 100644
index 0000000000..4107e63979
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/faceforward/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+faceforward_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html
new file mode 100644
index 0000000000..433abdcede
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: floor_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "floor_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "floor_float_frag_xvary.frag"
+ },
+ "name": "floor_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "floor_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "floor_vec2_frag_xvary.frag"
+ },
+ "name": "floor_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "floor_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "floor_vec3_frag_xvary.frag"
+ },
+ "name": "floor_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "floor_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "floor_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "floor_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "floor_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "floor_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "floor_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "floor_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "floor_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "floor_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag
new file mode 100644
index 0000000000..5b74e045b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4((floor(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..6d7a786a98
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_frag_xvary_ref.frag
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float floor_ref(float x)
+{
+ if(x >= 0.0)
+ x = float(int(x));
+ else
+ x = float(int(x) - 1);
+ return x;
+}
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert
new file mode 100644
index 0000000000..987259940a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4((floor(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..9fe17c740f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_float_vert_xvary_ref.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+float floor_ref(float x)
+{
+ if(x >= 0.0)
+ x = float(int(x));
+ else
+ x = float(int(x) - 1);
+ return x;
+}
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..54a6d9a15f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4((floor(c) + 10.0) / 20.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..3f537cc357
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_frag_xvary_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+vec2 floor_ref(vec2 x)
+{
+ if(x[0] >= 0.0)
+ x[0] = float(int(x[0]));
+ else
+ x[0] = float(int(x[0]) - 1);
+ if(x[1] >= 0.0)
+ x[1] = float(int(x[1]));
+ else
+ x[1] = float(int(x[1]) - 1);
+ return x;
+}
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..3b53e23dad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4((floor(c) + 10.0) / 20.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..fabb3a0f0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec2_vert_xvary_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+vec2 floor_ref(vec2 x)
+{
+ if(x[0] >= 0.0)
+ x[0] = float(int(x[0]));
+ else
+ x[0] = float(int(x[0]) - 1);
+ if(x[1] >= 0.0)
+ x[1] = float(int(x[1]));
+ else
+ x[1] = float(int(x[1]) - 1);
+ return x;
+}
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4((floor_ref(c) + 10.0) / 20.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..55bd572178
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4((floor(c) + 10.0) / 20.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..279f765c40
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_frag_xvary_ref.frag
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+vec3 floor_ref(vec3 x)
+{
+ if(x[0] >= 0.0)
+ x[0] = float(int(x[0]));
+ else
+ x[0] = float(int(x[0]) - 1);
+ if(x[1] >= 0.0)
+ x[1] = float(int(x[1]));
+ else
+ x[1] = float(int(x[1]) - 1);
+ if(x[2] >= 0.0)
+ x[2] = float(int(x[2]));
+ else
+ x[2] = float(int(x[2]) - 1);
+ return x;
+}
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4((floor_ref(c) + 10.0) / 20.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..feacc63fb2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4((floor(c) + 10.0) / 20.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..8913a2b00c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/floor_vec3_vert_xvary_ref.vert
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+vec3 floor_ref(vec3 x)
+{
+ if(x[0] >= 0.0)
+ x[0] = float(int(x[0]));
+ else
+ x[0] = float(int(x[0]) - 1);
+ if(x[1] >= 0.0)
+ x[1] = float(int(x[1]));
+ else
+ x[1] = float(int(x[1]) - 1);
+ if(x[2] >= 0.0)
+ x[2] = float(int(x[2]));
+ else
+ x[2] = float(int(x[2]) - 1);
+ return x;
+}
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4((floor_ref(c) + 10.0) / 20.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt
new file mode 100644
index 0000000000..337787db8b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/floor/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+floor_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html
new file mode 100644
index 0000000000..5ccf6937f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: fract_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "fract_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "fract_float_frag_xvary.frag"
+ },
+ "name": "fract_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "fract_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "fract_vec2_frag_xvary.frag"
+ },
+ "name": "fract_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "fract_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "fract_vec3_frag_xvary.frag"
+ },
+ "name": "fract_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "fract_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "fract_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "fract_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "fract_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "fract_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "fract_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "fract_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "fract_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "fract_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag
new file mode 100644
index 0000000000..0900f58dbc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ c = abs(fract(c) - 0.5) * 2.0;
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..00d2a14648
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ c = abs((c - floor(c)) - 0.5) * 2.0;
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert
new file mode 100644
index 0000000000..eb8d560b8b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ c = abs(fract(c) - 0.5) * 2.0;
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..2a644b2fb0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_float_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ c = abs((c - floor(c)) - 0.5) * 2.0;
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..8288fc5fe9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ c = abs(fract(c) - 0.5) * 2.0;
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..7df7e9d88f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ c = abs((c - floor(c)) - 0.5) * 2.0;
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..8c702a8257
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ c = abs(fract(c) - 0.5) * 2.0;
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..1f81541af7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec2_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ c = abs((c - floor(c)) - 0.5) * 2.0;
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..30ce9d00dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ c = abs(fract(c) - 0.5) * 2.0;
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..f11dcf5f21
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ c = abs((c - floor(c)) - 0.5) * 2.0;
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..1a2ef5d454
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ c = abs(fract(c) - 0.5) * 2.0;
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..69dbc4ef9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/fract_vec3_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ c = abs((c - floor(c)) - 0.5) * 2.0;
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt
new file mode 100644
index 0000000000..74ccc68b54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/fract/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+fract_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag
new file mode 100644
index 0000000000..a3f81289c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_frag.frag
@@ -0,0 +1,85 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+
+
+void qualifiers(in float a[4], out float b[4], inout float c[4], const in float d[4], float e[4])
+{
+ b[0] = a[0];
+ c[0] += d[0];
+ a[0] += 1.0;
+ e[0] += 1.0;
+
+ b[1] = a[1];
+ c[1] += d[1];
+ a[1] += 1.0;
+ e[1] += 1.0;
+
+ b[2] = a[2];
+ c[2] += d[2];
+ a[2] += 1.0;
+ e[2] += 1.0;
+
+ b[3] = a[3];
+ c[3] += d[3];
+ a[3] += 1.0;
+ e[3] += 1.0;
+}
+
+
+
+void main (void)
+{
+ float a[4];
+ float b[4];
+ float c[4];
+ float d[4];
+ float e[4];
+ float q = 0.0;
+ float q2 = 0.0;
+
+ a[0] = 1.0;
+ b[0] = 2.0;
+ c[0] = 3.0;
+ d[0] = 4.0;
+ e[0] = 1.0;
+
+ a[1] = 1.0;
+ b[1] = 2.0;
+ c[1] = 3.0;
+ d[1] = 4.0;
+ e[1] = 1.0;
+
+ a[2] = 1.0;
+ b[2] = 2.0;
+ c[2] = 3.0;
+ d[2] = 4.0;
+ e[2] = 1.0;
+
+ a[3] = 1.0;
+ b[3] = 2.0;
+ c[3] = 3.0;
+ d[3] = 4.0;
+ e[3] = 1.0;
+
+ qualifiers(a, b, c, d, e);
+
+ // randomly test a value
+ if(a[0] == 1.0) q += 1.0;
+ if(b[1] == 1.0) q += 2.0;
+ if(c[2] == 7.0) q += 4.0;
+ if(d[3] == 4.0) q2 += 1.0;
+ if(e[0] == 1.0) q2 += 2.0;
+
+ gl_FragColor = vec4(vec2(q / 7.0, q2 / 3.0), 1.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert
new file mode 100644
index 0000000000..79493b346f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/array_float_vert.vert
@@ -0,0 +1,86 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+void qualifiers(in float a[4], out float b[4], inout float c[4], const in float d[4], float e[4])
+{
+ b[0] = a[0];
+ c[0] += d[0];
+ a[0] += 1.0;
+ e[0] += 1.0;
+
+ b[1] = a[1];
+ c[1] += d[1];
+ a[1] += 1.0;
+ e[1] += 1.0;
+
+ b[2] = a[2];
+ c[2] += d[2];
+ a[2] += 1.0;
+ e[2] += 1.0;
+
+ b[3] = a[3];
+ c[3] += d[3];
+ a[3] += 1.0;
+ e[3] += 1.0;
+}
+
+
+
+
+void main (void)
+{
+ float a[4];
+ float b[4];
+ float c[4];
+ float d[4];
+ float e[4];
+ float q = 0.0;
+ float q2 = 0.0;
+
+ a[0] = 1.0;
+ b[0] = 2.0;
+ c[0] = 3.0;
+ d[0] = 4.0;
+ e[0] = 1.0;
+
+ a[1] = 1.0;
+ b[1] = 2.0;
+ c[1] = 3.0;
+ d[1] = 4.0;
+ e[1] = 1.0;
+
+ a[2] = 1.0;
+ b[2] = 2.0;
+ c[2] = 3.0;
+ d[2] = 4.0;
+ e[2] = 1.0;
+
+ a[3] = 1.0;
+ b[3] = 2.0;
+ c[3] = 3.0;
+ d[3] = 4.0;
+ e[3] = 1.0;
+
+ qualifiers(a, b, c, d, e);
+
+ // randomly test a value
+ if(a[0] == 1.0) q += 1.0;
+ if(b[1] == 1.0) q += 2.0;
+ if(c[2] == 7.0) q += 4.0;
+ if(d[3] == 4.0) q2 += 1.0;
+ if(e[0] == 1.0) q2 += 2.0;
+
+ color = vec4(vec2(q / 7.0, q2 / 3.0), 1.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag
new file mode 100644
index 0000000000..17aab5dd42
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bool function(bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+bool function(bool par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert
new file mode 100644
index 0000000000..588457ecde
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bool function(bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+bool function(bool par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag
new file mode 100644
index 0000000000..45cec23fd6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bool function(bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(par && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bool function(bool par)
+{
+ // Return the value of the parameter.
+ if(par)
+ {
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+ }
+ else
+ return false;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert
new file mode 100644
index 0000000000..6e8ef52a31
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_empty_bool_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bool function(bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(par && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bool function(bool par)
+{
+ // Return the value of the parameter.
+ if(par)
+ {
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+ }
+ else
+ return false;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag
new file mode 100644
index 0000000000..5444ddb914
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bool function(in bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bool function(in bool par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert
new file mode 100644
index 0000000000..9494f5f61b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bool function(in bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bool function(in bool par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag
new file mode 100644
index 0000000000..432124dabb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bool function(in bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(par && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bool function(in bool par)
+{
+ // Return the value of the parameter.
+ if(par)
+ {
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+ }
+ else
+ return false;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert
new file mode 100644
index 0000000000..7027edc7b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_in_bool_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bool function(in bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(par && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bool function(in bool par)
+{
+ // Return the value of the parameter.
+ if(par)
+ {
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+ }
+ else
+ return false;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag
new file mode 100644
index 0000000000..793e765b15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bool function(inout bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bool function(inout bool par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert
new file mode 100644
index 0000000000..e881eda25b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bool function(inout bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bool function(inout bool par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag
new file mode 100644
index 0000000000..cb20cb4604
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bool function(inout bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(!par && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bool function(inout bool par)
+{
+ // Return the value of the parameter.
+ if(par)
+ {
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+ }
+ else
+ return false;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert
new file mode 100644
index 0000000000..a1a9597bc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_inout_bool_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bool function(inout bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(!par && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bool function(inout bool par)
+{
+ // Return the value of the parameter.
+ if(par)
+ {
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+ }
+ else
+ return false;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag
new file mode 100644
index 0000000000..aa7e08b1cf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_frag.frag
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bool function(out bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bool function(out bool par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert
new file mode 100644
index 0000000000..485c22e687
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_array_vert.vert
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bool function(out bool par[3]);
+bool is_all(const in bool array[3], const in bool value);
+void set_all(out bool array[3], const in bool value);
+
+void main (void)
+{
+ bool par[3];
+ bool ret = false;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, true);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bool function(out bool par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return true;
+}
+
+bool is_all(const in bool array[3], const in bool value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bool array[3], const in bool value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag
new file mode 100644
index 0000000000..2c0ffe7410
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_frag.frag
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bool function(out bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(!par && ret)
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bool function(out bool par)
+{
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert
new file mode 100644
index 0000000000..21510b94bf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bool_empty_out_bool_empty_vert.vert
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bool function(out bool par);
+
+void main (void)
+{
+ bool par = true;
+ bool ret = false;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(!par && ret)
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bool function(out bool par)
+{
+ // Test parameter qualifier (default is "in").
+ par = false;
+
+ return true;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag
new file mode 100644
index 0000000000..269f051e0e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+bvec4 function(bvec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert
new file mode 100644
index 0000000000..ce77807866
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+bvec4 function(bvec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag
new file mode 100644
index 0000000000..3bab4609dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bvec4 function(bvec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert
new file mode 100644
index 0000000000..36ac4882ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_empty_bvec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bvec4 function(bvec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag
new file mode 100644
index 0000000000..360cbd268c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(in bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+bvec4 function(in bvec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert
new file mode 100644
index 0000000000..bd8fb8cd83
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(in bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, bvec4(true, true, true, true)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+bvec4 function(in bvec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag
new file mode 100644
index 0000000000..79b00fb08e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(in bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bvec4 function(in bvec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert
new file mode 100644
index 0000000000..a0c0379b20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_in_bvec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(in bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return true.
+ if(is_all(par, true) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bvec4 function(in bvec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag
new file mode 100644
index 0000000000..571268392c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(inout bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+bvec4 function(inout bvec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert
new file mode 100644
index 0000000000..3d4974f447
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(inout bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+bvec4 function(inout bvec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag
new file mode 100644
index 0000000000..d4ede0875f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_frag.frag
@@ -0,0 +1,112 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(inout bvec4 par[10]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[10], const in bvec4 value);
+void set_all(out bvec4 array[10], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[10];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+bvec4 function(inout bvec4 par[10])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[10], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+ if(array[3] != value)
+ ret = false;
+ if(array[4] != value)
+ ret = false;
+ if(array[5] != value)
+ ret = false;
+ if(array[6] != value)
+ ret = false;
+ if(array[7] != value)
+ ret = false;
+ if(array[8] != value)
+ ret = false;
+ if(array[9] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[10], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+ array[3] = value;
+ array[4] = value;
+ array[5] = value;
+ array[6] = value;
+ array[7] = value;
+ array[8] = value;
+ array[9] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert
new file mode 100644
index 0000000000..7107c7b67d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_bigarray_vert.vert
@@ -0,0 +1,112 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(inout bvec4 par[10]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[10], const in bvec4 value);
+void set_all(out bvec4 array[10], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[10];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+bvec4 function(inout bvec4 par[10])
+{
+ // Return the value of the array.
+ if(is_all(par, bvec4(true, true, true, true)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[10], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+ if(array[3] != value)
+ ret = false;
+ if(array[4] != value)
+ ret = false;
+ if(array[5] != value)
+ ret = false;
+ if(array[6] != value)
+ ret = false;
+ if(array[7] != value)
+ ret = false;
+ if(array[8] != value)
+ ret = false;
+ if(array[9] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[10], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+ array[3] = value;
+ array[4] = value;
+ array[5] = value;
+ array[6] = value;
+ array[7] = value;
+ array[8] = value;
+ array[9] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag
new file mode 100644
index 0000000000..f592dbafea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(inout bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bvec4 function(inout bvec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert
new file mode 100644
index 0000000000..3983515e5a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_inout_bvec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(inout bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bvec4 function(inout bvec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, true))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+ }
+ else
+ return bvec4(false, false, false, false);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag
new file mode 100644
index 0000000000..e729340ad5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_frag.frag
@@ -0,0 +1,85 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(out bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+bvec4 function(out bvec4 par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert
new file mode 100644
index 0000000000..6146e5ba68
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_array_vert.vert
@@ -0,0 +1,85 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+bvec4 function(out bvec4 par[3]);
+bool is_all(const in bvec4 par, const in bool value);
+bool is_all(const in bvec4 array[3], const in bvec4 value);
+void set_all(out bvec4 array[3], const in bvec4 value);
+
+void main (void)
+{
+ bvec4 par[3];
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to true.
+ set_all(par, bvec4(true, true, true, true));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, bvec4(false, false, false, false)) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+bvec4 function(out bvec4 par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, bvec4(false, false, false, false));
+
+ return bvec4(true, true, true, true);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in bvec4 array[3], const in bvec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 array[3], const in bvec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag
new file mode 100644
index 0000000000..b5cae27c4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_frag.frag
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(out bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+bvec4 function(out bvec4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert
new file mode 100644
index 0000000000..172df26f56
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/bvec4_empty_out_bvec4_empty_vert.vert
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+bvec4 function(out bvec4 par);
+bool is_all(const in bvec4 par, const in bool value);
+void set_all(out bvec4 par, const in bool value);
+
+void main (void)
+{
+ bvec4 par = bvec4(true, true, true, true);
+ bvec4 ret = bvec4(false, false, false, false);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return true.
+ if(is_all(par, false) && is_all(ret, true))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+bvec4 function(out bvec4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, false);
+
+ return bvec4(true, true, true, true);
+}
+
+bool is_all(const in bvec4 par, const in bool value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out bvec4 par, const in bool value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag
new file mode 100644
index 0000000000..ce4b5ec188
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+float function(float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+float function(float par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert
new file mode 100644
index 0000000000..fbdca2f413
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+float function(float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+float function(float par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag
new file mode 100644
index 0000000000..73893e49b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+float function(float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if((par == 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+float function(float par)
+{
+ // Return the value of the parameter.
+ if(par == 1.0)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert
new file mode 100644
index 0000000000..e8adae115d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_empty_float_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+float function(float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if((par == 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+float function(float par)
+{
+ // Return the value of the parameter.
+ if(par == 1.0)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag
new file mode 100644
index 0000000000..ec02504e37
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+float function(in float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+float function(in float par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert
new file mode 100644
index 0000000000..44617e0cfa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+float function(in float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+float function(in float par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag
new file mode 100644
index 0000000000..ae16d2fd72
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+float function(in float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if((par == 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+float function(in float par)
+{
+ // Return the value of the parameter.
+ if(par == 1.0)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert
new file mode 100644
index 0000000000..cb5194e9a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_in_float_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+float function(in float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if((par == 1.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+float function(in float par)
+{
+ // Return the value of the parameter.
+ if(par == 1.0)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag
new file mode 100644
index 0000000000..ba3d159934
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+float function(inout float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+float function(inout float par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert
new file mode 100644
index 0000000000..28f9778f02
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+float function(inout float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+float function(inout float par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag
new file mode 100644
index 0000000000..c0f08f4ed5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+float function(inout float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if((par == 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+float function(inout float par)
+{
+ // Return the value of the parameter.
+ if(par == 1.0)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert
new file mode 100644
index 0000000000..a4ccd8b159
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_inout_float_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+float function(inout float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if((par == 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+float function(inout float par)
+{
+ // Return the value of the parameter.
+ if(par == 1.0)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+ }
+ else
+ return 0.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag
new file mode 100644
index 0000000000..7a8b3b2e34
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_frag.frag
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+float function(out float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+float function(out float par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert
new file mode 100644
index 0000000000..5bcd67d5ff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_array_vert.vert
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+float function(out float par[3]);
+bool is_all(const in float array[3], const in float value);
+void set_all(out float array[3], const in float value);
+
+void main (void)
+{
+ float par[3];
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, 1.0);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+float function(out float par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return 1.0;
+}
+
+bool is_all(const in float array[3], const in float value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out float array[3], const in float value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag
new file mode 100644
index 0000000000..fc7870209f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_frag.frag
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+float function(out float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if((par == 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+float function(out float par)
+{
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert
new file mode 100644
index 0000000000..a9f4da5dd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/float_empty_out_float_empty_vert.vert
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+float function(out float par);
+
+void main (void)
+{
+ float par = 1.0;
+ float ret = 0.0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if((par == 0.0) && (ret == 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+float function(out float par)
+{
+ // Test parameter qualifier (default is "in").
+ par = 0.0;
+
+ return 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html
new file mode 100644
index 0000000000..c4a96140a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_001_to_008.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "qualifiers_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "qualifiers_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "qualifiers_float_frag.frag"
+ },
+ "name": "qualifiers_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "qualifiers_struct_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "qualifiers_struct_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "qualifiers_struct_frag.frag"
+ },
+ "name": "qualifiers_struct_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "array_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "array_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array_float_frag.frag"
+ },
+ "name": "array_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "void_empty_empty_void_empty_frag.frag"
+ },
+ "name": "void_empty_empty_void_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "void_empty_empty_void_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "void_empty_empty_void_empty_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html
new file mode 100644
index 0000000000..07308dbe1d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_009_to_016.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_empty_bool_empty_frag.frag"
+ },
+ "name": "bool_empty_empty_bool_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_empty_bool_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_empty_bool_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_empty_bool_array_frag.frag"
+ },
+ "name": "bool_empty_empty_bool_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_empty_bool_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_empty_bool_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_in_bool_empty_frag.frag"
+ },
+ "name": "bool_empty_in_bool_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_in_bool_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_in_bool_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_in_bool_array_frag.frag"
+ },
+ "name": "bool_empty_in_bool_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_in_bool_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_in_bool_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html
new file mode 100644
index 0000000000..9433423860
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_017_to_024.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_017_to_024.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_inout_bool_empty_frag.frag"
+ },
+ "name": "bool_empty_inout_bool_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_inout_bool_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_inout_bool_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_inout_bool_array_frag.frag"
+ },
+ "name": "bool_empty_inout_bool_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_inout_bool_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_inout_bool_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_out_bool_empty_frag.frag"
+ },
+ "name": "bool_empty_out_bool_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_out_bool_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_out_bool_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bool_empty_out_bool_array_frag.frag"
+ },
+ "name": "bool_empty_out_bool_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bool_empty_out_bool_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bool_empty_out_bool_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html
new file mode 100644
index 0000000000..f8fd671a46
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_025_to_032.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_025_to_032.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_empty_int_empty_frag.frag"
+ },
+ "name": "int_empty_empty_int_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_empty_int_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_empty_int_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_empty_int_array_frag.frag"
+ },
+ "name": "int_empty_empty_int_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_empty_int_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_empty_int_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_in_int_empty_frag.frag"
+ },
+ "name": "int_empty_in_int_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_in_int_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_in_int_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_in_int_array_frag.frag"
+ },
+ "name": "int_empty_in_int_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_in_int_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_in_int_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html
new file mode 100644
index 0000000000..6b54e7d96b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_033_to_040.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_033_to_040.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_inout_int_empty_frag.frag"
+ },
+ "name": "int_empty_inout_int_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_inout_int_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_inout_int_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_inout_int_array_frag.frag"
+ },
+ "name": "int_empty_inout_int_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_inout_int_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_inout_int_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_out_int_empty_frag.frag"
+ },
+ "name": "int_empty_out_int_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_out_int_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_out_int_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "int_empty_out_int_array_frag.frag"
+ },
+ "name": "int_empty_out_int_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "int_empty_out_int_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "int_empty_out_int_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html
new file mode 100644
index 0000000000..cc41133577
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_041_to_048.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_041_to_048.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_empty_float_empty_frag.frag"
+ },
+ "name": "float_empty_empty_float_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_empty_float_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_empty_float_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_empty_float_array_frag.frag"
+ },
+ "name": "float_empty_empty_float_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_empty_float_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_empty_float_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_in_float_empty_frag.frag"
+ },
+ "name": "float_empty_in_float_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_in_float_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_in_float_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_in_float_array_frag.frag"
+ },
+ "name": "float_empty_in_float_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_in_float_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_in_float_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html
new file mode 100644
index 0000000000..a78074c302
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_049_to_056.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_049_to_056.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_inout_float_empty_frag.frag"
+ },
+ "name": "float_empty_inout_float_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_inout_float_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_inout_float_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_inout_float_array_frag.frag"
+ },
+ "name": "float_empty_inout_float_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_inout_float_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_inout_float_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_out_float_empty_frag.frag"
+ },
+ "name": "float_empty_out_float_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_out_float_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_out_float_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "float_empty_out_float_array_frag.frag"
+ },
+ "name": "float_empty_out_float_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "float_empty_out_float_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "float_empty_out_float_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html
new file mode 100644
index 0000000000..05e1e9b9f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_057_to_064.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_057_to_064.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_empty_bvec4_empty_frag.frag"
+ },
+ "name": "bvec4_empty_empty_bvec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_empty_bvec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_empty_bvec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_empty_bvec4_array_frag.frag"
+ },
+ "name": "bvec4_empty_empty_bvec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_empty_bvec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_empty_bvec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_in_bvec4_empty_frag.frag"
+ },
+ "name": "bvec4_empty_in_bvec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_in_bvec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_in_bvec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_in_bvec4_array_frag.frag"
+ },
+ "name": "bvec4_empty_in_bvec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_in_bvec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_in_bvec4_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html
new file mode 100644
index 0000000000..85a1425d58
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_065_to_072.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_065_to_072.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_inout_bvec4_empty_frag.frag"
+ },
+ "name": "bvec4_empty_inout_bvec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_inout_bvec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_inout_bvec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_inout_bvec4_array_frag.frag"
+ },
+ "name": "bvec4_empty_inout_bvec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_inout_bvec4_bigarray_frag.frag"
+ },
+ "name": "bvec4_empty_inout_bvec4_bigarray_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_inout_bvec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_inout_bvec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_inout_bvec4_bigarray_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_inout_bvec4_bigarray_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_out_bvec4_empty_frag.frag"
+ },
+ "name": "bvec4_empty_out_bvec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_out_bvec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_out_bvec4_empty_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html
new file mode 100644
index 0000000000..6d8d5a69ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_073_to_080.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_073_to_080.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_empty_out_bvec4_array_frag.frag"
+ },
+ "name": "bvec4_empty_out_bvec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_empty_out_bvec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_empty_out_bvec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_empty_ivec4_empty_frag.frag"
+ },
+ "name": "ivec4_empty_empty_ivec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_empty_ivec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_empty_ivec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_empty_ivec4_array_frag.frag"
+ },
+ "name": "ivec4_empty_empty_ivec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_empty_ivec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_empty_ivec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_in_ivec4_empty_frag.frag"
+ },
+ "name": "ivec4_empty_in_ivec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_in_ivec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_in_ivec4_empty_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html
new file mode 100644
index 0000000000..9fc2a45079
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_081_to_088.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_081_to_088.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_in_ivec4_array_frag.frag"
+ },
+ "name": "ivec4_empty_in_ivec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_in_ivec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_in_ivec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_inout_ivec4_empty_frag.frag"
+ },
+ "name": "ivec4_empty_inout_ivec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_inout_ivec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_inout_ivec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_inout_ivec4_array_frag.frag"
+ },
+ "name": "ivec4_empty_inout_ivec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_inout_ivec4_bigarray_frag.frag"
+ },
+ "name": "ivec4_empty_inout_ivec4_bigarray_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_inout_ivec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_inout_ivec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_inout_ivec4_bigarray_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_inout_ivec4_bigarray_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html
new file mode 100644
index 0000000000..df95fcdace
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_089_to_096.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_089_to_096.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_out_ivec4_empty_frag.frag"
+ },
+ "name": "ivec4_empty_out_ivec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_out_ivec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_out_ivec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec4_empty_out_ivec4_array_frag.frag"
+ },
+ "name": "ivec4_empty_out_ivec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec4_empty_out_ivec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec4_empty_out_ivec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_empty_vec4_empty_frag.frag"
+ },
+ "name": "vec4_empty_empty_vec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_empty_vec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_empty_vec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_empty_vec4_array_frag.frag"
+ },
+ "name": "vec4_empty_empty_vec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_empty_vec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_empty_vec4_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html
new file mode 100644
index 0000000000..ecb3f995f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_097_to_104.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_097_to_104.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_in_vec4_empty_frag.frag"
+ },
+ "name": "vec4_empty_in_vec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_in_vec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_in_vec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_in_vec4_array_frag.frag"
+ },
+ "name": "vec4_empty_in_vec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_in_vec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_in_vec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_inout_vec4_empty_frag.frag"
+ },
+ "name": "vec4_empty_inout_vec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_inout_vec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_inout_vec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_inout_vec4_array_frag.frag"
+ },
+ "name": "vec4_empty_inout_vec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_inout_vec4_bigarray_frag.frag"
+ },
+ "name": "vec4_empty_inout_vec4_bigarray_frag.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html
new file mode 100644
index 0000000000..0c11edbe92
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_105_to_112.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_105_to_112.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_inout_vec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_inout_vec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_inout_vec4_bigarray_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_inout_vec4_bigarray_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_out_vec4_empty_frag.frag"
+ },
+ "name": "vec4_empty_out_vec4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_out_vec4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_out_vec4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_empty_out_vec4_array_frag.frag"
+ },
+ "name": "vec4_empty_out_vec4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_empty_out_vec4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_empty_out_vec4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_empty_mat4_empty_frag.frag"
+ },
+ "name": "mat4_empty_empty_mat4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_empty_mat4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_empty_mat4_empty_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html
new file mode 100644
index 0000000000..aab1f2991e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_113_to_120.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_113_to_120.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_empty_mat4_array_frag.frag"
+ },
+ "name": "mat4_empty_empty_mat4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_empty_mat4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_empty_mat4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_in_mat4_empty_frag.frag"
+ },
+ "name": "mat4_empty_in_mat4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_in_mat4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_in_mat4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_in_mat4_array_frag.frag"
+ },
+ "name": "mat4_empty_in_mat4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_in_mat4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_in_mat4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_inout_mat4_empty_frag.frag"
+ },
+ "name": "mat4_empty_inout_mat4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_inout_mat4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_inout_mat4_empty_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html
new file mode 100644
index 0000000000..31d06809d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/functions_121_to_126.html
@@ -0,0 +1,181 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: functions_121_to_126.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_inout_mat4_array_frag.frag"
+ },
+ "name": "mat4_empty_inout_mat4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_inout_mat4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_inout_mat4_array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_out_mat4_empty_frag.frag"
+ },
+ "name": "mat4_empty_out_mat4_empty_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_out_mat4_empty_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_out_mat4_empty_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_empty_out_mat4_array_frag.frag"
+ },
+ "name": "mat4_empty_out_mat4_array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_empty_out_mat4_array_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_empty_out_mat4_array_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt
new file mode 100644
index 0000000000..00b4fa8fa6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/input.run.txt
@@ -0,0 +1,17 @@
+# this file is auto-generated. DO NOT EDIT.
+functions_001_to_008.html
+functions_009_to_016.html
+functions_017_to_024.html
+functions_025_to_032.html
+functions_033_to_040.html
+functions_041_to_048.html
+functions_049_to_056.html
+functions_057_to_064.html
+functions_065_to_072.html
+functions_073_to_080.html
+functions_081_to_088.html
+functions_089_to_096.html
+functions_097_to_104.html
+functions_105_to_112.html
+functions_113_to_120.html
+functions_121_to_126.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag
new file mode 100644
index 0000000000..ed0cd8448a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+int function(int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+int function(int par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+ }
+ else
+ return 0;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert
new file mode 100644
index 0000000000..14c6e128ab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+int function(int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+int function(int par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+ }
+ else
+ return 0;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag
new file mode 100644
index 0000000000..65da05bbb0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+int function(int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if((par == 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+int function(int par)
+{
+ // Return the value of the parameter.
+ if(par == 1)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+ }
+ else
+ return 0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert
new file mode 100644
index 0000000000..7bda7a7e29
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_empty_int_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+int function(int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if((par == 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+int function(int par)
+{
+ // Return the value of the parameter.
+ if(par == 1)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+ }
+ else
+ return 0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag
new file mode 100644
index 0000000000..e57c9fa1d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+int function(in int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+int function(in int par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+ }
+ else
+ return 0;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert
new file mode 100644
index 0000000000..df6e4a1bb4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+int function(in int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+int function(in int par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+ }
+ else
+ return 0;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag
new file mode 100644
index 0000000000..f231711c7f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+int function(in int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if((par == 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+int function(in int par)
+{
+ // Return the value of the parameter.
+ if(par == 1)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+ }
+ else
+ return 0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert
new file mode 100644
index 0000000000..595313758e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_in_int_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+int function(in int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if((par == 1) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+int function(in int par)
+{
+ // Return the value of the parameter.
+ if(par == 1)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+ }
+ else
+ return 0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag
new file mode 100644
index 0000000000..f68223b0ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+int function(inout int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+int function(inout int par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+ }
+ else
+ return 0;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert
new file mode 100644
index 0000000000..d4bb19272a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_array_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+int function(inout int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+int function(inout int par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+ }
+ else
+ return 0;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag
new file mode 100644
index 0000000000..a9ff21b164
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+int function(inout int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if((par == 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+int function(inout int par)
+{
+ // Return the value of the parameter.
+ if(par == 1)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+ }
+ else
+ return 0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert
new file mode 100644
index 0000000000..81a43a3a84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_inout_int_empty_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+int function(inout int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if((par == 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+int function(inout int par)
+{
+ // Return the value of the parameter.
+ if(par == 1)
+ {
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+ }
+ else
+ return 0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag
new file mode 100644
index 0000000000..aa2c2c04b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_frag.frag
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+int function(out int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+int function(out int par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert
new file mode 100644
index 0000000000..ecbd64bcf2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_array_vert.vert
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+int function(out int par[3]);
+bool is_all(const in int array[3], const in int value);
+void set_all(out int array[3], const in int value);
+
+void main (void)
+{
+ int par[3];
+ int ret = 0;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, 1);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+int function(out int par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return 1;
+}
+
+bool is_all(const in int array[3], const in int value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out int array[3], const in int value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag
new file mode 100644
index 0000000000..55bc54d191
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_frag.frag
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+int function(out int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if((par == 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+int function(out int par)
+{
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert
new file mode 100644
index 0000000000..efe8841aba
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/int_empty_out_int_empty_vert.vert
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+int function(out int par);
+
+void main (void)
+{
+ int par = 1;
+ int ret = 0;
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if((par == 0) && (ret == 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+int function(out int par)
+{
+ // Test parameter qualifier (default is "in").
+ par = 0;
+
+ return 1;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag
new file mode 100644
index 0000000000..2f33f935e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+ivec4 function(ivec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert
new file mode 100644
index 0000000000..8b6b5703dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+ivec4 function(ivec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag
new file mode 100644
index 0000000000..f23078171e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+ivec4 function(ivec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert
new file mode 100644
index 0000000000..20e691c73a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_empty_ivec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+ivec4 function(ivec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag
new file mode 100644
index 0000000000..5fbcd07600
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(in ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+ivec4 function(in ivec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert
new file mode 100644
index 0000000000..ef859a4f61
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(in ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, ivec4(1, 1, 1, 1)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+ivec4 function(in ivec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag
new file mode 100644
index 0000000000..273424504f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(in ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+ivec4 function(in ivec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert
new file mode 100644
index 0000000000..29840bd98c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_in_ivec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(in ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.
+ if(is_all(par, 1) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+ivec4 function(in ivec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag
new file mode 100644
index 0000000000..120d99b4ef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(inout ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+ivec4 function(inout ivec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert
new file mode 100644
index 0000000000..27f136927c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(inout ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+ivec4 function(inout ivec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag
new file mode 100644
index 0000000000..091ca82e94
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_frag.frag
@@ -0,0 +1,112 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(inout ivec4 par[10]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[10], const in ivec4 value);
+void set_all(out ivec4 array[10], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[10];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+ivec4 function(inout ivec4 par[10])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[10], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+ if(array[3] != value)
+ ret = false;
+ if(array[4] != value)
+ ret = false;
+ if(array[5] != value)
+ ret = false;
+ if(array[6] != value)
+ ret = false;
+ if(array[7] != value)
+ ret = false;
+ if(array[8] != value)
+ ret = false;
+ if(array[9] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[10], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+ array[3] = value;
+ array[4] = value;
+ array[5] = value;
+ array[6] = value;
+ array[7] = value;
+ array[8] = value;
+ array[9] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert
new file mode 100644
index 0000000000..08e15a0451
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_bigarray_vert.vert
@@ -0,0 +1,112 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(inout ivec4 par[10]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[10], const in ivec4 value);
+void set_all(out ivec4 array[10], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[10];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+ivec4 function(inout ivec4 par[10])
+{
+ // Return the value of the array.
+ if(is_all(par, ivec4(1, 1, 1, 1)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[10], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+ if(array[3] != value)
+ ret = false;
+ if(array[4] != value)
+ ret = false;
+ if(array[5] != value)
+ ret = false;
+ if(array[6] != value)
+ ret = false;
+ if(array[7] != value)
+ ret = false;
+ if(array[8] != value)
+ ret = false;
+ if(array[9] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[10], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+ array[3] = value;
+ array[4] = value;
+ array[5] = value;
+ array[6] = value;
+ array[7] = value;
+ array[8] = value;
+ array[9] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag
new file mode 100644
index 0000000000..4714af5f98
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(inout ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+ivec4 function(inout ivec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert
new file mode 100644
index 0000000000..d51f33952b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_inout_ivec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(inout ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+ivec4 function(inout ivec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+ }
+ else
+ return ivec4(0, 0, 0, 0);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag
new file mode 100644
index 0000000000..cb968348b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_frag.frag
@@ -0,0 +1,85 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(out ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+ivec4 function(out ivec4 par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert
new file mode 100644
index 0000000000..398a683e27
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_array_vert.vert
@@ -0,0 +1,85 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+ivec4 function(out ivec4 par[3]);
+bool is_all(const in ivec4 par, const in int value);
+bool is_all(const in ivec4 array[3], const in ivec4 value);
+void set_all(out ivec4 array[3], const in ivec4 value);
+
+void main (void)
+{
+ ivec4 par[3];
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.
+ set_all(par, ivec4(1, 1, 1, 1));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, ivec4(0, 0, 0, 0)) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+ivec4 function(out ivec4 par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, ivec4(0, 0, 0, 0));
+
+ return ivec4(1, 1, 1, 1);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in ivec4 array[3], const in ivec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 array[3], const in ivec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag
new file mode 100644
index 0000000000..d74a722f6e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_frag.frag
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(out ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+ivec4 function(out ivec4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert
new file mode 100644
index 0000000000..34ff61d5d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/ivec4_empty_out_ivec4_empty_vert.vert
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+ivec4 function(out ivec4 par);
+bool is_all(const in ivec4 par, const in int value);
+void set_all(out ivec4 par, const in int value);
+
+void main (void)
+{
+ ivec4 par = ivec4(1, 1, 1, 1);
+ ivec4 ret = ivec4(0, 0, 0, 0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.
+ if(is_all(par, 0) && is_all(ret, 1))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+ivec4 function(out ivec4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0);
+
+ return ivec4(1, 1, 1, 1);
+}
+
+bool is_all(const in ivec4 par, const in int value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out ivec4 par, const in int value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag
new file mode 100644
index 0000000000..f2f0704cd4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_frag.frag
@@ -0,0 +1,124 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, mat_ones) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+mat4 function(mat4 par[2])
+{
+ // Return the value of the array.
+ if(is_all(par, mat_ones))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+ }
+ else
+ return mat_zeros;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert
new file mode 100644
index 0000000000..ff293ced8e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_array_vert.vert
@@ -0,0 +1,124 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, mat_ones) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+mat4 function(mat4 par[2])
+{
+ // Return the value of the array.
+ if(is_all(par, mat_ones))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+ }
+ else
+ return mat_zeros;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag
new file mode 100644
index 0000000000..4a075bad93
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_frag.frag
@@ -0,0 +1,128 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+mat4 function(mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+mat4 function(mat4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+ }
+ else
+ return 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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert
new file mode 100644
index 0000000000..bbbcf59ece
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_empty_mat4_empty_vert.vert
@@ -0,0 +1,128 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+mat4 function(mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+mat4 function(mat4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+ }
+ else
+ return 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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag
new file mode 100644
index 0000000000..c7eac72b97
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_frag.frag
@@ -0,0 +1,124 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(in mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, mat_ones) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+mat4 function(in mat4 par[2])
+{
+ // Return the value of the array.
+ if(is_all(par, mat_ones))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+ }
+ else
+ return mat_zeros;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert
new file mode 100644
index 0000000000..0b57cc9907
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_array_vert.vert
@@ -0,0 +1,124 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(in mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, mat_ones) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+mat4 function(in mat4 par[2])
+{
+ // Return the value of the array.
+ if(is_all(par, mat_ones))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+ }
+ else
+ return mat_zeros;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag
new file mode 100644
index 0000000000..87cb50e8a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_frag.frag
@@ -0,0 +1,128 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+mat4 function(in mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+mat4 function(in mat4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+ }
+ else
+ return 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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert
new file mode 100644
index 0000000000..b78e227891
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_in_mat4_empty_vert.vert
@@ -0,0 +1,128 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+mat4 function(in mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+mat4 function(in mat4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+ }
+ else
+ return 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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag
new file mode 100644
index 0000000000..1fd7215414
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_frag.frag
@@ -0,0 +1,124 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(inout mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, mat_zeros) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+mat4 function(inout mat4 par[2])
+{
+ // Return the value of the array.
+ if(is_all(par, mat_ones))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+ }
+ else
+ return mat_zeros;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert
new file mode 100644
index 0000000000..d2e6f02581
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_array_vert.vert
@@ -0,0 +1,124 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(inout mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, mat_zeros) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+mat4 function(inout mat4 par[2])
+{
+ // Return the value of the array.
+ if(is_all(par, mat_ones))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+ }
+ else
+ return mat_zeros;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag
new file mode 100644
index 0000000000..8aee0309fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_frag.frag
@@ -0,0 +1,128 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+mat4 function(inout mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+mat4 function(inout mat4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+ }
+ else
+ return 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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert
new file mode 100644
index 0000000000..210f5addb6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_inout_mat4_empty_vert.vert
@@ -0,0 +1,128 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+mat4 function(inout mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+mat4 function(inout mat4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+ }
+ else
+ return 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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag
new file mode 100644
index 0000000000..52ece666f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_frag.frag
@@ -0,0 +1,118 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(out mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, mat_zeros) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+mat4 function(out mat4 par[2])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert
new file mode 100644
index 0000000000..ee52d45730
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_array_vert.vert
@@ -0,0 +1,118 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const mat4 mat_ones = mat4(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 mat4 mat_zeros = 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);
+
+// Function declarations.
+mat4 function(out mat4 par[2]);
+bool is_all(const in mat4 par, const in float value);
+bool is_all(const in mat4 array[2], const in mat4 value);
+void set_all(out mat4 array[2], const in mat4 value);
+
+void main (void)
+{
+ mat4 par[2];
+ mat4 ret = mat_zeros;
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, mat_ones);
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, mat_zeros) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+mat4 function(out mat4 par[2])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, mat_zeros);
+
+ return mat_ones;
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in mat4 array[2], const in mat4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 array[2], const in mat4 value)
+{
+ array[0] = value;
+ array[1] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag
new file mode 100644
index 0000000000..f88bba050b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_frag.frag
@@ -0,0 +1,119 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+mat4 function(out mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+mat4 function(out mat4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert
new file mode 100644
index 0000000000..c593be2a56
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/mat4_empty_out_mat4_empty_vert.vert
@@ -0,0 +1,119 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+mat4 function(out mat4 par);
+bool is_all(const in mat4 par, const in float value);
+void set_all(out mat4 par, const in float value);
+
+void main (void)
+{
+ mat4 par = mat4(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);
+ mat4 ret = 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);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+mat4 function(out mat4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return mat4(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);
+}
+
+bool is_all(const in mat4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0][0] != value)
+ ret = false;
+ if(par[0][1] != value)
+ ret = false;
+ if(par[0][2] != value)
+ ret = false;
+ if(par[0][3] != value)
+ ret = false;
+
+ if(par[1][0] != value)
+ ret = false;
+ if(par[1][1] != value)
+ ret = false;
+ if(par[1][2] != value)
+ ret = false;
+ if(par[1][3] != value)
+ ret = false;
+
+ if(par[2][0] != value)
+ ret = false;
+ if(par[2][1] != value)
+ ret = false;
+ if(par[2][2] != value)
+ ret = false;
+ if(par[2][3] != value)
+ ret = false;
+
+ if(par[3][0] != value)
+ ret = false;
+ if(par[3][1] != value)
+ ret = false;
+ if(par[3][2] != value)
+ ret = false;
+ if(par[3][3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out mat4 par, const in float value)
+{
+ par[0][0] = value;
+ par[0][1] = value;
+ par[0][2] = value;
+ par[0][3] = value;
+
+ par[1][0] = value;
+ par[1][1] = value;
+ par[1][2] = value;
+ par[1][3] = value;
+
+ par[2][0] = value;
+ par[2][1] = value;
+ par[2][2] = value;
+ par[2][3] = value;
+
+ par[3][0] = value;
+ par[3][1] = value;
+ par[3][2] = value;
+ par[3][3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag
new file mode 100644
index 0000000000..880331e3af
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_frag.frag
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+
+
+float qualifiers(in float a, out float b, inout float c, const in float d, float e)
+{
+ b = a;
+ c += d;
+ a += 1.0;
+ return e;
+}
+
+
+
+void main (void)
+{
+ float a = 1.0, b = 2.0, c = 3.0, d = 4.0, e = 1.0, f = 0.0;
+ float q = 0.0;
+ float q2 = 0.0;
+
+ f = qualifiers(a, b, c, d, e);
+
+ if(a == 1.0) q += 1.0;
+ if(b == 1.0) q += 2.0;
+ if(c == 7.0) q += 4.0;
+ if(d == 4.0) q2 += 1.0;
+ if(e == 1.0) q2 += 2.0;
+ if(f == 1.0) q2 += 4.0;
+
+ gl_FragColor = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert
new file mode 100644
index 0000000000..5142df2f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_float_vert.vert
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+float qualifiers(in float a, out float b, inout float c, const in float d, float e)
+{
+ b = a;
+ c += d;
+ a += 1.0;
+ return e;
+}
+
+
+
+void main (void)
+{
+ float a = 1.0, b = 2.0, c = 3.0, d = 4.0, e = 1.0, f = 0.0;
+ float q = 0.0;
+ float q2 = 0.0;
+
+ f = qualifiers(a, b, c, d, e);
+
+ if(a == 1.0) q += 1.0;
+ if(b == 1.0) q += 2.0;
+ if(c == 7.0) q += 4.0;
+ if(d == 4.0) q2 += 1.0;
+ if(e == 1.0) q2 += 2.0;
+ if(f == 1.0) q2 += 4.0;
+
+ color = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag
new file mode 100644
index 0000000000..6d1a7e75c0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+
+
+
+sabcd qualifiers(in sabcd a, out sabcd b, inout sabcd c, const in sabcd d,
+sabcd e)
+{
+ sabcd one = sabcd(1.0, 1.0, 1.0, 1.0);
+
+ b = a;
+
+ c.a += d.a;
+ c.b += d.b;
+ c.c += d.c;
+ c.d += d.d;
+
+ a.a += one.a;
+ a.b += one.b;
+ a.c += one.c;
+ a.d += one.d;
+
+ return e;
+}
+
+void main (void)
+{
+ sabcd a = sabcd(1.0, 1.0, 1.0, 1.0);
+ sabcd b = sabcd(2.0, 2.0, 2.0, 2.0);
+ sabcd c = sabcd(3.0, 3.0, 3.0, 3.0);
+ sabcd d = sabcd(4.0, 4.0, 4.0, 4.0);
+ sabcd e = sabcd(1.0, 1.0, 1.0, 1.0);
+ sabcd f = sabcd(0.0, 0.0, 0.0, 0.0);
+ sabcd one = sabcd(1.0, 1.0, 1.0, 1.0);
+ sabcd four = sabcd(4.0, 4.0, 4.0, 4.0);
+ sabcd seven = sabcd(7.0, 7.0, 7.0, 7.0);
+ float q = 0.0;
+ float q2 = 0.0;
+
+ f = qualifiers(a, b, c, d, e);
+
+ if(a == one) q += 1.0;
+ if(b == one) q += 2.0;
+ if(c == seven) q += 4.0;
+ if(d == four) q2 += 1.0;
+ if(e == one) q2 += 2.0;
+ if(f == one) q2 += 4.0;
+
+ gl_FragColor = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert
new file mode 100644
index 0000000000..201f3f5eff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/qualifiers_struct_vert.vert
@@ -0,0 +1,70 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+
+
+
+sabcd qualifiers(in sabcd a, out sabcd b, inout sabcd c, const in sabcd d,
+sabcd e)
+{
+ sabcd one = sabcd(1.0, 1.0, 1.0, 1.0);
+
+ b = a;
+
+ c.a += d.a;
+ c.b += d.b;
+ c.c += d.c;
+ c.d += d.d;
+
+ a.a += one.a;
+ a.b += one.b;
+ a.c += one.c;
+ a.d += one.d;
+
+ return e;
+}
+
+void main (void)
+{
+ sabcd a = sabcd(1.0, 1.0, 1.0, 1.0);
+ sabcd b = sabcd(2.0, 2.0, 2.0, 2.0);
+ sabcd c = sabcd(3.0, 3.0, 3.0, 3.0);
+ sabcd d = sabcd(4.0, 4.0, 4.0, 4.0);
+ sabcd e = sabcd(1.0, 1.0, 1.0, 1.0);
+ sabcd f = sabcd(0.0, 0.0, 0.0, 0.0);
+ sabcd one = sabcd(1.0, 1.0, 1.0, 1.0);
+ sabcd four = sabcd(4.0, 4.0, 4.0, 4.0);
+ sabcd seven = sabcd(7.0, 7.0, 7.0, 7.0);
+ float q = 0.0;
+ float q2 = 0.0;
+
+ f = qualifiers(a, b, c, d, e);
+
+ if(a == one) q += 1.0;
+ if(b == one) q += 2.0;
+ if(c == seven) q += 4.0;
+ if(d == four) q2 += 1.0;
+ if(e == one) q2 += 2.0;
+ if(f == one) q2 += 4.0;
+
+ color = vec4(vec2(q / 7.0, q2 / 7.0), 1.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag
new file mode 100644
index 0000000000..26ffd695ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+vec4 function(vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+vec4 function(vec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert
new file mode 100644
index 0000000000..3c83eade81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+vec4 function(vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+vec4 function(vec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag
new file mode 100644
index 0000000000..ca027ab8de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+vec4 function(vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+vec4 function(vec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert
new file mode 100644
index 0000000000..2f714a5728
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_empty_vec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+vec4 function(vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+vec4 function(vec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag
new file mode 100644
index 0000000000..23258c69b3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+vec4 function(in vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+vec4 function(in vec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert
new file mode 100644
index 0000000000..3618544577
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+vec4 function(in vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+vec4 function(in vec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag
new file mode 100644
index 0000000000..6e94bd9ed5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+vec4 function(in vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+vec4 function(in vec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert
new file mode 100644
index 0000000000..58bed576b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_in_vec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+vec4 function(in vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should remain unchanged by the function and the function should return 1.0.
+ if(is_all(par, 1.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+vec4 function(in vec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag
new file mode 100644
index 0000000000..1569b5639e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_frag.frag
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+vec4 function(inout vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+vec4 function(inout vec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert
new file mode 100644
index 0000000000..dc547134dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_array_vert.vert
@@ -0,0 +1,91 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+vec4 function(inout vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+vec4 function(inout vec4 par[3])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag
new file mode 100644
index 0000000000..1b1a81cc09
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_frag.frag
@@ -0,0 +1,112 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+vec4 function(inout vec4 par[10]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[10], const in vec4 value);
+void set_all(out vec4 array[10], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[10];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+vec4 function(inout vec4 par[10])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[10], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+ if(array[3] != value)
+ ret = false;
+ if(array[4] != value)
+ ret = false;
+ if(array[5] != value)
+ ret = false;
+ if(array[6] != value)
+ ret = false;
+ if(array[7] != value)
+ ret = false;
+ if(array[8] != value)
+ ret = false;
+ if(array[9] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[10], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+ array[3] = value;
+ array[4] = value;
+ array[5] = value;
+ array[6] = value;
+ array[7] = value;
+ array[8] = value;
+ array[9] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert
new file mode 100644
index 0000000000..e7e57e376b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_bigarray_vert.vert
@@ -0,0 +1,112 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+vec4 function(inout vec4 par[10]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[10], const in vec4 value);
+void set_all(out vec4 array[10], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[10];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+vec4 function(inout vec4 par[10])
+{
+ // Return the value of the array.
+ if(is_all(par, vec4(1.0, 1.0, 1.0, 1.0)))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[10], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+ if(array[3] != value)
+ ret = false;
+ if(array[4] != value)
+ ret = false;
+ if(array[5] != value)
+ ret = false;
+ if(array[6] != value)
+ ret = false;
+ if(array[7] != value)
+ ret = false;
+ if(array[8] != value)
+ ret = false;
+ if(array[9] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[10], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+ array[3] = value;
+ array[4] = value;
+ array[5] = value;
+ array[6] = value;
+ array[7] = value;
+ array[8] = value;
+ array[9] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag
new file mode 100644
index 0000000000..1d144cac57
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_frag.frag
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+vec4 function(inout vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+vec4 function(inout vec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert
new file mode 100644
index 0000000000..e4e75320f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_inout_vec4_empty_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+vec4 function(inout vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+vec4 function(inout vec4 par)
+{
+ // Return the value of the parameter.
+ if(is_all(par, 1.0))
+ {
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ else
+ return vec4(0.0, 0.0, 0.0, 0.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag
new file mode 100644
index 0000000000..4968a7eb24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_frag.frag
@@ -0,0 +1,85 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declarations.
+vec4 function(out vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definitions.
+vec4 function(out vec4 par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert
new file mode 100644
index 0000000000..125a40f979
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_array_vert.vert
@@ -0,0 +1,85 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declarations.
+vec4 function(out vec4 par[3]);
+bool is_all(const in vec4 par, const in float value);
+bool is_all(const in vec4 array[3], const in vec4 value);
+void set_all(out vec4 array[3], const in vec4 value);
+
+void main (void)
+{
+ vec4 par[3];
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ // Initialize the entire array to 1.0.
+ set_all(par, vec4(1.0, 1.0, 1.0, 1.0));
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, vec4(0.0, 0.0, 0.0, 0.0)) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definitions.
+vec4 function(out vec4 par[3])
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, vec4(0.0, 0.0, 0.0, 0.0));
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+bool is_all(const in vec4 array[3], const in vec4 value)
+{
+ bool ret = true;
+
+ if(array[0] != value)
+ ret = false;
+ if(array[1] != value)
+ ret = false;
+ if(array[2] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 array[3], const in vec4 value)
+{
+ array[0] = value;
+ array[1] = value;
+ array[2] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag
new file mode 100644
index 0000000000..ee357ab5a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_frag.frag
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+// Function declaration.
+vec4 function(out vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+vec4 function(out vec4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert
new file mode 100644
index 0000000000..c26956cf07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/vec4_empty_out_vec4_empty_vert.vert
@@ -0,0 +1,68 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+// Function declaration.
+vec4 function(out vec4 par);
+bool is_all(const in vec4 par, const in float value);
+void set_all(out vec4 par, const in float value);
+
+void main (void)
+{
+ vec4 par = vec4(1.0, 1.0, 1.0, 1.0);
+ vec4 ret = vec4(0.0, 0.0, 0.0, 0.0);
+
+ float gray = 0.0;
+
+ ret = function(par);
+
+ // The parameter should be changed by the function and the function should return 1.0.
+ if(is_all(par, 0.0) && is_all(ret, 1.0))
+ {
+ gray = 1.0;
+ }
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+vec4 function(out vec4 par)
+{
+ // Test parameter qualifier (default is "in").
+ set_all(par, 0.0);
+
+ return vec4(1.0, 1.0, 1.0, 1.0);
+}
+
+bool is_all(const in vec4 par, const in float value)
+{
+ bool ret = true;
+
+ if(par[0] != value)
+ ret = false;
+ if(par[1] != value)
+ ret = false;
+ if(par[2] != value)
+ ret = false;
+ if(par[3] != value)
+ ret = false;
+
+ return ret;
+}
+
+void set_all(out vec4 par, const in float value)
+{
+ par[0] = value;
+ par[1] = value;
+ par[2] = value;
+ par[3] = value;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag
new file mode 100644
index 0000000000..cb277863d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_frag.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float gray = 0.0;
+
+// Function declaration.
+void function(void);
+
+void main (void)
+{
+ gray = 0.0;
+
+ function();
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
+// Function definition.
+void function(void)
+{
+ gray = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert
new file mode 100644
index 0000000000..8f5130c26e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/functions/void_empty_empty_void_empty_vert.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+float gray = 0.0;
+
+// Function declaration.
+void function(void);
+
+void main (void)
+{
+ gray = 0.0;
+
+ function();
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+// Function definition.
+void function(void)
+{
+ gray = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html
new file mode 100644
index 0000000000..2118dfa105
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_001_to_003.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: gl_FragCoord_001_to_003.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_FragCoord_xy_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_FragCoord_xy_frag.frag"
+ },
+ "name": "gl_FragCoord_xy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "gl_FragCoord_z_frag_ref.vert",
+ "fragmentShader": "gl_FragCoord_z_frag_ref.frag",
+ "builtin_uniforms": {
+ "min_required": 2,
+ "valid_values": [
+ "gl_DepthRange.near",
+ "gl_DepthRange.far",
+ "gl_DepthRange.diff"
+ ],
+ }
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_FragCoord_z_frag.frag"
+ },
+ "name": "gl_FragCoord_z_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.5,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_FragCoord_w_frag.frag"
+ },
+ "name": "gl_FragCoord_w_frag.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag
new file mode 100644
index 0000000000..ee8be18726
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_w_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main(void)
+{
+ gl_FragColor = vec4(vec3(gl_FragCoord.w), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag
new file mode 100644
index 0000000000..772661fc5f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float viewportwidth;
+uniform float viewportheight;
+
+void main(void)
+{
+ // The image width is 500 so scale the position to 0...1 for color
+ gl_FragColor = vec4(gl_FragCoord.x /viewportwidth , gl_FragCoord.y/viewportheight, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag
new file mode 100644
index 0000000000..deea9c581b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_xy_frag_ref.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main(void)
+{
+ // The image width is 500x500 and the rectangle is 434x434
+ // The green component corresponds to x (0...1 left to right) and the
+ // blue component corresponds to y (0...1 bottom to top)
+ gl_FragColor = vec4((434.0 / 500.0) * (color.gb - 0.5) + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag
new file mode 100644
index 0000000000..e81a81d803
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag.frag
@@ -0,0 +1,15 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main(void)
+{
+ gl_FragColor = vec4(vec3(gl_FragCoord.z), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag
new file mode 100644
index 0000000000..d66db17deb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 position;
+
+void main(void)
+{
+ // Normalized device coordinates
+ float z = position.z / position.w;
+ float f = gl_DepthRange.far;
+ float n = gl_DepthRange.near;
+
+ // Window coordinates
+ z = ((f - n) / 2.0) * z + (f + n) / 2.0;
+
+ gl_FragColor = vec4(vec3(z), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert
new file mode 100644
index 0000000000..3c11ffb73d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/gl_FragCoord_z_frag_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 position;
+
+void main(void)
+{
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+ // Vertex's clip coordinates
+ position = gl_Position;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt
new file mode 100644
index 0000000000..588cde7bff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FragCoord/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+gl_FragCoord_001_to_003.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html
new file mode 100644
index 0000000000..dc1fe1ac87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_001_to_001.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: gl_FrontFacing_001_to_001.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "frontbacksquare",
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "gl_FrontFacing_frag.frag"
+ },
+ "name": "gl_FrontFacing_frag.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag
new file mode 100644
index 0000000000..f4143574bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/gl_FrontFacing_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+void main(void)
+{
+ if(gl_FrontFacing)
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+ else
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt
new file mode 100644
index 0000000000..6244419195
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/gl_FrontFacing/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+gl_FrontFacing_001_to_001.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html
new file mode 100644
index 0000000000..2c9740ad06
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: greaterThan_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_vec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_vec2_frag.frag"
+ },
+ "name": "greaterThan_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThan_vec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThan_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThan_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_vec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_vec3_frag.frag"
+ },
+ "name": "greaterThan_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThan_vec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThan_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThan_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_ivec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_ivec2_frag.frag"
+ },
+ "name": "greaterThan_ivec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThan_ivec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThan_ivec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThan_ivec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_ivec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThan_ivec3_frag.frag"
+ },
+ "name": "greaterThan_ivec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThan_ivec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThan_ivec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThan_ivec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag
new file mode 100644
index 0000000000..9fb6954e74
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThan(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag
new file mode 100644
index 0000000000..5a24063df2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec2 gt(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gt(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert
new file mode 100644
index 0000000000..68bfd31ec0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThan(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert
new file mode 100644
index 0000000000..3dac9d7dcc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 gt(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gt(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag
new file mode 100644
index 0000000000..4d077b328b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThan(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag
new file mode 100644
index 0000000000..36775a9bc4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 gt(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] > b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gt(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert
new file mode 100644
index 0000000000..6f722d6557
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThan(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert
new file mode 100644
index 0000000000..3363f2aaef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_ivec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 gt(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] > b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gt(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag
new file mode 100644
index 0000000000..73dbc4a72b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThan(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag
new file mode 100644
index 0000000000..9c73b1ac5e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 gt(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gt(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert
new file mode 100644
index 0000000000..686e78e6fe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThan(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert
new file mode 100644
index 0000000000..ab886147e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 gt(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gt(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag
new file mode 100644
index 0000000000..9e48f7e345
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThan(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag
new file mode 100644
index 0000000000..140d288498
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 gt(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] > b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gt(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert
new file mode 100644
index 0000000000..dcdec7463f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThan(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert
new file mode 100644
index 0000000000..c52adae9b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/greaterThan_vec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 gt(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] > b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] > b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] > b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gt(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt
new file mode 100644
index 0000000000..9d2acae74d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThan/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+greaterThan_001_to_008.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html
new file mode 100644
index 0000000000..950ea6db78
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: greaterThanEqual_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_vec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_vec2_frag.frag"
+ },
+ "name": "greaterThanEqual_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThanEqual_vec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThanEqual_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThanEqual_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_vec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_vec3_frag.frag"
+ },
+ "name": "greaterThanEqual_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThanEqual_vec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThanEqual_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThanEqual_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_ivec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_ivec2_frag.frag"
+ },
+ "name": "greaterThanEqual_ivec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThanEqual_ivec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThanEqual_ivec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThanEqual_ivec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_ivec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "greaterThanEqual_ivec3_frag.frag"
+ },
+ "name": "greaterThanEqual_ivec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "greaterThanEqual_ivec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "greaterThanEqual_ivec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "greaterThanEqual_ivec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag
new file mode 100644
index 0000000000..946f60b19f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThanEqual(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag
new file mode 100644
index 0000000000..2ca0347a77
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec2 gte(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gte(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert
new file mode 100644
index 0000000000..6dbe5ea25d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThanEqual(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert
new file mode 100644
index 0000000000..3f2f41a6e9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 gte(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gte(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag
new file mode 100644
index 0000000000..f240a680e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThanEqual(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag
new file mode 100644
index 0000000000..346676cea4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 gte(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] >= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gte(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert
new file mode 100644
index 0000000000..96b12a1f66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThanEqual(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert
new file mode 100644
index 0000000000..8a595186f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_ivec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 gte(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] >= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gte(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag
new file mode 100644
index 0000000000..037e4ae5cc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThanEqual(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag
new file mode 100644
index 0000000000..4987b571eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 gte(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gte(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert
new file mode 100644
index 0000000000..0112876421
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(greaterThanEqual(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert
new file mode 100644
index 0000000000..bc2c4b74f6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 gte(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(gte(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag
new file mode 100644
index 0000000000..fa0b97c87d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThanEqual(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag
new file mode 100644
index 0000000000..c81f489341
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 gte(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] >= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gte(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert
new file mode 100644
index 0000000000..1cf6bf0373
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(greaterThanEqual(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert
new file mode 100644
index 0000000000..0907e38fc5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/greaterThanEqual_vec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 gte(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] >= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] >= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] >= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(gte(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt
new file mode 100644
index 0000000000..4562883013
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/greaterThanEqual/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+greaterThanEqual_001_to_008.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt
new file mode 100644
index 0000000000..6eb579d476
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+inversesqrt_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html
new file mode 100644
index 0000000000..f5dd42094f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: inversesqrt_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "inversesqrt_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "inversesqrt_float_frag_xvary.frag"
+ },
+ "name": "inversesqrt_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "inversesqrt_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "inversesqrt_vec2_frag_xvary.frag"
+ },
+ "name": "inversesqrt_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "inversesqrt_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "inversesqrt_vec3_frag_xvary.frag"
+ },
+ "name": "inversesqrt_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "inversesqrt_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "inversesqrt_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "inversesqrt_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "inversesqrt_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "inversesqrt_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "inversesqrt_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "inversesqrt_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "inversesqrt_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "inversesqrt_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag
new file mode 100644
index 0000000000..64c0b286c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = (color.r * 99.0) + 1.0;
+ gl_FragColor = vec4(inversesqrt(c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..d4fffeaf95
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = (color.r * 99.0) + 1.0;
+ gl_FragColor = vec4(1.0 / sqrt(c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert
new file mode 100644
index 0000000000..762b8395e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = (gtf_Color.r * 99.0) + 1.0;
+ color = vec4(inversesqrt(c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..d38c5c9481
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_float_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = (gtf_Color.r * 99.0) + 1.0;
+ color = vec4(1.0 / sqrt(c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..1d4f981d44
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (color.rg * 99.0) + 1.0;
+ gl_FragColor = vec4(inversesqrt(c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..0204ede208
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (color.rg * 99.0) + 1.0;
+ gl_FragColor = vec4(1.0 / sqrt(c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..528df8a99a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (gtf_Color.rg * 99.0) + 1.0;
+ color = vec4(inversesqrt(c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..45aee3f073
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec2_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (gtf_Color.rg * 99.0) + 1.0;
+ color = vec4(1.0 / sqrt(c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..1a48139095
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (color.rgb * 99.0) + 1.0;
+ gl_FragColor = vec4(inversesqrt(c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..9b0e603912
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (color.rgb * 99.0) + 1.0;
+ gl_FragColor = vec4(1.0 / sqrt(c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..4aee12d5e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (gtf_Color.rgb * 99.0) + 1.0;
+ color = vec4(inversesqrt(c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..7929585b70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/inversesqrt/inversesqrt_vec3_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (gtf_Color.rgb * 99.0) + 1.0;
+ color = vec4(1.0 / sqrt(c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt
new file mode 100644
index 0000000000..9a3147ec3c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+length_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html
new file mode 100644
index 0000000000..cdcc97b5b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: length_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "length_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "length_float_frag_xvary.frag"
+ },
+ "name": "length_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "length_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "length_vec2_frag_xvary.frag"
+ },
+ "name": "length_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "length_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "length_vec3_frag_xvary.frag"
+ },
+ "name": "length_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "length_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "length_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "length_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "length_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "length_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "length_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "length_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "length_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "length_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag
new file mode 100644
index 0000000000..6b69eceeeb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(length(color.r)), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..9e5672b1d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_frag_xvary_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(color.r), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert
new file mode 100644
index 0000000000..984e83943b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(length(gtf_Color.r)), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..940b53e278
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_float_vert_xvary_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(gtf_Color.r), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..bbba3bfa75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(length(color.rg) / 2.0), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..18a2913050
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_frag_xvary_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(sqrt(color.r*color.r + color.g*color.g) / 2.0), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..3d422ce046
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(length(gtf_Color.rg) / 2.0), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..9540f93c8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec2_vert_xvary_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(sqrt(gtf_Color.r*gtf_Color.r + gtf_Color.g*gtf_Color.g) / 2.0), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..00ae4460b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(length(color.rgb) / 3.0), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..4c092c505d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_frag_xvary_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(vec3(sqrt(color.r*color.r + color.g*color.g + color.b*color.b) / 3.0), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..469e2ebda9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(length(gtf_Color.rgb) / 3.0), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..a29e150036
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/length/length_vec3_vert_xvary_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vec3(sqrt(gtf_Color.r*gtf_Color.r + gtf_Color.g*gtf_Color.g + gtf_Color.b*gtf_Color.b) / 3.0), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt
new file mode 100644
index 0000000000..f49c916d97
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+lessThan_001_to_008.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html
new file mode 100644
index 0000000000..963a3a229a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: lessThan_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_vec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_vec2_frag.frag"
+ },
+ "name": "lessThan_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThan_vec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThan_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThan_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_vec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_vec3_frag.frag"
+ },
+ "name": "lessThan_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThan_vec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThan_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThan_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_ivec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_ivec2_frag.frag"
+ },
+ "name": "lessThan_ivec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThan_ivec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThan_ivec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThan_ivec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_ivec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThan_ivec3_frag.frag"
+ },
+ "name": "lessThan_ivec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThan_ivec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThan_ivec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThan_ivec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag
new file mode 100644
index 0000000000..efb9f70969
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThan(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag
new file mode 100644
index 0000000000..5a5f597262
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec2 lt(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lt(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert
new file mode 100644
index 0000000000..0b4b12f187
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThan(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert
new file mode 100644
index 0000000000..9ec55e8551
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 lt(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lt(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag
new file mode 100644
index 0000000000..39fa872d14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThan(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag
new file mode 100644
index 0000000000..3cbf48f982
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 lt(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] < b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lt(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert
new file mode 100644
index 0000000000..8d64ec8bb6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThan(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert
new file mode 100644
index 0000000000..68719abf80
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_ivec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 lt(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] < b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lt(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag
new file mode 100644
index 0000000000..2cdfccb869
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThan(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag
new file mode 100644
index 0000000000..1b841e4b15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 lt(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lt(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert
new file mode 100644
index 0000000000..b341e510e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThan(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert
new file mode 100644
index 0000000000..10206861a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 lt(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lt(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag
new file mode 100644
index 0000000000..ca0bfea25c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThan(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag
new file mode 100644
index 0000000000..4b97bd6eb3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 lt(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] < b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lt(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert
new file mode 100644
index 0000000000..d4f15c1b43
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThan(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert
new file mode 100644
index 0000000000..a6e703d6f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThan/lessThan_vec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 lt(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] < b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] < b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] < b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lt(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt
new file mode 100644
index 0000000000..656332ccca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+lessThanEqual_001_to_008.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html
new file mode 100644
index 0000000000..35adf22fbf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: lessThanEqual_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_vec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_vec2_frag.frag"
+ },
+ "name": "lessThanEqual_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThanEqual_vec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThanEqual_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThanEqual_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_vec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_vec3_frag.frag"
+ },
+ "name": "lessThanEqual_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThanEqual_vec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThanEqual_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThanEqual_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_ivec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_ivec2_frag.frag"
+ },
+ "name": "lessThanEqual_ivec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThanEqual_ivec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThanEqual_ivec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThanEqual_ivec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_ivec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "lessThanEqual_ivec3_frag.frag"
+ },
+ "name": "lessThanEqual_ivec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "lessThanEqual_ivec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "lessThanEqual_ivec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "lessThanEqual_ivec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag
new file mode 100644
index 0000000000..4747c3a849
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThanEqual(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag
new file mode 100644
index 0000000000..b8be19b56b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec2 lte(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lte(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert
new file mode 100644
index 0000000000..d276f0c8de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThanEqual(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert
new file mode 100644
index 0000000000..8a8890f5d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 lte(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lte(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag
new file mode 100644
index 0000000000..d4dc9a1209
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThanEqual(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag
new file mode 100644
index 0000000000..b3295149c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 lte(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] <= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lte(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert
new file mode 100644
index 0000000000..7d7c0c91fe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThanEqual(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert
new file mode 100644
index 0000000000..895f0679a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_ivec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 lte(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] <= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lte(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag
new file mode 100644
index 0000000000..319360bdad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThanEqual(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag
new file mode 100644
index 0000000000..82e2190ac9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 lte(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lte(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert
new file mode 100644
index 0000000000..86809ef8d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lessThanEqual(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert
new file mode 100644
index 0000000000..a99efb0185
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 lte(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(lte(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag
new file mode 100644
index 0000000000..060af8d974
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThanEqual(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag
new file mode 100644
index 0000000000..b07c24e908
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 lte(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] <= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lte(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert
new file mode 100644
index 0000000000..e5e479657e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lessThanEqual(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert
new file mode 100644
index 0000000000..61b87b7885
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/lessThanEqual/lessThanEqual_vec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 lte(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] <= b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] <= b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] <= b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(lte(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt
new file mode 100644
index 0000000000..beb1561c1b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+log_001_to_008.html
+log_009_to_012.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html
new file mode 100644
index 0000000000..a3afd6a33c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: log_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_float_frag_xvary.frag"
+ },
+ "name": "log_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_float_frag_xvary01_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_float_frag_xvary01.frag"
+ },
+ "name": "log_float_frag_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec2_frag_xvary.frag"
+ },
+ "name": "log_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec2_frag_xvary01_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec2_frag_xvary01.frag"
+ },
+ "name": "log_vec2_frag_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec3_frag_xvary.frag"
+ },
+ "name": "log_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec3_frag_xvary01_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log_vec3_frag_xvary01.frag"
+ },
+ "name": "log_vec3_frag_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log_float_vert_xvary01_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log_float_vert_xvary01.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log_float_vert_xvary01.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html
new file mode 100644
index 0000000000..f4d4c0268e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_009_to_012.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: log_009_to_012.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "log_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log_vec2_vert_xvary01_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log_vec2_vert_xvary01.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log_vec2_vert_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log_vec3_vert_xvary01_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log_vec3_vert_xvary01.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log_vec3_vert_xvary01.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag
new file mode 100644
index 0000000000..c0e84b2d36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 31.0 * color.r + 1.0;
+ gl_FragColor = vec4(log(c) / 3.466, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag
new file mode 100644
index 0000000000..ca08d35579
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = (color.r + 0.01) / 1.01;
+ gl_FragColor = vec4(log(c) / -4.61, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag
new file mode 100644
index 0000000000..cd6b25a410
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary01_ref.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float x = (color.r + 0.01) / 1.01;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0;
+
+ gl_FragColor = vec4(y / -4.61, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..a85b33cba3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_frag_xvary_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float x = 31.0 * color.r + 1.0;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0;
+
+ gl_FragColor = vec4(y / 3.466, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert
new file mode 100644
index 0000000000..2e85fb99b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 31.0 * gtf_Color.r + 1.0;
+ color = vec4(log(c) / 3.466, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert
new file mode 100644
index 0000000000..e365003cf1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = (gtf_Color.r + 0.01) / 1.01;
+ color = vec4(log(c) / -4.61, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert
new file mode 100644
index 0000000000..059566e7ee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary01_ref.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float x = (gtf_Color.r + 0.01) / 1.01;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0;
+
+ color = vec4(y / -4.61, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..afbfb3ebf9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_float_vert_xvary_ref.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float x = 31.0 * gtf_Color.r + 1.0;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0;
+
+ color = vec4(y / 3.466, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..5dadc29457
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 31.0 * color.rg + 1.0;
+ gl_FragColor = vec4(log(c) / 3.466, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag
new file mode 100644
index 0000000000..0d47567874
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (color.rg + 0.01) / 1.01;
+ gl_FragColor = vec4(log(c) / -4.61, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag
new file mode 100644
index 0000000000..4f3cc1c805
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary01_ref.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 x = (color.rg + 0.01) / 1.01;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0;
+
+ gl_FragColor = vec4(y / -4.61, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..0095d68920
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_frag_xvary_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 x = 31.0 * color.rg + 1.0;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0;
+
+ gl_FragColor = vec4(y / 3.466, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..f5fe9e8e1f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 31.0 * gtf_Color.rg + 1.0;
+ color = vec4(log(c) / 3.466, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert
new file mode 100644
index 0000000000..1f39279f1f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (gtf_Color.rg + 0.01) / 1.01;
+ color = vec4(log(c) / -4.61, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert
new file mode 100644
index 0000000000..41197b1783
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary01_ref.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 x = (gtf_Color.rg + 0.01) / 1.01;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0;
+
+ color = vec4(y / -4.61, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..b86606a71c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec2_vert_xvary_ref.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 x = 31.0 * gtf_Color.rg + 1.0;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0;
+
+ color = vec4(y / 3.466, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..7424e3a6c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 31.0 * color.rgb + 1.0;
+ gl_FragColor = vec4(log(c) / 3.466, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag
new file mode 100644
index 0000000000..7e9de5561e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (color.rgb + 0.01) / 1.01;
+ gl_FragColor = vec4(log(c) / -4.61, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag
new file mode 100644
index 0000000000..d27f807db6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary01_ref.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 x = (color.rgb + 0.01) / 1.01;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0;
+
+ gl_FragColor = vec4(y / -4.61, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..a5d21f6f35
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_frag_xvary_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 x = 31.0 * color.rgb + 1.0;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0;
+
+ gl_FragColor = vec4(y / 3.466, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..6e3b77b53e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 31.0 * gtf_Color.rgb + 1.0;
+ color = vec4(log(c) / 3.466, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert
new file mode 100644
index 0000000000..d1e06dc358
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (gtf_Color.rgb + 0.01) / 1.01;
+ color = vec4(log(c) / -4.61, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert
new file mode 100644
index 0000000000..d5c67acde3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary01_ref.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 x = (gtf_Color.rgb + 0.01) / 1.01;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0;
+
+ color = vec4(y / -4.61, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..204c6dab9a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log/log_vec3_vert_xvary_ref.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 x = 31.0 * gtf_Color.rgb + 1.0;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0;
+
+ color = vec4(y / 3.466, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt
new file mode 100644
index 0000000000..4205bf17ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+log2_001_to_008.html
+log2_009_to_012.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html
new file mode 100644
index 0000000000..53dc3e0f8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: log2_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_float_frag_xvary.frag"
+ },
+ "name": "log2_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_float_frag_xvary01_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_float_frag_xvary01.frag"
+ },
+ "name": "log2_float_frag_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec2_frag_xvary.frag"
+ },
+ "name": "log2_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec2_frag_xvary01_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec2_frag_xvary01.frag"
+ },
+ "name": "log2_vec2_frag_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec3_frag_xvary.frag"
+ },
+ "name": "log2_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec3_frag_xvary01_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "log2_vec3_frag_xvary01.frag"
+ },
+ "name": "log2_vec3_frag_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log2_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log2_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log2_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log2_float_vert_xvary01_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log2_float_vert_xvary01.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log2_float_vert_xvary01.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html
new file mode 100644
index 0000000000..a7644b3792
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_009_to_012.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: log2_009_to_012.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "log2_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log2_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log2_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log2_vec2_vert_xvary01_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log2_vec2_vert_xvary01.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log2_vec2_vert_xvary01.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log2_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log2_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log2_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "log2_vec3_vert_xvary01_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "log2_vec3_vert_xvary01.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "log2_vec3_vert_xvary01.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag
new file mode 100644
index 0000000000..ad8169e98b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 31.0 * color.r + 1.0;
+ gl_FragColor = vec4(log2(c) / 5.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag
new file mode 100644
index 0000000000..ccbdc87177
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = (color.r + 0.01) / 1.01;
+ gl_FragColor = vec4(log2(c) / -8.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag
new file mode 100644
index 0000000000..ff9edaee40
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary01_ref.frag
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ float x = (color.r + 0.01) / 1.01;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0 / ln2;
+
+ gl_FragColor = vec4(y / -8.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..778cdcd14a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_frag_xvary_ref.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ float x = 31.0 * color.r + 1.0;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0 / ln2;
+
+ gl_FragColor = vec4(y / 5.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert
new file mode 100644
index 0000000000..4015613d2f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 31.0 * gtf_Color.r + 1.0;
+ color = vec4(log2(c) / 5.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert
new file mode 100644
index 0000000000..1cf60f89c7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = (gtf_Color.r + 0.01) / 1.01;
+ color = vec4(log2(c) / -8.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert
new file mode 100644
index 0000000000..8589a5eb35
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary01_ref.vert
@@ -0,0 +1,40 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ float x = (gtf_Color.r + 0.01) / 1.01;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0 / ln2;
+
+ color = vec4(y / -8.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..ed2d0feb45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_float_vert_xvary_ref.vert
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+void main (void)
+{
+ float x = 31.0 * gtf_Color.r + 1.0;
+ float y = 0.0;
+ float z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ float p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0 / ln2;
+
+ color = vec4(y / 5.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..2ee68d590c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 31.0 * color.rg + 1.0;
+ gl_FragColor = vec4(log2(c) / 5.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag
new file mode 100644
index 0000000000..3dd8484bc8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (color.rg + 0.01) / 1.01;
+ gl_FragColor = vec4(log2(c) / -8.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag
new file mode 100644
index 0000000000..ab307fadc5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary01_ref.frag
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec2 x = (color.rg + 0.01) / 1.01;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0 / ln2;
+
+ gl_FragColor = vec4(y / -8.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..9f54de2a2b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_frag_xvary_ref.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec2 x = 31.0 * color.rg + 1.0;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0 / ln2;
+
+ gl_FragColor = vec4(y / 5.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..2f07daaa42
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 31.0 * gtf_Color.rg + 1.0;
+ color = vec4(log2(c) / 5.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert
new file mode 100644
index 0000000000..64312ac8d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = (gtf_Color.rg + 0.01) / 1.01;
+ color = vec4(log2(c) / -8.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert
new file mode 100644
index 0000000000..e0a8cf3419
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary01_ref.vert
@@ -0,0 +1,40 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec2 x = (gtf_Color.rg + 0.01) / 1.01;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0 / ln2;
+
+ color = vec4(y / -8.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..744dfda43f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec2_vert_xvary_ref.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec2 x = 31.0 * gtf_Color.rg + 1.0;
+ vec2 y = vec2(0.0);
+ vec2 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec2 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0 / ln2;
+
+ color = vec4(y / 5.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..5cecf12102
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 31.0 * color.rgb + 1.0;
+ gl_FragColor = vec4(log2(c) / 5.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag
new file mode 100644
index 0000000000..098e2f9555
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (color.rgb + 0.01) / 1.01;
+ gl_FragColor = vec4(log2(c) / -8.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag
new file mode 100644
index 0000000000..5cdf6af9ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary01_ref.frag
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec3 x = (color.rgb + 0.01) / 1.01;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0 / ln2;
+
+ gl_FragColor = vec4(y / -8.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..d7303ef677
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_frag_xvary_ref.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec3 x = 31.0 * color.rgb + 1.0;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0 / ln2;
+
+ gl_FragColor = vec4(y / 5.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..26a270b80d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 31.0 * gtf_Color.rgb + 1.0;
+ color = vec4(log2(c) / 5.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert
new file mode 100644
index 0000000000..3f8c464f31
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = (gtf_Color.rgb + 0.01) / 1.01;
+ color = vec4(log2(c) / -8.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert
new file mode 100644
index 0000000000..97bfe7775d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary01_ref.vert
@@ -0,0 +1,40 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec3 x = (gtf_Color.rgb + 0.01) / 1.01;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ // Note: z will always be negative between 0.01 and 1.0 and
+ // so will y since it is raised to an odd power, and the shader spec
+ // does not support pow(-x, y) where y is not a compile time constant
+ z = abs((x - 1.0) / (x + 1.0));
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= -2.0 / ln2;
+
+ color = vec4(y / -8.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..de23394ff0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/log2/log2_vec3_vert_xvary_ref.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+const float ln2 = 0.69314718055994530941723212145818;
+
+
+
+void main (void)
+{
+ vec3 x = 31.0 * gtf_Color.rgb + 1.0;
+ vec3 y = vec3(0.0);
+ vec3 z; // x-1 / x+1
+ int n = 50;
+
+ // ln(x) = 2[x-1 + 1 (x-1)^3 + 1 (x-1)^5 + ...] for x > 0
+ // [x+1 3 (x+1) 5 (x+1) ]
+ z = (x - 1.0) / (x + 1.0);
+ vec3 p = z;
+ for(int i = 1; i <= 101; i += 2)
+ {
+ y += p / float(i);
+ p *= z * z;
+ }
+ y *= 2.0 / ln2;
+
+ color = vec4(y / 5.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag
new file mode 100644
index 0000000000..46ea31cf8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_frag.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat2 a = mat2(1.0, 2.0, 3.0, 4.0);
+ const mat2 b = mat2(5.0, 6.0, 7.0, 8.0);
+ mat2 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert
new file mode 100644
index 0000000000..83845e66ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat2_vert.vert
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat2 a = mat2(1.0, 2.0, 3.0, 4.0);
+ const mat2 b = mat2(5.0, 6.0, 7.0, 8.0);
+ mat2 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag
new file mode 100644
index 0000000000..1d0cdf2824
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_frag.frag
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat3 a = mat3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+ const mat3 b = mat3(10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0,
+ 16.0, 17.0, 18.0);
+ mat3 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert
new file mode 100644
index 0000000000..a0237d63c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat3_vert.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat3 a = mat3(1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+ const mat3 b = mat3(10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0,
+ 16.0, 17.0, 18.0);
+ mat3 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag
new file mode 100644
index 0000000000..28262c2fa0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_frag.frag
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ const mat4 b = mat4(17.0, 18.0, 19.0, 20.0,
+ 21.0, 22.0, 23.0, 24.0,
+ 25.0, 26.0, 27.0, 28.0,
+ 29.0, 30.0, 31.0, 32.0);
+ mat4 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert
new file mode 100644
index 0000000000..ebc80931e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/array_const_mat4_vert.vert
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+const int array_size = 2;
+
+void main (void)
+{
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ const mat4 b = mat4(17.0, 18.0, 19.0, 20.0,
+ 21.0, 22.0, 23.0, 24.0,
+ 25.0, 26.0, 27.0, 28.0,
+ 29.0, 30.0, 31.0, 32.0);
+ mat4 array[array_size];
+ float gray;
+
+ array[0] = a;
+ array[1] = b;
+
+ if((array[0] == a) && (array[1] == b))
+ gray = 1.0;
+ else
+ gray = 0.0;
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag
new file mode 100644
index 0000000000..1f88596733
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_frag.frag
@@ -0,0 +1,56 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert
new file mode 100644
index 0000000000..1a87e5e4f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_copy_vert.vert
@@ -0,0 +1,55 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag
new file mode 100644
index 0000000000..d827f2a666
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_frag.frag
@@ -0,0 +1,53 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert
new file mode 100644
index 0000000000..4a68460ed2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat2_vert.vert
@@ -0,0 +1,52 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 2 by 2 matrix with unique elements.
+ const mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag
new file mode 100644
index 0000000000..68764145ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Copy the constant matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 5.0) elms = false;
+ if(b[1][2] != 6.0) elms = false;
+ if(b[2][0] != 7.0) elms = false;
+ if(b[2][1] != 8.0) elms = false;
+ if(b[2][2] != 9.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert
new file mode 100644
index 0000000000..c4b5dbc84d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_copy_vert.vert
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[1][0] != 8.0) elms = false;
+ if(b[1][1] != 16.0) elms = false;
+ if(b[1][2] != 32.0) elms = false;
+ if(b[2][0] != 64.0) elms = false;
+ if(b[2][1] != 128.0) elms = false;
+ if(b[2][2] != 256.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag
new file mode 100644
index 0000000000..605dc39298
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_frag.frag
@@ -0,0 +1,63 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 5.0) elms = false;
+ if(a[1][2] != 6.0) elms = false;
+ if(a[2][0] != 7.0) elms = false;
+ if(a[2][1] != 8.0) elms = false;
+ if(a[2][2] != 9.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert
new file mode 100644
index 0000000000..5b66a4ff24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat3_vert.vert
@@ -0,0 +1,62 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 3 by 3 matrix with unique elements.
+ const mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[1][0] != 8.0) elms = false;
+ if(a[1][1] != 16.0) elms = false;
+ if(a[1][2] != 32.0) elms = false;
+ if(a[2][0] != 64.0) elms = false;
+ if(a[2][1] != 128.0) elms = false;
+ if(a[2][2] != 256.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag
new file mode 100644
index 0000000000..c9fc9222a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_frag.frag
@@ -0,0 +1,78 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Copy the constant matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[0][3] != 4.0) elms = false;
+ if(b[1][0] != 5.0) elms = false;
+ if(b[1][1] != 6.0) elms = false;
+ if(b[1][2] != 7.0) elms = false;
+ if(b[1][3] != 8.0) elms = false;
+ if(b[2][0] != 9.0) elms = false;
+ if(b[2][1] != 10.0) elms = false;
+ if(b[2][2] != 11.0) elms = false;
+ if(b[2][3] != 12.0) elms = false;
+ if(b[3][0] != 13.0) elms = false;
+ if(b[3][1] != 14.0) elms = false;
+ if(b[3][2] != 15.0) elms = false;
+ if(b[3][3] != 16.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert
new file mode 100644
index 0000000000..083f626b8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_copy_vert.vert
@@ -0,0 +1,77 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Copy the constant matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[0][3] != 8.0) elms = false;
+ if(b[1][0] != 16.0) elms = false;
+ if(b[1][1] != 32.0) elms = false;
+ if(b[1][2] != 64.0) elms = false;
+ if(b[1][3] != 128.0) elms = false;
+ if(b[2][0] != 256.0) elms = false;
+ if(b[2][1] != 512.0) elms = false;
+ if(b[2][2] != 1024.0) elms = false;
+ if(b[2][3] != 2048.0) elms = false;
+ if(b[3][0] != 4096.0) elms = false;
+ if(b[3][1] != 8192.0) elms = false;
+ if(b[3][2] != 16384.0) elms = false;
+ if(b[3][3] != 32768.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag
new file mode 100644
index 0000000000..bca12dbbed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_frag.frag
@@ -0,0 +1,75 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[0][3] != 4.0) elms = false;
+ if(a[1][0] != 5.0) elms = false;
+ if(a[1][1] != 6.0) elms = false;
+ if(a[1][2] != 7.0) elms = false;
+ if(a[1][3] != 8.0) elms = false;
+ if(a[2][0] != 9.0) elms = false;
+ if(a[2][1] != 10.0) elms = false;
+ if(a[2][2] != 11.0) elms = false;
+ if(a[2][3] != 12.0) elms = false;
+ if(a[3][0] != 13.0) elms = false;
+ if(a[3][1] != 14.0) elms = false;
+ if(a[3][2] != 15.0) elms = false;
+ if(a[3][3] != 16.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert
new file mode 100644
index 0000000000..8010ab7752
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/const_mat4_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ const mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[0][3] != 8.0) elms = false;
+ if(a[1][0] != 16.0) elms = false;
+ if(a[1][1] != 32.0) elms = false;
+ if(a[1][2] != 64.0) elms = false;
+ if(a[1][3] != 128.0) elms = false;
+ if(a[2][0] != 256.0) elms = false;
+ if(a[2][1] != 512.0) elms = false;
+ if(a[2][2] != 1024.0) elms = false;
+ if(a[2][3] != 2048.0) elms = false;
+ if(a[3][0] != 4096.0) elms = false;
+ if(a[3][1] != 8192.0) elms = false;
+ if(a[3][2] != 16384.0) elms = false;
+ if(a[3][3] != 32768.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt
new file mode 100644
index 0000000000..730999d88d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/input.run.txt
@@ -0,0 +1,7 @@
+# this file is auto-generated. DO NOT EDIT.
+mat_001_to_008.html
+mat_009_to_016.html
+mat_017_to_024.html
+mat_025_to_032.html
+mat_033_to_040.html
+mat_041_to_046.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag
new file mode 100644
index 0000000000..a4c35d387d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(color.rg, color.ba);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[1][0] != color.b) result = black;
+ if(m[1][1] != color.a) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert
new file mode 100644
index 0000000000..68bc1cc1b3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_2vec2_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(gtf_Color.rg, gtf_Color.ba);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[1][0] != gtf_Color.b) result = black;
+ if(m[1][1] != gtf_Color.a) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag
new file mode 100644
index 0000000000..d4d03d3a18
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(color.r, color.g, color.b, color.a);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[1][0] != color.b) result = black;
+ if(m[1][1] != color.a) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert
new file mode 100644
index 0000000000..204511e73c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_4float_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[1][0] != gtf_Color.b) result = black;
+ if(m[1][1] != gtf_Color.a) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag
new file mode 100644
index 0000000000..de941ae60c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_frag.frag
@@ -0,0 +1,56 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert
new file mode 100644
index 0000000000..7659358d4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_copy_vert.vert
@@ -0,0 +1,55 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Copy the matrix to another non-const matrix.
+ mat2 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 8.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag
new file mode 100644
index 0000000000..05630af9cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert
new file mode 100644
index 0000000000..71ceb36970
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_float_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m = mat2(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag
new file mode 100644
index 0000000000..765949d942
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_frag.frag
@@ -0,0 +1,53 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert
new file mode 100644
index 0000000000..cb2b46fd2e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat2_vert.vert
@@ -0,0 +1,52 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 2 by 2 matrix with unique elements.
+ mat2 a = mat2(1.0, 2.0, // 1.0 4.0
+ 4.0, 8.0); // 2.0 8.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 8.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0];
+ if(x < 5.0-ERROR_EPSILON || x > 5.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1];
+ if(x < 3.0-ERROR_EPSILON || x > 3.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1];
+ if(x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag
new file mode 100644
index 0000000000..b040e0b2e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(color.rgb, color.rgb, color.rgb);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[0][2] != color.b) result = black;
+ if(m[1][0] != color.r) result = black;
+ if(m[1][1] != color.g) result = black;
+ if(m[1][2] != color.b) result = black;
+ if(m[2][0] != color.r) result = black;
+ if(m[2][1] != color.g) result = black;
+ if(m[2][2] != color.b) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert
new file mode 100644
index 0000000000..c0e79d0c3b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_3vec3_vert.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[0][2] != gtf_Color.b) result = black;
+ if(m[1][0] != gtf_Color.r) result = black;
+ if(m[1][1] != gtf_Color.g) result = black;
+ if(m[1][2] != gtf_Color.b) result = black;
+ if(m[2][0] != gtf_Color.r) result = black;
+ if(m[2][1] != gtf_Color.g) result = black;
+ if(m[2][2] != gtf_Color.b) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag
new file mode 100644
index 0000000000..ac54f6162d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(color.r, color.g, color.b, color.r, color.g, color.b, color.r, color.g, color.b);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if(m[0][0] != color.r) result = black;
+ if(m[0][1] != color.g) result = black;
+ if(m[0][2] != color.b) result = black;
+ if(m[1][0] != color.r) result = black;
+ if(m[1][1] != color.g) result = black;
+ if(m[1][2] != color.b) result = black;
+ if(m[2][0] != color.r) result = black;
+ if(m[2][1] != color.g) result = black;
+ if(m[2][2] != color.b) result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert
new file mode 100644
index 0000000000..1752e5799d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_9float_vert.vert
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.r, gtf_Color.g, gtf_Color.b);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+
+ if(m[0][0] != gtf_Color.r) result = black;
+ if(m[0][1] != gtf_Color.g) result = black;
+ if(m[0][2] != gtf_Color.b) result = black;
+ if(m[1][0] != gtf_Color.r) result = black;
+ if(m[1][1] != gtf_Color.g) result = black;
+ if(m[1][2] != gtf_Color.b) result = black;
+ if(m[2][0] != gtf_Color.r) result = black;
+ if(m[2][1] != gtf_Color.g) result = black;
+ if(m[2][2] != gtf_Color.b) result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag
new file mode 100644
index 0000000000..cead1e7a20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Copy the matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[1][0] != 4.0) elms = false;
+ if(b[1][1] != 5.0) elms = false;
+ if(b[1][2] != 6.0) elms = false;
+ if(b[2][0] != 7.0) elms = false;
+ if(b[2][1] != 8.0) elms = false;
+ if(b[2][2] != 9.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert
new file mode 100644
index 0000000000..2432aba504
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_copy_vert.vert
@@ -0,0 +1,65 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Copy the matrix to another non-const matrix.
+ mat3 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[1][0] != 8.0) elms = false;
+ if(b[1][1] != 16.0) elms = false;
+ if(b[1][2] != 32.0) elms = false;
+ if(b[2][0] != 64.0) elms = false;
+ if(b[2][1] != 128.0) elms = false;
+ if(b[2][2] != 256.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag
new file mode 100644
index 0000000000..26d9662bc8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_frag.frag
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+ if((m[0][2] != 0.0))
+ result = black;
+
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+ if((m[1][2] != 0.0))
+ result = black;
+
+ if((m[2][0] != 0.0))
+ result = black;
+ if((m[2][1] != 0.0))
+ result = black;
+ if((m[2][2] != 0.5))
+ result = black;
+
+ gl_FragColor = result;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert
new file mode 100644
index 0000000000..f3e846d1b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_float_vert.vert
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m = mat3(0.5);
+ vec4 black = vec4(0.0, 0.0, 0.0, 1.0);
+ vec4 result = vec4(1.0, 1.0, 1.0, 1.0);
+
+ if((m[0][0] != 0.5))
+ result = black;
+ if((m[0][1] != 0.0))
+ result = black;
+ if((m[0][2] != 0.0))
+ result = black;
+
+ if((m[1][0] != 0.0))
+ result = black;
+ if((m[1][1] != 0.5))
+ result = black;
+ if((m[1][2] != 0.0))
+ result = black;
+
+ if((m[2][0] != 0.0))
+ result = black;
+ if((m[2][1] != 0.0))
+ result = black;
+ if((m[2][2] != 0.5))
+ result = black;
+
+ color = result;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag
new file mode 100644
index 0000000000..f7bc3e0b8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_frag.frag
@@ -0,0 +1,63 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 3.0,
+ 4.0, 5.0, 6.0,
+ 7.0, 8.0, 9.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[1][0] != 4.0) elms = false;
+ if(a[1][1] != 5.0) elms = false;
+ if(a[1][2] != 6.0) elms = false;
+ if(a[2][0] != 7.0) elms = false;
+ if(a[2][1] != 8.0) elms = false;
+ if(a[2][2] != 9.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 12.0-ERROR_EPSILON || x > 12.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 18.0-ERROR_EPSILON || x > 18.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 6.0-ERROR_EPSILON || x > 6.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 24.0-ERROR_EPSILON || x > 24.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert
new file mode 100644
index 0000000000..6fee73b959
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat3_vert.vert
@@ -0,0 +1,62 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 3 by 3 matrix with unique elements.
+ mat3 a = mat3( 1.0, 2.0, 4.0, // 1.0 8.0 64.0
+ 8.0, 16.0, 32.0, // 2.0 16.0 128.0
+ 64.0, 128.0, 256.0); // 4.0 32.0 256.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[1][0] != 8.0) elms = false;
+ if(a[1][1] != 16.0) elms = false;
+ if(a[1][2] != 32.0) elms = false;
+ if(a[2][0] != 64.0) elms = false;
+ if(a[2][1] != 128.0) elms = false;
+ if(a[2][2] != 256.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0];
+ if( x < 73.0-ERROR_EPSILON || x > 73.0+ERROR_EPSILON ) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1];
+ if(x < 146.0-ERROR_EPSILON || x > 146.0+ERROR_EPSILON ) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2];
+ if(x < 292.0-ERROR_EPSILON || x > 292.0+ERROR_EPSILON ) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2];
+ if( x < 7.0-ERROR_EPSILON || x > 7.0+ERROR_EPSILON ) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2];
+ if(x < 56.0-ERROR_EPSILON || x > 56.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2];
+ if(x < 448.0-ERROR_EPSILON || x > 448.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag
new file mode 100644
index 0000000000..44a8076999
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_frag.frag
@@ -0,0 +1,57 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+
+ sum1 += a[0][0];
+ sum2 += a[1][0];
+ sum3 += a[2][0];
+ sum4 += a[3][0];
+
+ sum1 += a[0][1];
+ sum2 += a[1][1];
+ sum3 += a[2][1];
+ sum4 += a[3][1];
+
+ sum1 += a[0][2];
+ sum2 += a[1][2];
+ sum3 += a[2][2];
+ sum4 += a[3][2];
+
+ sum1 += a[0][3];
+ sum2 += a[1][3];
+ sum3 += a[2][3];
+ sum4 += a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert
new file mode 100644
index 0000000000..2e3622f679
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_16float_vert.vert
@@ -0,0 +1,54 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ mat4 a = mat4(1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+ sum1 = sum1 + a[0][0];
+ sum2 = sum2 + a[1][0];
+ sum3 = sum3 + a[2][0];
+ sum4 = sum4 + a[3][0];
+
+ sum1 = sum1 + a[0][1];
+ sum2 = sum2 + a[1][1];
+ sum3 = sum3 + a[2][1];
+ sum4 = sum4 + a[3][1];
+
+ sum1 = sum1 + a[0][2];
+ sum2 = sum2 + a[1][2];
+ sum3 = sum3 + a[2][2];
+ sum4 = sum4 + a[3][2];
+
+ sum1 = sum1 + a[0][3];
+ sum2 = sum2 + a[1][3];
+ sum3 = sum3 + a[2][3];
+ sum4 = sum4 + a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag
new file mode 100644
index 0000000000..053a5739b3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_frag.frag
@@ -0,0 +1,59 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ vec4 L1 = vec4(1.0, 2.0, 3.0, 4.0);
+ vec4 L2 = vec4(5.0, 6.0, 7.0, 8.0);
+ vec4 L3 = vec4(9.0, 10.0, 11.0, 12.0);
+ vec4 L4 = vec4(13.0, 14.0, 15.0, 16.0);
+
+ mat4 a = mat4(L1,L2,L3,L4);
+
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+ sum1 = sum1 + a[0][0];
+ sum2 = sum2 + a[1][0];
+ sum3 = sum3 + a[2][0];
+ sum4 = sum4 + a[3][0];
+
+ sum1 = sum1 + a[0][1];
+ sum2 = sum2 + a[1][1];
+ sum3 = sum3 + a[2][1];
+ sum4 = sum4 + a[3][1];
+
+ sum1 = sum1 + a[0][2];
+ sum2 = sum2 + a[1][2];
+ sum3 = sum3 + a[2][2];
+ sum4 = sum4 + a[3][2];
+
+ sum1 = sum1 + a[0][3];
+ sum2 = sum2 + a[1][3];
+ sum3 = sum3 + a[2][3];
+ sum4 = sum4 + a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert
new file mode 100644
index 0000000000..c238cdcd15
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_4vec4_vert.vert
@@ -0,0 +1,56 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ vec4 L1 = vec4(1.0, 2.0, 3.0, 4.0);
+ vec4 L2 = vec4(5.0, 6.0, 7.0, 8.0);
+ vec4 L3 = vec4(9.0, 10.0, 11.0, 12.0);
+ vec4 L4 = vec4(13.0, 14.0, 15.0, 16.0);
+
+ mat4 a = mat4(L1,L2,L3,L4);
+
+ float gray,sum1=0.0,sum2=0.0,sum3=0.0,sum4=0.0;
+ int i;
+
+ sum1 = sum1 + a[0][0];
+ sum2 = sum2 + a[1][0];
+ sum3 = sum3 + a[2][0];
+ sum4 = sum4 + a[3][0];
+
+ sum1 = sum1 + a[0][1];
+ sum2 = sum2 + a[1][1];
+ sum3 = sum3 + a[2][1];
+ sum4 = sum4 + a[3][1];
+
+ sum1 = sum1 + a[0][2];
+ sum2 = sum2 + a[1][2];
+ sum3 = sum3 + a[2][2];
+ sum4 = sum4 + a[3][2];
+
+ sum1 = sum1 + a[0][3];
+ sum2 = sum2 + a[1][3];
+ sum3 = sum3 + a[2][3];
+ sum4 = sum4 + a[3][3];
+
+ if( ( sum1 > 10.0-ERROR_EPSILON && sum1 < 10.0+ERROR_EPSILON ) &&
+ ( sum2 > 26.0-ERROR_EPSILON && sum2 < 26.0+ERROR_EPSILON) &&
+ ( sum3 > 42.0-ERROR_EPSILON && sum3 < 42.0+ERROR_EPSILON) &&
+ ( sum4 > 58.0-ERROR_EPSILON && sum4 < 58.0+ERROR_EPSILON) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag
new file mode 100644
index 0000000000..b36313425f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_frag.frag
@@ -0,0 +1,78 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a constant 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Copy the matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 3.0) elms = false;
+ if(b[0][3] != 4.0) elms = false;
+ if(b[1][0] != 5.0) elms = false;
+ if(b[1][1] != 6.0) elms = false;
+ if(b[1][2] != 7.0) elms = false;
+ if(b[1][3] != 8.0) elms = false;
+ if(b[2][0] != 9.0) elms = false;
+ if(b[2][1] != 10.0) elms = false;
+ if(b[2][2] != 11.0) elms = false;
+ if(b[2][3] != 12.0) elms = false;
+ if(b[3][0] != 13.0) elms = false;
+ if(b[3][1] != 14.0) elms = false;
+ if(b[3][2] != 15.0) elms = false;
+ if(b[3][3] != 16.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert
new file mode 100644
index 0000000000..3c06f3258d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_copy_vert.vert
@@ -0,0 +1,77 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Copy the matrix to another non-const matrix.
+ mat4 b = a;
+
+ // Check each element of the copy.
+ bool elms = true;
+ if(b[0][0] != 1.0) elms = false;
+ if(b[0][1] != 2.0) elms = false;
+ if(b[0][2] != 4.0) elms = false;
+ if(b[0][3] != 8.0) elms = false;
+ if(b[1][0] != 16.0) elms = false;
+ if(b[1][1] != 32.0) elms = false;
+ if(b[1][2] != 64.0) elms = false;
+ if(b[1][3] != 128.0) elms = false;
+ if(b[2][0] != 256.0) elms = false;
+ if(b[2][1] != 512.0) elms = false;
+ if(b[2][2] != 1024.0) elms = false;
+ if(b[2][3] != 2048.0) elms = false;
+ if(b[3][0] != 4096.0) elms = false;
+ if(b[3][1] != 8192.0) elms = false;
+ if(b[3][2] != 16384.0) elms = false;
+ if(b[3][3] != 32768.0) elms = false;
+
+ // Add up each row of the copy.
+ bool rows = true;
+ x = b[0][0] + b[1][0] + b[2][0] + b[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = b[0][1] + b[1][1] + b[2][1] + b[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = b[0][2] + b[1][2] + b[2][2] + b[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = b[0][3] + b[1][3] + b[2][3] + b[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = b[0][0] + b[0][1] + b[0][2] + b[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = b[1][0] + b[1][1] + b[1][2] + b[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = b[2][0] + b[2][1] + b[2][2] + b[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = b[3][0] + b[3][1] + b[3][2] + b[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag
new file mode 100644
index 0000000000..92c3f7c890
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_frag.frag
@@ -0,0 +1,75 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+/* This epsilon will work as long as the magnitude of the float is < 128.
+ * This can be seen by taking the spec relative mediump precision of 2^-10:
+ * 0.125 / 2^-10 = 128
+ */
+#define ERROR_EPSILON (0.125)
+
+void main (void)
+{
+ float x;
+ // Declare a 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 3.0, 4.0,
+ 5.0, 6.0, 7.0, 8.0,
+ 9.0, 10.0, 11.0, 12.0,
+ 13.0, 14.0, 15.0, 16.0);
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 3.0) elms = false;
+ if(a[0][3] != 4.0) elms = false;
+ if(a[1][0] != 5.0) elms = false;
+ if(a[1][1] != 6.0) elms = false;
+ if(a[1][2] != 7.0) elms = false;
+ if(a[1][3] != 8.0) elms = false;
+ if(a[2][0] != 9.0) elms = false;
+ if(a[2][1] != 10.0) elms = false;
+ if(a[2][2] != 11.0) elms = false;
+ if(a[2][3] != 12.0) elms = false;
+ if(a[3][0] != 13.0) elms = false;
+ if(a[3][1] != 14.0) elms = false;
+ if(a[3][2] != 15.0) elms = false;
+ if(a[3][3] != 16.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 28.0-ERROR_EPSILON || x > 28.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 32.0-ERROR_EPSILON || x > 32.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 36.0-ERROR_EPSILON || x > 36.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 40.0-ERROR_EPSILON || x > 40.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column of the copy.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 10.0-ERROR_EPSILON || x > 10.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 26.0-ERROR_EPSILON || x > 26.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 42.0-ERROR_EPSILON || x > 42.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 58.0-ERROR_EPSILON || x > 58.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the fragment color.
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert
new file mode 100644
index 0000000000..d0953158a6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat4_vert.vert
@@ -0,0 +1,74 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.1
+
+void main (void)
+{
+ float x;
+ // Declare a 4 by 4 matrix with unique elements.
+ mat4 a = mat4( 1.0, 2.0, 4.0, 8.0, // 1.0 16.0 256.0 4096.0
+ 16.0, 32.0, 64.0, 128.0, // 2.0 32.0 512.0 8192.0
+ 256.0, 512.0, 1024.0, 2048.0, // 4.0 64.0 1024.0 16384.0
+ 4096.0, 8192.0, 16384.0, 32768.0); // 8.0 128.0 2048.0 32768.0
+
+ // Check each element.
+ bool elms = true;
+ if(a[0][0] != 1.0) elms = false;
+ if(a[0][1] != 2.0) elms = false;
+ if(a[0][2] != 4.0) elms = false;
+ if(a[0][3] != 8.0) elms = false;
+ if(a[1][0] != 16.0) elms = false;
+ if(a[1][1] != 32.0) elms = false;
+ if(a[1][2] != 64.0) elms = false;
+ if(a[1][3] != 128.0) elms = false;
+ if(a[2][0] != 256.0) elms = false;
+ if(a[2][1] != 512.0) elms = false;
+ if(a[2][2] != 1024.0) elms = false;
+ if(a[2][3] != 2048.0) elms = false;
+ if(a[3][0] != 4096.0) elms = false;
+ if(a[3][1] != 8192.0) elms = false;
+ if(a[3][2] != 16384.0) elms = false;
+ if(a[3][3] != 32768.0) elms = false;
+
+ // Add up each row.
+ bool rows = true;
+ x = a[0][0] + a[1][0] + a[2][0] + a[3][0];
+ if(x < 4369.0-ERROR_EPSILON || x > 4369.0+ERROR_EPSILON) rows = false;
+ x = a[0][1] + a[1][1] + a[2][1] + a[3][1];
+ if(x < 8738.0-ERROR_EPSILON || x > 8738.0+ERROR_EPSILON) rows = false;
+ x = a[0][2] + a[1][2] + a[2][2] + a[3][2];
+ if(x < 17476.0-ERROR_EPSILON || x > 17476.0+ERROR_EPSILON) rows = false;
+ x = a[0][3] + a[1][3] + a[2][3] + a[3][3];
+ if(x < 34952.0-ERROR_EPSILON || x > 34952.0+ERROR_EPSILON) rows = false;
+
+ // Add up each column.
+ bool cols = true;
+ x = a[0][0] + a[0][1] + a[0][2] + a[0][3];
+ if(x < 15.0-ERROR_EPSILON || x > 15.0+ERROR_EPSILON) cols = false;
+ x = a[1][0] + a[1][1] + a[1][2] + a[1][3];
+ if(x < 240.0-ERROR_EPSILON || x > 240.0+ERROR_EPSILON) cols = false;
+ x = a[2][0] + a[2][1] + a[2][2] + a[2][3];
+ if(x < 3840.0-ERROR_EPSILON || x > 3840.0+ERROR_EPSILON) cols = false;
+ x = a[3][0] + a[3][1] + a[3][2] + a[3][3];
+ if(x < 61440.0-ERROR_EPSILON || x > 61440.0+ERROR_EPSILON) cols = false;
+
+ // Check if all of the operations were successful.
+ float gray = elms && rows && cols ? 1.0 : 0.0;
+
+ // Assign the varying variable color.
+ color = vec4(gray, gray, gray, 1.0);
+
+ // Transform the vertex position.
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html
new file mode 100644
index 0000000000..e53b2780a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_001_to_008.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mat_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat2_frag.frag"
+ },
+ "name": "const_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat3_frag.frag"
+ },
+ "name": "const_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat4_frag.frag"
+ },
+ "name": "const_mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat2_copy_frag.frag"
+ },
+ "name": "const_mat2_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat2_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat2_copy_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html
new file mode 100644
index 0000000000..0a3e5c1916
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_009_to_016.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mat_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat3_copy_frag.frag"
+ },
+ "name": "const_mat3_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat3_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat3_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "const_mat4_copy_frag.frag"
+ },
+ "name": "const_mat4_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "const_mat4_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "const_mat4_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_frag.frag"
+ },
+ "name": "mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_frag.frag"
+ },
+ "name": "mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html
new file mode 100644
index 0000000000..9f0ef60dd9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_017_to_024.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mat_017_to_024.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_frag.frag"
+ },
+ "name": "mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_copy_frag.frag"
+ },
+ "name": "mat2_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat2_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_copy_frag.frag"
+ },
+ "name": "mat3_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat3_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_copy_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_copy_frag.frag"
+ },
+ "name": "mat4_copy_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_copy_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_copy_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html
new file mode 100644
index 0000000000..58ac71f99a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_025_to_032.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mat_025_to_032.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_float_frag.frag"
+ },
+ "name": "mat2_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat2_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_4float_frag.frag"
+ },
+ "name": "mat2_4float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat2_4float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_4float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat2_2vec2_frag.frag"
+ },
+ "name": "mat2_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat2_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat2_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_float_frag.frag"
+ },
+ "name": "mat3_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat3_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html
new file mode 100644
index 0000000000..93245d25f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_033_to_040.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mat_033_to_040.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_9float_frag.frag"
+ },
+ "name": "mat3_9float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat3_9float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_9float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat3_3vec3_frag.frag"
+ },
+ "name": "mat3_3vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mat3_3vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3_3vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_4vec4_frag.frag"
+ },
+ "name": "mat4_4vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_4vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_4vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mat4_16float_frag.frag"
+ },
+ "name": "mat4_16float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat4_16float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat4_16float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html
new file mode 100644
index 0000000000..ddb93574a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat/mat_041_to_046.html
@@ -0,0 +1,181 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mat_041_to_046.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array_const_mat2_frag.frag"
+ },
+ "name": "array_const_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "array_const_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "array_const_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array_const_mat3_frag.frag"
+ },
+ "name": "array_const_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "array_const_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "array_const_mat3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "array_const_mat4_frag.frag"
+ },
+ "name": "array_const_mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "array_const_mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "array_const_mat4_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt
new file mode 100644
index 0000000000..f79e127c27
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+mat3_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html
new file mode 100644
index 0000000000..cd332fa805
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3_001_to_006.html
@@ -0,0 +1,343 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mat3_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.25,
+ 0.125,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat3arraysimple_vert.vert",
+ "uniforms": {
+ "testmat3": {
+ "count": 2,
+ "type": "uniformMatrix3fv",
+ "transpose": false,
+ "value": [
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3arraysimple_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 0.75,
+ 0.625,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat3arrayindirect0_vert.vert",
+ "uniforms": {
+ "testmat3": {
+ "count": 2,
+ "type": "uniformMatrix3fv",
+ "transpose": false,
+ "value": [
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3arrayindirect0_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.25,
+ 0.125,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mat3arrayindirect1_vert.vert",
+ "uniforms": {
+ "testmat3": {
+ "count": 2,
+ "type": "uniformMatrix3fv",
+ "transpose": false,
+ "value": [
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mat3arrayindirect1_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.25,
+ 0.125,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "testmat3": {
+ "count": 2,
+ "type": "uniformMatrix3fv",
+ "transpose": false,
+ "value": [
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25
+ ]
+ }
+ },
+ "fragmentShader": "mat3arraysimple_frag.frag"
+ },
+ "name": "mat3arraysimple_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 0.75,
+ 0.625,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "testmat3": {
+ "count": 2,
+ "type": "uniformMatrix3fv",
+ "transpose": false,
+ "value": [
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25
+ ]
+ }
+ },
+ "fragmentShader": "mat3arrayindirect0_frag.frag"
+ },
+ "name": "mat3arrayindirect0_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.25,
+ 0.125,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "testmat3": {
+ "count": 2,
+ "type": "uniformMatrix3fv",
+ "transpose": false,
+ "value": [
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 1.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.25,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.25
+ ]
+ }
+ },
+ "fragmentShader": "mat3arrayindirect1_frag.frag"
+ },
+ "name": "mat3arrayindirect1_frag.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag
new file mode 100644
index 0000000000..d1aba8a919
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_frag.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//
+// mat3arrayindirect0_frag.frag: Fragment shader solid color
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform mat3 testmat3[2];
+varying vec4 color;
+
+void main(void)
+{
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ /*
+ // No indirect indexing in fragment shaders
+ for(int j = 0; j < 3; j++)
+ {
+ result += testmat3[0][j] + testmat3[1][j];
+ }
+ */
+ result += testmat3[0][0] + testmat3[1][0];
+ result += testmat3[0][1] + testmat3[1][1];
+ result += testmat3[0][2] + testmat3[1][2];
+ gl_FragColor = vec4(result/2.0, 0.5);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert
new file mode 100644
index 0000000000..12f3396d26
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect0_vert.vert
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+//
+// mat3arrayindirect0_vert.vert: Vertex shader solid color
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform mat3 testmat3[2];
+varying vec4 color;
+
+
+void main(void)
+{
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ for(int j = 0; j < 3; j++)
+ {
+ result += testmat3[0][j] + testmat3[1][j];
+ }
+
+ color = vec4(result/2.0, 0.5);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag
new file mode 100644
index 0000000000..c9a7bf7075
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_frag.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//
+// mat3arrayindirect1_frag.frag: Fragment shader solid color testing indirect referencing into uniforms
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform mat3 testmat3[2];
+varying vec4 color;
+
+void main(void)
+{
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ /*
+ // No indirect indexing in fragment shaders
+ for(int j = 0; j < 3; j++)
+ {
+ result += testmat3[1][j];
+ }
+*/
+ result += testmat3[1][0];
+ result += testmat3[1][1];
+ result += testmat3[1][2];
+ gl_FragColor = vec4(result/2.0, 0.5);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert
new file mode 100644
index 0000000000..6f66656626
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arrayindirect1_vert.vert
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+//
+// mat3arrayindirect1_vert.vert: Vertex shader solid color testing indirect referencing into uniforms
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform mat3 testmat3[2];
+varying vec4 color;
+
+
+void main(void)
+{
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ for(int j = 0; j < 3; j++)
+ {
+ result += testmat3[1][j];
+ }
+
+
+ color = vec4(result/2.0, 0.5);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag
new file mode 100644
index 0000000000..4e0ee397ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+// mat3arraysimple_frag.frag: Fragment shader solid color testing indirect referencing into uniforms
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform mat3 testmat3[2];
+varying vec4 color;
+
+void main(void)
+{
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ result = testmat3[1][0] + testmat3[1][1] + testmat3[1][2];
+ gl_FragColor = vec4(result/2.0, 0.5);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert
new file mode 100644
index 0000000000..b05e52a9a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mat3/mat3arraysimple_vert.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+//
+// mat3arraysimple_vert.vert: Vertex shader solid color testing indirect referencing into uniforms
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform mat3 testmat3[2];
+varying vec4 color;
+
+
+void main(void)
+{
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ result = testmat3[1][0] + testmat3[1][1] + testmat3[1][2];
+
+ color = vec4(result/2.0, 0.5);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt
new file mode 100644
index 0000000000..91d20c86eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+matrixCompMult_001_to_004.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html
new file mode 100644
index 0000000000..ad6c1d3cdd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixCompMult_001_to_004.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: matrixCompMult_001_to_004.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat2_frag.frag"
+ },
+ "name": "matrixMultComp_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "matrixMultComp_mat2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "matrixMultComp_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "matrixMultComp_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "matrixMultComp_mat3_frag.frag"
+ },
+ "name": "matrixMultComp_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "matrixMultComp_mat3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "matrixMultComp_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "matrixMultComp_mat3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag
new file mode 100644
index 0000000000..f8e6b692bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m1 = mat2(color.rg, color.ba);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3 = matrixCompMult(m1, m2);
+ gl_FragColor = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag
new file mode 100644
index 0000000000..5c482c354c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_frag_ref.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m1 = mat2(color.rg, color.ba);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+
+ gl_FragColor = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert
new file mode 100644
index 0000000000..8dcb323df9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m1 = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3 = matrixCompMult(m1, m2);
+ color = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert
new file mode 100644
index 0000000000..949181a180
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat2_vert_ref.vert
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat2 m1 = mat2(gtf_Color.r, gtf_Color.g, gtf_Color.b, gtf_Color.a);
+ mat2 m2 = mat2(1.0, 0.5, 0.5, 1.0);
+ mat2 m3 = mat2(0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+
+ color = vec4(m3[0][0], m3[1][0], m3[0][1], m3[1][1]);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag
new file mode 100644
index 0000000000..823478c2c3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m1 = mat3(color.rgb, color.rgb, color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3 = matrixCompMult(m1, m2);
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ gl_FragColor = vec4(result / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag
new file mode 100644
index 0000000000..6b10418621
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_frag_ref.frag
@@ -0,0 +1,42 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m1 = mat3(color.rgb, color.rgb, color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[0][2] = m1[0][2] * m2[0][2];
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+ m3[1][2] = m1[1][2] * m2[1][2];
+ m3[2][0] = m1[2][0] * m2[2][0];
+ m3[2][1] = m1[2][1] * m2[2][1];
+ m3[2][2] = m1[2][2] * m2[2][2];
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ gl_FragColor = vec4(result / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert
new file mode 100644
index 0000000000..82825a3030
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m1 = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3 = matrixCompMult(m1, m2);
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ color = vec4(result / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert
new file mode 100644
index 0000000000..8d4c68cd34
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/matrixCompMult/matrixMultComp_mat3_vert_ref.vert
@@ -0,0 +1,47 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ mat3 m1 = mat3(gtf_Color.rgb, gtf_Color.rgb, gtf_Color.rgb);
+ mat3 m2 = mat3(1.0, 0.5, 0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0);
+ mat3 m3 = mat3(0.0);
+ vec3 result = vec3(0.0, 0.0, 0.0);
+
+ m3[0][0] = m1[0][0] * m2[0][0];
+ m3[0][1] = m1[0][1] * m2[0][1];
+ m3[0][2] = m1[0][2] * m2[0][2];
+
+ m3[1][0] = m1[1][0] * m2[1][0];
+ m3[1][1] = m1[1][1] * m2[1][1];
+ m3[1][2] = m1[1][2] * m2[1][2];
+
+ m3[2][0] = m1[2][0] * m2[2][0];
+ m3[2][1] = m1[2][1] * m2[2][1];
+ m3[2][2] = m1[2][2] * m2[2][2];
+
+ result[0] += m3[0][0];
+ result[0] += m3[0][1];
+ result[0] += m3[0][2];
+
+ result[1] += m3[1][0];
+ result[1] += m3[1][1];
+ result[1] += m3[1][2];
+
+ result[2] += m3[2][0];
+ result[2] += m3[2][1];
+ result[2] += m3[2][2];
+
+ color = vec4(result / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt
new file mode 100644
index 0000000000..552692d678
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+max_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html
new file mode 100644
index 0000000000..6f36d22cde
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: max_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "max_float_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "max_float_frag_xvary_yconsthalf.frag"
+ },
+ "name": "max_float_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "max_vec2_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "max_vec2_frag_xvary_yconsthalf.frag"
+ },
+ "name": "max_vec2_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "max_vec3_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "max_vec3_frag_xvary_yconsthalf.frag"
+ },
+ "name": "max_vec3_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "max_float_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "max_float_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "max_float_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "max_vec2_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "max_vec2_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "max_vec2_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "max_vec3_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "max_vec3_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "max_vec3_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..f67b0b4bf7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float max_c = 0.5;
+ float c = color.r;
+ gl_FragColor = vec4(max(c, max_c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..4aadedb023
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float max_c = 0.5;
+ float c = color.r;
+ if(c < max_c) c = max_c;
+
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..31624e13fa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float max_c = 0.5;
+ float c = gtf_Color.r;
+ color = vec4(max(c, max_c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..c8e5054b2d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_float_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float max_c = 0.5;
+ float c = gtf_Color.r;
+ if(c < max_c) c = max_c;
+
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..63f8f0bf70
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 max_c = vec2(0.5, 0.5);
+ vec2 c = color.rg;
+ gl_FragColor = vec4(max(c, max_c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..4935dbd0c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 max_c = vec2(0.5, 0.5);
+ vec2 c = color.rg;
+ if(c[0] < max_c[0]) c[0] = max_c[0];
+ if(c[1] < max_c[1]) c[1] = max_c[1];
+
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..94089c7628
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 max_c = vec2(0.5, 0.5);
+ vec2 c = gtf_Color.rg;
+ color = vec4(max(c, max_c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..5705a9438f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec2_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 max_c = vec2(0.5, 0.5);
+ vec2 c = gtf_Color.rg;
+ if(c[0] < max_c[0]) c[0] = max_c[0];
+ if(c[1] < max_c[1]) c[1] = max_c[1];
+
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..a0709c9477
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 max_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(max(c, max_c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..be1c59119c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 max_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = color.rgb;
+ if(c[0] < max_c[0]) c[0] = max_c[0];
+ if(c[1] < max_c[1]) c[1] = max_c[1];
+ if(c[2] < max_c[2]) c[2] = max_c[2];
+
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..1738973213
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 max_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = gtf_Color.rgb;
+ color = vec4(max(c, max_c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..5e09dede0b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/max/max_vec3_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 max_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = gtf_Color.rgb;
+ if(c[0] < max_c[0]) c[0] = max_c[0];
+ if(c[1] < max_c[1]) c[1] = max_c[1];
+ if(c[2] < max_c[2]) c[2] = max_c[2];
+
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt
new file mode 100644
index 0000000000..5c675deae6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+min_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html
new file mode 100644
index 0000000000..119071f891
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: min_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "min_float_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "min_float_frag_xvary_yconsthalf.frag"
+ },
+ "name": "min_float_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "min_vec2_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "min_vec2_frag_xvary_yconsthalf.frag"
+ },
+ "name": "min_vec2_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "min_vec3_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "min_vec3_frag_xvary_yconsthalf.frag"
+ },
+ "name": "min_vec3_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "min_float_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "min_float_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "min_float_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "min_vec2_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "min_vec2_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "min_vec2_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "min_vec3_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "min_vec3_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "min_vec3_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..033cb89760
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.5;
+ float c = color.r;
+ gl_FragColor = vec4(min(c, min_c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..698b5341d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.5;
+ float c = color.r;
+ if(c > min_c) c = min_c;
+
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..aadc185f2a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.5;
+ float c = gtf_Color.r;
+ color = vec4(min(c, min_c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..140ce28e20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_float_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float min_c = 0.5;
+ float c = gtf_Color.r;
+ if(c > min_c) c = min_c;
+
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..d707e8946c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 min_c = vec2(0.5, 0.5);
+ vec2 c = color.rg;
+ gl_FragColor = vec4(min(c, min_c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..2390a8ea1a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 min_c = vec2(0.5, 0.5);
+ vec2 c = color.rg;
+ if(c[0] > min_c[0]) c[0] = min_c[0];
+ if(c[1] > min_c[1]) c[1] = min_c[1];
+
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..0965d586c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 min_c = vec2(0.5, 0.5);
+ vec2 c = gtf_Color.rg;
+ color = vec4(min(c, min_c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..90729852b0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec2_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 min_c = vec2(0.5, 0.5);
+ vec2 c = gtf_Color.rg;
+ if(c[0] > min_c[0]) c[0] = min_c[0];
+ if(c[1] > min_c[1]) c[1] = min_c[1];
+
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..d2ef6bbbb0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 min_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(min(c, min_c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..2045641652
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 min_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = color.rgb;
+ if(c[0] > min_c[0]) c[0] = min_c[0];
+ if(c[1] > min_c[1]) c[1] = min_c[1];
+ if(c[2] > min_c[2]) c[2] = min_c[2];
+
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..234368010d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 min_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = gtf_Color.rgb;
+ color = vec4(min(c, min_c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..c4a158d399
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/min/min_vec3_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 min_c = vec3(0.5, 0.5, 0.5);
+ vec3 c = gtf_Color.rgb;
+ if(c[0] > min_c[0]) c[0] = min_c[0];
+ if(c[1] > min_c[1]) c[1] = min_c[1];
+ if(c[2] > min_c[2]) c[2] = min_c[2];
+
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt
new file mode 100644
index 0000000000..f1c7ead980
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+mix_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html
new file mode 100644
index 0000000000..27ee005d9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mix_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mix_float_frag_xvary_yconsthalf_aconsthalf.frag"
+ },
+ "name": "mix_float_frag_xvary_yconsthalf_aconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag"
+ },
+ "name": "mix_vec2_frag_xvary_yconsthalf_aconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag"
+ },
+ "name": "mix_vec3_frag_xvary_yconsthalf_aconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mix_float_vert_xvary_yconsthalf_aconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mix_float_vert_xvary_yconsthalf_aconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mix_vec2_vert_xvary_yconsthalf_aconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mix_vec3_vert_xvary_yconsthalf_aconsthalf.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag
new file mode 100644
index 0000000000..f921b5752a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float y = 0.5;
+ const float a = 0.5;
+ float c = color.r;
+ gl_FragColor = vec4(mix(c, y, a), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag
new file mode 100644
index 0000000000..f9aec91bde
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_frag_xvary_yconsthalf_aconsthalf_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float y = 0.5;
+ const float a = 0.5;
+ float c = color.r;
+
+ gl_FragColor = vec4(c * (1.0 - a) + y * a, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert
new file mode 100644
index 0000000000..7dd10983fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float y = 0.5;
+ const float a = 0.5;
+ float c = gtf_Color.r;
+ color = vec4(mix(c, y, a), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert
new file mode 100644
index 0000000000..7379a1eb0e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_float_vert_xvary_yconsthalf_aconsthalf_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float y = 0.5;
+ const float a = 0.5;
+ float c = gtf_Color.r;
+
+ color = vec4(c * (1.0 - a) + y * a, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag
new file mode 100644
index 0000000000..1392a167df
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 y = vec2(0.5, 0.5);
+ const vec2 a = vec2(0.5, 0.5);
+ gl_FragColor = vec4(mix(color.rg, y, a), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag
new file mode 100644
index 0000000000..0b814b8127
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_frag_xvary_yconsthalf_aconsthalf_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 y = vec2(0.5, 0.5);
+ const vec2 a = vec2(0.5, 0.5);
+ vec2 c = color.rg;
+
+ gl_FragColor = vec4(c * (1.0 - a) + y * a, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert
new file mode 100644
index 0000000000..98b357af33
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 y = vec2(0.5, 0.5);
+ const vec2 a = vec2(0.5, 0.5);
+ color = vec4(mix(gtf_Color.rg, y, a), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert
new file mode 100644
index 0000000000..19af8d1028
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec2_vert_xvary_yconsthalf_aconsthalf_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 y = vec2(0.5, 0.5);
+ const vec2 a = vec2(0.5, 0.5);
+ vec2 c = gtf_Color.rg;
+
+ color = vec4(c * (1.0 - a) + y * a, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag
new file mode 100644
index 0000000000..9a55d3ff09
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 y = vec3(0.5, 0.5, 0.5);
+ const vec3 a = vec3(0.5, 0.5, 0.5);
+ gl_FragColor = vec4(mix(color.rgb, y, a), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag
new file mode 100644
index 0000000000..88e44aae9e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_frag_xvary_yconsthalf_aconsthalf_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 y = vec3(0.5, 0.5, 0.5);
+ const vec3 a = vec3(0.5, 0.5, 0.5);
+ vec3 c = color.rgb;
+
+ gl_FragColor = vec4(c * (1.0 - a) + y * a, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert
new file mode 100644
index 0000000000..a7abbd653d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 y = vec3(0.5, 0.5, 0.5);
+ const vec3 a = vec3(0.5, 0.5, 0.5);
+ color = vec4(mix(gtf_Color.rgb, y, a), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert
new file mode 100644
index 0000000000..64aba2a9a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mix/mix_vec3_vert_xvary_yconsthalf_aconsthalf_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 y = vec3(0.5, 0.5, 0.5);
+ const vec3 a = vec3(0.5, 0.5, 0.5);
+ vec3 c = gtf_Color.rgb;
+
+ color = vec4(c * (1.0 - a) + y * a, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt
new file mode 100644
index 0000000000..d369e576f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+mod_001_to_008.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html
new file mode 100644
index 0000000000..23577304e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_001_to_008.html
@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: mod_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mod_float_frag_xvary_yconst1_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mod_float_frag_xvary_yconst1.frag"
+ },
+ "name": "mod_float_frag_xvary_yconst1.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mod_vec2_frag_xvary_yconst1_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mod_vec2_frag_xvary_yconst1.frag"
+ },
+ "name": "mod_vec2_frag_xvary_yconst1.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mod_vec3_frag_xvary_yconst1_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mod_vec3_frag_xvary_yconst1.frag"
+ },
+ "name": "mod_vec3_frag_xvary_yconst1.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "mod_float_vert_xvary_yconst1_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mod_float_vert_xvary_yconst1.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mod_float_vert_xvary_yconst1.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "mod_vec2_vert_xvary_yconst1_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mod_vec2_vert_xvary_yconst1.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mod_vec2_vert_xvary_yconst1.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "mod_vec3_vert_xvary_yconst1_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "mod_vec3_vert_xvary_yconst1.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mod_vec3_vert_xvary_yconst1.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4f",
+ "value": [
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "mod_x_large_y_large_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "mod_x_large_y_large_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4f",
+ "value": [
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "mod_x_large_y_large_frag.frag"
+ },
+ "name": "mod_x_large_y_large_frag.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag
new file mode 100644
index 0000000000..c3ec59b9e9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(mod(c, 1.0), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag
new file mode 100644
index 0000000000..616e907f34
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_frag_xvary_yconst1_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (color.r - 0.5);
+ c = c - 1.0 * floor(c / 1.0);
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert
new file mode 100644
index 0000000000..85f4a97008
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(mod(c, 1.0), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert
new file mode 100644
index 0000000000..fa709a91a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_float_vert_xvary_yconst1_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 10.0 * 2.0 * (gtf_Color.r - 0.5);
+ c = c - 1.0 * floor(c / 1.0);
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag
new file mode 100644
index 0000000000..b65b6054d8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(mod(c, 1.0), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag
new file mode 100644
index 0000000000..4490d64569
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_frag_xvary_yconst1_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (color.rg - 0.5);
+ c = c - 1.0 * floor(c / 1.0);
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert
new file mode 100644
index 0000000000..d622b9a359
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(mod(c, 1.0), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert
new file mode 100644
index 0000000000..62f9c46b00
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec2_vert_xvary_yconst1_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 10.0 * 2.0 * (gtf_Color.rg - 0.5);
+ c = c - 1.0 * floor(c / 1.0);
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag
new file mode 100644
index 0000000000..9ecd423dd8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(mod(c, 1.0), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag
new file mode 100644
index 0000000000..e9cbffb7ef
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_frag_xvary_yconst1_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (color.rgb - 0.5);
+ c = c - 1.0 * floor(c / 1.0);
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert
new file mode 100644
index 0000000000..3b14becf8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(mod(c, 1.0), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert
new file mode 100644
index 0000000000..242fcf07b0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_vec3_vert_xvary_yconst1_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 10.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ c = c - 1.0 * floor(c / 1.0);
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag
new file mode 100644
index 0000000000..7e7128ec27
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4(mod(300.0, 100.0), 0.0, 0.0, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert
new file mode 100644
index 0000000000..1d168308b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/mod/mod_x_large_y_large_vert.vert
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(mod(300.0, 100.0), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt
new file mode 100644
index 0000000000..56ce6dcbe7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+normalize_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html
new file mode 100644
index 0000000000..62b9d239d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: normalize_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "normalize_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "normalize_float_frag_xvary.frag"
+ },
+ "name": "normalize_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "normalize_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "normalize_vec2_frag_xvary.frag"
+ },
+ "name": "normalize_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "normalize_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "normalize_vec3_frag_xvary.frag"
+ },
+ "name": "normalize_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "normalize_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "normalize_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "normalize_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "normalize_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "normalize_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "normalize_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "normalize_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "normalize_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "normalize_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag
new file mode 100644
index 0000000000..805f05753e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = color + vec4(0.25);
+ gl_FragColor = vec4(normalize(tmp_Color.r), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..f6cba372fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = color + vec4(0.25);
+ gl_FragColor = vec4(tmp_Color.r / length(tmp_Color.r), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert
new file mode 100644
index 0000000000..988c7a6064
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = gtf_Color + vec4(0.25);
+ color = vec4(normalize(tmp_Color.r), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..3e30cfd84d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_float_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = gtf_Color + vec4(0.25);
+ color = vec4(tmp_Color.r / length(tmp_Color.r), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..c9df5ecc65
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = color + vec4(0.25);
+ gl_FragColor = vec4(normalize(tmp_Color.rg), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..e329881062
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = color + vec4(0.25);
+ gl_FragColor = vec4(tmp_Color.rg / length(tmp_Color.rg), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..837b149468
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = gtf_Color + vec4(0.25);
+ color = vec4(normalize(tmp_Color.rg), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..ecfdfbbc87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec2_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = gtf_Color + vec4(0.25);
+ color = vec4(tmp_Color.rg / length(tmp_Color.rg), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..78115d7e8b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = color + vec4(0.25);
+ gl_FragColor = vec4(normalize(tmp_Color.rgb), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..aa89b52583
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = color + vec4(0.25);
+ gl_FragColor = vec4(tmp_Color.rgb / length(tmp_Color.rgb), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..747b879203
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = gtf_Color + vec4(0.25);
+ color = vec4(normalize(tmp_Color.rgb), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..70b06e99ba
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/normalize/normalize_vec3_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 tmp_Color = gtf_Color + vec4(0.25);
+ color = vec4(tmp_Color.rgb / length(tmp_Color.rgb), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt
new file mode 100644
index 0000000000..89038b7445
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+not_001_to_004.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html
new file mode 100644
index 0000000000..c505a2f601
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_001_to_004.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: not_001_to_004.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "not_bvec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "not_bvec2_frag.frag"
+ },
+ "name": "not_bvec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "not_bvec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "not_bvec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "not_bvec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "not_bvec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "not_bvec3_frag.frag"
+ },
+ "name": "not_bvec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "not_bvec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "not_bvec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "not_bvec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag
new file mode 100644
index 0000000000..0a89d7ba84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec2(not(bvec2(c))), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag
new file mode 100644
index 0000000000..7bd26175f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_frag_ref.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 _not(in bvec2 a)
+{
+ bvec2 result;
+ if(a[0]) result[0] = false;
+ else result[0] = true;
+ if(a[1]) result[1] = false;
+ else result[1] = true;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec2(_not(bvec2(c))), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert
new file mode 100644
index 0000000000..9006e480d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ color = vec4(vec2(not(bvec2(c))), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert
new file mode 100644
index 0000000000..bd3528fa94
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec2_vert_ref.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 _not(in bvec2 a)
+{
+ bvec2 result;
+ if(a[0]) result[0] = false;
+ else result[0] = true;
+ if(a[1]) result[1] = false;
+ else result[1] = true;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ color = vec4(vec2(_not(bvec2(c))), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag
new file mode 100644
index 0000000000..a0d6beaf91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec3(not(bvec3(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag
new file mode 100644
index 0000000000..5cfc127c63
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_frag_ref.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 _not(in bvec3 a)
+{
+ bvec3 result;
+ if(a[0]) result[0] = false;
+ else result[0] = true;
+ if(a[1]) result[1] = false;
+ else result[1] = true;
+ if(a[2]) result[2] = false;
+ else result[2] = true;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ gl_FragColor = vec4(vec3(_not(bvec3(c))), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert
new file mode 100644
index 0000000000..48d99112be
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ color = vec4(vec3(not(bvec3(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert
new file mode 100644
index 0000000000..7d54ec2cfc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/not/not_bvec3_vert_ref.vert
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 _not(in bvec3 a)
+{
+ bvec3 result;
+ if(a[0]) result[0] = false;
+ else result[0] = true;
+ if(a[1]) result[1] = false;
+ else result[1] = true;
+ if(a[2]) result[2] = false;
+ else result[2] = true;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ color = vec4(vec3(_not(bvec3(c))), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt
new file mode 100644
index 0000000000..9bc23768ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/input.run.txt
@@ -0,0 +1,3 @@
+# this file is auto-generated. DO NOT EDIT.
+notEqual_001_to_008.html
+notEqual_009_to_012.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html
new file mode 100644
index 0000000000..5ad5a6bcc0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: notEqual_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_vec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_vec2_frag.frag"
+ },
+ "name": "notEqual_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "notEqual_vec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "notEqual_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "notEqual_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_vec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_vec3_frag.frag"
+ },
+ "name": "notEqual_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "notEqual_vec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "notEqual_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "notEqual_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_ivec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_ivec2_frag.frag"
+ },
+ "name": "notEqual_ivec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "notEqual_ivec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "notEqual_ivec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "notEqual_ivec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_ivec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_ivec3_frag.frag"
+ },
+ "name": "notEqual_ivec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "notEqual_ivec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "notEqual_ivec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "notEqual_ivec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html
new file mode 100644
index 0000000000..c2693e7fec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_009_to_012.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: notEqual_009_to_012.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_bvec2_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_bvec2_frag.frag"
+ },
+ "name": "notEqual_bvec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "notEqual_bvec2_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "notEqual_bvec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "notEqual_bvec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_bvec3_frag_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "notEqual_bvec3_frag.frag"
+ },
+ "name": "notEqual_bvec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "notEqual_bvec3_vert_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "notEqual_bvec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "notEqual_bvec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag
new file mode 100644
index 0000000000..49df59dfb7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(notEqual(bvec2(c), bvec2(true)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag
new file mode 100644
index 0000000000..b436a76ce2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 ne(in bvec2 a, in bvec2 b)
+{
+ bvec2 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(ne(bvec2(c), bvec2(true)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert
new file mode 100644
index 0000000000..974111cdad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(notEqual(bvec2(c), bvec2(true)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert
new file mode 100644
index 0000000000..022d3b2186
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 ne(in bvec2 a, in bvec2 b)
+{
+ bvec2 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(1.5 * gtf_Color.rg); // 1/3 true, 2/3 false
+ vec2 result = vec2(ne(bvec2(c), bvec2(true)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag
new file mode 100644
index 0000000000..ee17b824a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(notEqual(bvec3(c), bvec3(true)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag
new file mode 100644
index 0000000000..86607e8449
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 ne(in bvec3 a, in bvec3 b)
+{
+ bvec3 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] != b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(ne(bvec3(c), bvec3(true)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert
new file mode 100644
index 0000000000..beed0319b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(notEqual(bvec3(c), bvec3(true)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert
new file mode 100644
index 0000000000..0a9a60b77b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_bvec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 ne(in bvec3 a, in bvec3 b)
+{
+ bvec3 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] != b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(1.5 * gtf_Color.rgb); // 1/3 true, 2/3 false
+ vec3 result = vec3(ne(bvec3(c), bvec3(true)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag
new file mode 100644
index 0000000000..f996de0530
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(notEqual(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag
new file mode 100644
index 0000000000..9c15d3941b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_frag_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec2 ne(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(ne(ivec2(c), ivec2(0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert
new file mode 100644
index 0000000000..7305ff1599
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(notEqual(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert
new file mode 100644
index 0000000000..824b870db8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 ne(in ivec2 a, in ivec2 b)
+{
+ bvec2 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(ne(ivec2(c), ivec2(0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag
new file mode 100644
index 0000000000..48ada5f7b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(notEqual(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag
new file mode 100644
index 0000000000..4401b1d798
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 ne(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] != b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(ne(ivec3(c), ivec3(0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert
new file mode 100644
index 0000000000..4aa2e34cc2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(notEqual(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert
new file mode 100644
index 0000000000..eb07abcf64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_ivec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 ne(in ivec3 a, in ivec3 b)
+{
+ bvec3 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] != b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(ne(ivec3(c), ivec3(0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag
new file mode 100644
index 0000000000..ab1b496119
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(notEqual(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag
new file mode 100644
index 0000000000..71320e67c1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_frag_ref.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#ifdef GL_FRAGMENT_PRECISION_HIGH
+precision highp float;
+#else
+precision mediump float;
+#endif
+#endif
+varying vec4 color;
+
+bvec2 ne(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(ne(c, vec2(0.0)));
+ gl_FragColor = vec4(result, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert
new file mode 100644
index 0000000000..c7931c787b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(notEqual(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert
new file mode 100644
index 0000000000..1892d3ad89
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec2_vert_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec2 ne(in vec2 a, in vec2 b)
+{
+ bvec2 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec2 c = floor(10.0 * gtf_Color.rg - 4.5); // round to the nearest integer
+ vec2 result = vec2(ne(c, vec2(0.0)));
+ color = vec4(result, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag
new file mode 100644
index 0000000000..fe7d7a1153
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(notEqual(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag
new file mode 100644
index 0000000000..8a18ea0327
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_frag_ref.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+bvec3 ne(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] != b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(ne(c, vec3(0.0)));
+ gl_FragColor = vec4(result, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert
new file mode 100644
index 0000000000..a97081973a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(notEqual(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert
new file mode 100644
index 0000000000..a6c5687e24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/notEqual/notEqual_vec3_vert_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+bvec3 ne(in vec3 a, in vec3 b)
+{
+ bvec3 result;
+ if(a[0] != b[0]) result[0] = true;
+ else result[0] = false;
+ if(a[1] != b[1]) result[1] = true;
+ else result[1] = false;
+ if(a[2] != b[2]) result[2] = true;
+ else result[2] = false;
+ return result;
+}
+
+void main (void)
+{
+ vec3 c = floor(10.0 * gtf_Color.rgb - 4.5); // round to the nearest integer
+ vec3 result = vec3(ne(c, vec3(0.0)));
+ color = vec4(result, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag
new file mode 100644
index 0000000000..e6b6950392
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_frag.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ int resultadd = m + k;
+ int resultsubtract = m - k;
+ float gray;
+ if( ( resultadd == 114 ) && ( resultsubtract == 90 ) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert
new file mode 100644
index 0000000000..fc2b8ca837
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/addsubtract_vert.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ int resultadd = m + k;
+ int resultsubtract = m - k;
+ float gray;
+ if( ( resultadd == 114 ) && ( resultsubtract == 90 ) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag
new file mode 100644
index 0000000000..07757a8733
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_frag.frag
@@ -0,0 +1,61 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 12;
+ int n = 102;
+ bool result = true;
+ int r = m;
+
+ if( r==12 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r += m;
+
+ if( r == 24 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r-= m;
+
+ if( r == 12 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r*= m;
+
+ if ( r == 144 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r/= m;
+
+ // Integer divide can be implemented via float reciprocal,
+ // so the result need not be exact
+ if( r >= 11 && r <= 13 )
+ result = result && true;
+ else
+ result = result && false;
+
+ float gray;
+ if( result )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert
new file mode 100644
index 0000000000..4ce8bea9b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/assignments_vert.vert
@@ -0,0 +1,61 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m = 12;
+ int n = 102;
+ bool result = true;
+ int r = m;
+
+ if( r==12 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r += m;
+
+ if( r == 24 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r-= m;
+
+ if( r == 12 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r*= m;
+
+ if ( r == 144 )
+ result = result && true;
+ else
+ result = result && false;
+
+ r/= m;
+
+ // Integer divide can be implemented via float reciprocal,
+ // so the result need not be exact
+ if( r >= 11 && r <= 13 )
+ result = result && true;
+ else
+ result = result && false;
+
+ float gray;
+ if( result )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag
new file mode 100644
index 0000000000..e46ca4ea9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_frag.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ int result = m/k;
+ float gray;
+ // The rounding mode for integer divide is implementation-dependent
+ if( ( result == 8 ) || ( result == 9 ) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert
new file mode 100644
index 0000000000..a3c2d39bf4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/division_vert.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ int result = m/k;
+ float gray;
+ // The rounding mode for integer divide is implementation-dependent
+ if( ( result == 8 ) || ( result == 9 ) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag
new file mode 100644
index 0000000000..03bd0024a5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ bool equalto = (m == 102);
+ bool notequalto = (k != 102);
+
+ float gray;
+ if( equalto && notequalto )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert
new file mode 100644
index 0000000000..f33596562a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/equality_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ bool equalto = (m == 102);
+ bool notequalto = (k != 102);
+
+ float gray;
+ if( equalto && notequalto )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt
new file mode 100644
index 0000000000..b6e176588b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/input.run.txt
@@ -0,0 +1,5 @@
+# this file is auto-generated. DO NOT EDIT.
+operators_001_to_008.html
+operators_009_to_016.html
+operators_017_to_024.html
+operators_025_to_026.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag
new file mode 100644
index 0000000000..c6749092d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_frag.frag
@@ -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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+bool result = true;
+ bool a = true;
+ bool b = true;
+
+ if( (a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( !(a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ a = true;
+ b = false;
+
+ if( !(a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ a = false;
+ b = true;
+
+ if( !(a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ a = false;
+ b = false;
+
+ if( !(a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( !(a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( !(a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ float gray;
+ if( result )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert
new file mode 100644
index 0000000000..1d5deb2c92
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/logical_vert.vert
@@ -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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ bool result = true;
+ bool a = true;
+ bool b = true;
+
+ if( (a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( !(a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ a = true;
+ b = false;
+
+ if( !(a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ a = false;
+ b = true;
+
+ if( !(a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( (a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ a = false;
+ b = false;
+
+ if( !(a&&b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( !(a||b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ if( !(a^^b) )
+ result = result && true;
+ else
+ result = result && false;
+
+ float gray;
+ if( result )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag
new file mode 100644
index 0000000000..9c1b56acb6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ int result = m*k;
+ float gray;
+ if( ( result == 1224 ) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert
new file mode 100644
index 0000000000..a2146c8016
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/multiplicative_vert.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ int result = m*k;
+ float gray;
+ if( ( result == 1224 ) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html
new file mode 100644
index 0000000000..01f0a0d408
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_001_to_008.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: operators_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "postfixincrement_frag.frag"
+ },
+ "name": "postfixincrement_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "postfixincrement_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "postfixincrement_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "postfixdecrement_frag.frag"
+ },
+ "name": "postfixdecrement_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "postfixdecrement_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "postfixdecrement_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "prefixincrement_frag.frag"
+ },
+ "name": "prefixincrement_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "prefixincrement_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "prefixincrement_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "prefixdecrement_frag.frag"
+ },
+ "name": "prefixdecrement_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "prefixdecrement_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "prefixdecrement_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html
new file mode 100644
index 0000000000..247592ce6d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_009_to_016.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: operators_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "unary_frag.frag"
+ },
+ "name": "unary_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "unary_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "unary_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "multiplicative_frag.frag"
+ },
+ "name": "multiplicative_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "multiplicative_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "multiplicative_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "division_frag.frag"
+ },
+ "name": "division_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "division_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "division_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "addsubtract_frag.frag"
+ },
+ "name": "addsubtract_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "addsubtract_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "addsubtract_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html
new file mode 100644
index 0000000000..c9ee23c3c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_017_to_024.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: operators_017_to_024.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "relational_frag.frag"
+ },
+ "name": "relational_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "relational_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "relational_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "equality_frag.frag"
+ },
+ "name": "equality_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "equality_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "equality_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "logical_frag.frag"
+ },
+ "name": "logical_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "logical_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "logical_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "selection_frag.frag"
+ },
+ "name": "selection_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "selection_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "selection_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html
new file mode 100644
index 0000000000..20329db2eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/operators_025_to_026.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: operators_025_to_026.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "assignments_frag.frag"
+ },
+ "name": "assignments_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "assignments_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "assignments_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag
new file mode 100644
index 0000000000..67b5cb4274
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 23;
+ int k = m--;
+ float gray;
+ if( ( k == 23 ) && ( m == 22 ) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert
new file mode 100644
index 0000000000..02f39bed10
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixdecrement_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m=23;
+ int k = m--;
+ float gray;
+ if( (k==23) && (m==22) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag
new file mode 100644
index 0000000000..4d81f908c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 23;
+ int k = m++;
+ float gray;
+ if( ( k == 23 ) && ( m == 24 ) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert
new file mode 100644
index 0000000000..4b074f1e91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/postfixincrement_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m=23;
+ int k = m++;
+ float gray;
+ if( (k==23) && (m==24) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag
new file mode 100644
index 0000000000..fa558e2944
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 23;
+ int k = --m;
+ float gray;
+ if( ( k == 22 ) && ( m == 22 ) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert
new file mode 100644
index 0000000000..2c2b7f18db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixdecrement_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m=23;
+ int k = --m;
+ float gray;
+ if( (k==22) && (m==22) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag
new file mode 100644
index 0000000000..2369cd0e26
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 23;
+ int k = ++m;
+ float gray;
+ if( ( k == 24 ) && ( m == 24 ) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert
new file mode 100644
index 0000000000..5cf4494b59
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/prefixincrement_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m=23;
+ int k = ++m;
+ float gray;
+ if( (k==24) && (m==24) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag
new file mode 100644
index 0000000000..015633727e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_frag.frag
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ bool lessthan = (m<k);
+ bool greaterthan = (m>k);
+ bool lessthanorequalto = (m <= 102);
+ bool greaterthanorequalto = (k >=12);
+ float gray;
+ if( !lessthan && greaterthan && lessthanorequalto && greaterthanorequalto )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert
new file mode 100644
index 0000000000..99a58b1414
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/relational_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m = 102;
+ int k = 12;
+ bool lessthan = (m<k);
+ bool greaterthan = (m>k);
+ bool lessthanorequalto = (m <= 102);
+ bool greaterthanorequalto = (k >=12);
+
+ float gray;
+ if( !lessthan && greaterthan && lessthanorequalto && greaterthanorequalto )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag
new file mode 100644
index 0000000000..c69f56b7c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_frag.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int j = 30;
+ int k = 37;
+ int y = 10;
+ int n = 12;
+ bool result1 = false;
+ bool result2 = false;
+ (j>k)?( result1 = true ):( result1 = false );
+ (y<n)?( result2 = true ):( result2 = false );
+ float gray;
+ if( !result1 && result2 )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_vert.vert
new file mode 100644
index 0000000000..bf038a1bc7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/selection_vert.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int j = 30;
+ int k = 37;
+ int y = 10;
+ int n = 12;
+ bool result1 = false;
+ bool result2 = false;
+ (j>k)?( result1 = true ):( result1 = false );
+ (y<n)?( result2 = true ):( result2 = false );
+ float gray;
+ if( !result1 && result2 )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_frag.frag
new file mode 100644
index 0000000000..6a59b278e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_frag.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ int m = +23;
+ int k = -m;
+ bool a = false;
+ bool b = !a;
+ float gray;
+ if( (m==23) && (k==-23) && (b) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_vert.vert
new file mode 100644
index 0000000000..0b10409794
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/operators/unary_vert.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ int m = +23;
+ int k = -m;
+ bool a = false;
+ bool b = !a;
+ float gray;
+ if( (m==23) && (k==-23) && (b) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/input.run.txt
new file mode 100644
index 0000000000..c9bfeda779
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/input.run.txt
@@ -0,0 +1,4 @@
+# this file is auto-generated. DO NOT EDIT.
+pow_001_to_008.html
+pow_009_to_016.html
+pow_017_to_024.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_001_to_008.html
new file mode 100644
index 0000000000..ce0d5901db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: pow_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xvary_yconst2_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xvary_yconst2.frag"
+ },
+ "name": "pow_float_frag_xvary_yconst2.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xvary_yconst2_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xvary_yconst2.frag"
+ },
+ "name": "pow_vec2_frag_xvary_yconst2.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xvary_yconst2_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xvary_yconst2.frag"
+ },
+ "name": "pow_vec3_frag_xvary_yconst2.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xconst2_yvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xconst2_yvary.frag"
+ },
+ "name": "pow_float_frag_xconst2_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xconst2_yvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xconst2_yvary.frag"
+ },
+ "name": "pow_vec2_frag_xconst2_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xconst2_yvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xconst2_yvary.frag"
+ },
+ "name": "pow_vec3_frag_xconst2_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xvary_yconsthalf.frag"
+ },
+ "name": "pow_float_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xvary_yconsthalf.frag"
+ },
+ "name": "pow_vec2_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html
new file mode 100644
index 0000000000..7eb6d3d008
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_009_to_016.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: pow_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xvary_yconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xvary_yconsthalf.frag"
+ },
+ "name": "pow_vec3_frag_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xconsthalf_yvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_float_frag_xconsthalf_yvary.frag"
+ },
+ "name": "pow_float_frag_xconsthalf_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xconsthalf_yvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec2_frag_xconsthalf_yvary.frag"
+ },
+ "name": "pow_vec2_frag_xconsthalf_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xconsthalf_yvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "pow_vec3_frag_xconsthalf_yvary.frag"
+ },
+ "name": "pow_vec3_frag_xconsthalf_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_float_vert_xvary_yconst2_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_float_vert_xvary_yconst2.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_float_vert_xvary_yconst2.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec2_vert_xvary_yconst2_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec2_vert_xvary_yconst2.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec2_vert_xvary_yconst2.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec3_vert_xvary_yconst2_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec3_vert_xvary_yconst2.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec3_vert_xvary_yconst2.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_float_vert_xconst2_yvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_float_vert_xconst2_yvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_float_vert_xconst2_yvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html
new file mode 100644
index 0000000000..1c7a0ca3e5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_017_to_024.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: pow_017_to_024.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec2_vert_xconst2_yvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec2_vert_xconst2_yvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec2_vert_xconst2_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec3_vert_xconst2_yvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec3_vert_xconst2_yvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec3_vert_xconst2_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_float_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_float_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_float_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec2_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec2_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec2_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec3_vert_xvary_yconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec3_vert_xvary_yconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec3_vert_xvary_yconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_float_vert_xconsthalf_yvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_float_vert_xconsthalf_yvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_float_vert_xconsthalf_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec2_vert_xconsthalf_yvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec2_vert_xconsthalf_yvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec2_vert_xconsthalf_yvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "pow_vec3_vert_xconsthalf_yvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "pow_vec3_vert_xconsthalf_yvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "pow_vec3_vert_xconsthalf_yvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag
new file mode 100644
index 0000000000..5483af5014
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(pow(2.0, 2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag
new file mode 100644
index 0000000000..41ab8fee37
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconst2_yvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag
new file mode 100644
index 0000000000..fa48023b3c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(pow(0.5, 2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag
new file mode 100644
index 0000000000..e21d8ff815
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xconsthalf_yvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = -2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag
new file mode 100644
index 0000000000..e3b91e98f7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 4.0 * (color.r);
+ gl_FragColor = vec4(pow(c, 2.0) / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag
new file mode 100644
index 0000000000..cfb2a0cf74
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconst2_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 4.0 * (color.r);
+ gl_FragColor = vec4(c * c / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..6aea7b50cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 16.0 * color.r;
+ gl_FragColor = vec4(pow(c, 0.5) / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..871b1b722b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 16.0 * color.r;
+ gl_FragColor = vec4(sqrt(c) / 4.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert
new file mode 100644
index 0000000000..c8c54ebb73
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(pow(2.0, 2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert
new file mode 100644
index 0000000000..9dfba0f5b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconst2_yvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert
new file mode 100644
index 0000000000..34b0ffc3c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(pow(0.5, 2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert
new file mode 100644
index 0000000000..e3c71fe606
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xconsthalf_yvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = -2.0 * (gtf_Color.r - 0.5);
+ color = vec4(exp2(2.0 * c) / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert
new file mode 100644
index 0000000000..417da137ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 4.0 * (gtf_Color.r);
+ color = vec4(pow(c, 2.0) / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert
new file mode 100644
index 0000000000..a4aea47dd4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconst2_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 4.0 * (gtf_Color.r);
+ color = vec4(c * c / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..c5dde20ee3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 16.0 * gtf_Color.r;
+ color = vec4(pow(c, 0.5) / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..cd892b69d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_float_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 16.0 * gtf_Color.r;
+ color = vec4(sqrt(c) / 4.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag
new file mode 100644
index 0000000000..c6186399c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(pow(vec2(2.0), 2.0 * c) / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag
new file mode 100644
index 0000000000..78afa91058
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconst2_yvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag
new file mode 100644
index 0000000000..61de4a7c81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(pow(vec2(0.5), 2.0 * c) / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag
new file mode 100644
index 0000000000..9b51524d9c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xconsthalf_yvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = -2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag
new file mode 100644
index 0000000000..8b2b2d2dea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 4.0 * (color.rg);
+ gl_FragColor = vec4(pow(c, vec2(2.0)) / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag
new file mode 100644
index 0000000000..bb55c7789d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconst2_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 4.0 * (color.rg);
+ gl_FragColor = vec4(c * c / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..13d18c46eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 16.0 * color.rg;
+ gl_FragColor = vec4(pow(c, vec2(0.5)) / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..558b7c32f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 16.0 * color.rg;
+ gl_FragColor = vec4(sqrt(c) / 4.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert
new file mode 100644
index 0000000000..981673e5b6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(pow(vec2(2.0), 2.0 * c) / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert
new file mode 100644
index 0000000000..f3e95dc4a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconst2_yvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert
new file mode 100644
index 0000000000..e2a3a51a08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(pow(vec2(0.5), 2.0 * c) / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert
new file mode 100644
index 0000000000..2d76b7689e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xconsthalf_yvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = -2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(exp2(2.0 * c) / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert
new file mode 100644
index 0000000000..f7d2c22907
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 4.0 * (gtf_Color.rg);
+ color = vec4(pow(c, vec2(2.0)) / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert
new file mode 100644
index 0000000000..05968e48b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconst2_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 4.0 * (gtf_Color.rg);
+ color = vec4(c * c / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..96bd4f2bd6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 16.0 * gtf_Color.rg;
+ color = vec4(pow(c, vec2(0.5)) / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..8830c4e9a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec2_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 16.0 * gtf_Color.rg;
+ color = vec4(sqrt(c) / 4.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag
new file mode 100644
index 0000000000..8d0e893f0a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(pow(vec3(2.0), 2.0 * c) / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag
new file mode 100644
index 0000000000..f037a62bc2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconst2_yvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag
new file mode 100644
index 0000000000..991c9b804d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(pow(vec3(0.5), 2.0 * c) / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag
new file mode 100644
index 0000000000..56a18afdba
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xconsthalf_yvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = -2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(exp2(2.0 * c) / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag
new file mode 100644
index 0000000000..a54698468b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(pow(c, vec3(2.0)) / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag
new file mode 100644
index 0000000000..9b63625665
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconst2_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = color.rgb;
+ gl_FragColor = vec4(c * c / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag
new file mode 100644
index 0000000000..cd057ed727
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 16.0 * color.rgb;
+ gl_FragColor = vec4(pow(c, vec3(0.5)) / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag
new file mode 100644
index 0000000000..d9aadd9fb6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_frag_xvary_yconsthalf_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 16.0 * color.rgb;
+ gl_FragColor = vec4(sqrt(c) / 4.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert
new file mode 100644
index 0000000000..beda501bb7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(pow(vec3(2.0), 2.0 * c) / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert
new file mode 100644
index 0000000000..5b4377d889
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconst2_yvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(exp2(2.0 * c) / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert
new file mode 100644
index 0000000000..69dfa29e46
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(pow(vec3(0.5), 2.0 * c) / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert
new file mode 100644
index 0000000000..cdc33face5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xconsthalf_yvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = -2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(exp2(2.0 * c) / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert
new file mode 100644
index 0000000000..567bab0ffe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 4.0 * (gtf_Color.rgb);
+ color = vec4(pow(c, vec3(2.0)) / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert
new file mode 100644
index 0000000000..d49c633e5a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconst2_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 4.0 * (gtf_Color.rgb);
+ color = vec4(c * c / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert
new file mode 100644
index 0000000000..1b318d99db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 16.0 * gtf_Color.rgb;
+ color = vec4(pow(c, vec3(0.5)) / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert
new file mode 100644
index 0000000000..5577b7ce72
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/pow/pow_vec3_vert_xvary_yconsthalf_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 16.0 * gtf_Color.rgb;
+ color = vec4(sqrt(c) / 4.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt
new file mode 100644
index 0000000000..891a82745f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+radians_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html
new file mode 100644
index 0000000000..fbdbf593e7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: radians_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "radians_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "radians_float_frag_xvary.frag"
+ },
+ "name": "radians_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "radians_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "radians_vec2_frag_xvary.frag"
+ },
+ "name": "radians_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "radians_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "radians_vec3_frag_xvary.frag"
+ },
+ "name": "radians_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "radians_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "radians_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "radians_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "radians_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "radians_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "radians_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "radians_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "radians_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "radians_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag
new file mode 100644
index 0000000000..4f878f3409
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 360.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..9b84f2601d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 360.0 * 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert
new file mode 100644
index 0000000000..d64ea1c2d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 360.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..18197e13da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_float_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 360.0 * 2.0 * (gtf_Color.r - 0.5);
+ color = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..5f9f2c34c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 360.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..8c4c033dd3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 360.0 * 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..a894ab318a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 360.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(radians(c) / (4.0 * M_PI) + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..807b66d408
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec2_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 360.0 * 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..dd6983c72a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 360.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(radians(c) / (4.0 * M_PI) + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..ec834496f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_frag_xvary_ref.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 360.0 * 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..b1b46bff50
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 360.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(radians(c) / (4.0 * M_PI) + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..1003e32af6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/radians/radians_vec3_vert_xvary_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 360.0 * 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4((c * M_PI / 180.0) / (4.0 * M_PI) + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt
new file mode 100644
index 0000000000..b32c960e6c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+reflect_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html
new file mode 100644
index 0000000000..95273c41bf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: reflect_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "reflect_float_frag_ivarynconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "reflect_float_frag_ivarynconst.frag"
+ },
+ "name": "reflect_float_frag_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "reflect_float_vert_ivarynconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "reflect_float_vert_ivarynconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "reflect_float_vert_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "reflect_vec2_frag_ivarynconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "reflect_vec2_frag_ivarynconst.frag"
+ },
+ "name": "reflect_vec2_frag_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "reflect_vec2_vert_ivarynconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "reflect_vec2_vert_ivarynconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "reflect_vec2_vert_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "reflect_vec3_frag_ivarynconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "reflect_vec3_frag_ivarynconst.frag"
+ },
+ "name": "reflect_vec3_frag_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "reflect_vec3_vert_ivarynconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "reflect_vec3_vert_ivarynconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "reflect_vec3_vert_ivarynconst.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag
new file mode 100644
index 0000000000..33a20805ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (color.g + 1.0) / 2.0;
+ float v2 = (color.b + 1.0) / 2.0;
+
+ gl_FragColor = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag
new file mode 100644
index 0000000000..066c91bd24
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_frag_ivarynconst_ref.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (color.g + 1.0) / 2.0;
+ float v2 = (color.b + 1.0) / 2.0;
+
+ gl_FragColor = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert
new file mode 100644
index 0000000000..ecfc76140c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (gtf_Color.g + 1.0) / 2.0;
+ float v2 = (gtf_Color.b + 1.0) / 2.0;
+
+ color = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert
new file mode 100644
index 0000000000..d9b9908636
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_float_vert_ivarynconst_ref.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (gtf_Color.g + 1.0) / 2.0;
+ float v2 = (gtf_Color.b + 1.0) / 2.0;
+
+ color = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag
new file mode 100644
index 0000000000..1e852dd7f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ gl_FragColor = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag
new file mode 100644
index 0000000000..2a832a62e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_frag_ivarynconst_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ gl_FragColor = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert
new file mode 100644
index 0000000000..644024fec8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ color = vec4((reflect(v1, v2) + 1.0) / 2.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert
new file mode 100644
index 0000000000..a333ed5da0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec2_vert_ivarynconst_ref.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ color = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag
new file mode 100644
index 0000000000..776dbcaedb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ gl_FragColor = vec4((reflect(v1, v2) + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag
new file mode 100644
index 0000000000..fd741cd29b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_frag_ivarynconst_ref.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ gl_FragColor = vec4((v1 - 2.0 * dot(v2, v1) * v2 + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert
new file mode 100644
index 0000000000..43913886ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ color = vec4((reflect(v1, v2) + 1.0) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert
new file mode 100644
index 0000000000..8cdbc8a7bd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/reflect/reflect_vec3_vert_ivarynconst_ref.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ color = vec4((v1 - 2.0 * dot(v2, v1) * v2 + vec3(1.0)) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt
new file mode 100644
index 0000000000..c7deedd54c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+refract_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html
new file mode 100644
index 0000000000..333ec6943c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: refract_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "refract_float_frag_ivarynconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "refract_float_frag_ivarynconst.frag"
+ },
+ "name": "refract_float_frag_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "refract_float_vert_ivarynconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "refract_float_vert_ivarynconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "refract_float_vert_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "refract_vec2_frag_ivarynconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "refract_vec2_frag_ivarynconst.frag"
+ },
+ "name": "refract_vec2_frag_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "refract_vec2_vert_ivarynconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "refract_vec2_vert_ivarynconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "refract_vec2_vert_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "refract_vec3_frag_ivarynconst_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "refract_vec3_frag_ivarynconst.frag"
+ },
+ "name": "refract_vec3_frag_ivarynconst.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "refract_vec3_vert_ivarynconst_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "refract_vec3_vert_ivarynconst.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "refract_vec3_vert_ivarynconst.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag
new file mode 100644
index 0000000000..1a271b0ba5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (color.g + 1.0) / 2.0;
+ float v2 = (color.b + 1.0) / 2.0;
+
+ gl_FragColor = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag
new file mode 100644
index 0000000000..dec5f10dc1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_frag_ivarynconst_ref.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ // Both are unit vectors
+ float v1 = (color.g + 1.0) / 2.0;
+ float v2 = (color.b + 1.0) / 2.0;
+
+ float result;
+ float eta = 0.5;
+ float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2));
+ if(k < 0.0)
+ result = 0.0;
+ else
+ result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2;
+
+ gl_FragColor = vec4((result + 1.0) / 2.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert
new file mode 100644
index 0000000000..3abae8b31c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ // Both are unit vectors
+ float v1 = (gtf_Color.g + 1.0) / 2.0;
+ float v2 = (gtf_Color.b + 1.0) / 2.0;
+
+ color = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert
new file mode 100644
index 0000000000..4adc177cf5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_float_vert_ivarynconst_ref.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ float v1 = (gtf_Color.g + 1.0) / 2.0;
+ float v2 = (gtf_Color.b + 1.0) / 2.0;
+
+ float result;
+ float eta = 0.5;
+ float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2));
+ if(k < 0.0)
+ result = 0.0;
+ else
+ result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2;
+
+ color = vec4((result + 1.0) / 2.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag
new file mode 100644
index 0000000000..3205e8fe2f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ gl_FragColor = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag
new file mode 100644
index 0000000000..480191c477
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_frag_ivarynconst_ref.frag
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ vec2 result;
+ float eta = 0.5;
+ float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2));
+ if(k < 0.0)
+ result = vec2(0.0);
+ else
+ result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2;
+
+ gl_FragColor = vec4((result + 1.0) / 2.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert
new file mode 100644
index 0000000000..0c5fe5053a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst.vert
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ color = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert
new file mode 100644
index 0000000000..5902cea9b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec2_vert_ivarynconst_ref.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec2 v1;
+ vec2 v2 = normalize(vec2(1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+
+ vec2 result;
+ float eta = 0.5;
+ float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2));
+ if(k < 0.0)
+ result = vec2(0.0);
+ else
+ result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2;
+
+ color = vec4((result + 1.0) / 2.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag
new file mode 100644
index 0000000000..90df8fd8aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ gl_FragColor = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag
new file mode 100644
index 0000000000..00064a2b79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_frag_ivarynconst_ref.frag
@@ -0,0 +1,38 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+
+ float theta = color.g * 2.0 * M_PI;
+ float phi = color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ vec3 result;
+ float eta = 0.5;
+ float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2));
+ if(k < 0.0)
+ result = vec3(0.0);
+ else
+ result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2;
+
+ gl_FragColor = vec4((result + 1.0) / 2.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert
new file mode 100644
index 0000000000..29b38d23f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ color = vec4((refract(v1, v2, 0.5) + 1.0) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert
new file mode 100644
index 0000000000..5d1872fa74
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/refract/refract_vec3_vert_ivarynconst_ref.vert
@@ -0,0 +1,38 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+
+ // Both are unit vectors
+ vec3 v1;
+ vec3 v2 = normalize(vec3(1.0, 1.0, 1.0));
+
+ float theta = gtf_Color.g * 2.0 * M_PI;
+ float phi = gtf_Color.b * 2.0 * M_PI;
+ v1.x = cos(theta) * sin(phi);
+ v1.y = sin(theta) * sin(phi);
+ v1.z = cos(phi);
+
+ vec3 result;
+ float eta = 0.5;
+ float k = 1.0 - eta * eta * (1.0 - dot(v1, v2) * dot(v1, v2));
+ if(k < 0.0)
+ result = vec3(0.0);
+ else
+ result = eta * v1 - (eta * dot(v1, v2) + sqrt(k)) * v2;
+
+ color = vec4((result + 1.0) / 2.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt
new file mode 100644
index 0000000000..b22bf9d68e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+sign_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html
new file mode 100644
index 0000000000..ff486de206
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: sign_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sign_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sign_float_frag_xvary.frag"
+ },
+ "name": "sign_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sign_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sign_vec2_frag_xvary.frag"
+ },
+ "name": "sign_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sign_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sign_vec3_frag_xvary.frag"
+ },
+ "name": "sign_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sign_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sign_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sign_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sign_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sign_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sign_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sign_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sign_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sign_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag
new file mode 100644
index 0000000000..8532d11a07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (color.r - 0.5);
+ gl_FragColor = vec4(c * sign(c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..d670310ac4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_frag_xvary_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (color.r - 0.5);
+ if(c > 0.0) c = 1.0 * c;
+ if(c < 0.0) c = -1.0 * c;
+
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert
new file mode 100644
index 0000000000..dbc85e3d6a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ color = vec4(c * sign(c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..81bd9e70cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_float_vert_xvary_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 2.0 * (gtf_Color.r - 0.5);
+ if(c > 0.0) c = 1.0 * c;
+ if(c < 0.0) c = -1.0 * c;
+
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..bc98bc6395
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (color.rg - 0.5);
+ gl_FragColor = vec4(c * sign(c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..b352db6400
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_frag_xvary_ref.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (color.rg - 0.5);
+ if(c[0] > 0.0) c[0] = 1.0 * c[0];
+ if(c[0] < 0.0) c[0] = -1.0 * c[0];
+ if(c[1] > 0.0) c[1] = 1.0 * c[1];
+ if(c[1] < 0.0) c[1] = -1.0 * c[1];
+
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..54572fb4c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ color = vec4(c * sign(c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..14706e2498
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec2_vert_xvary_ref.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 2.0 * (gtf_Color.rg - 0.5);
+ if(c[0] > 0.0) c[0] = 1.0 * c[0];
+ if(c[0] < 0.0) c[0] = -1.0 * c[0];
+ if(c[1] > 0.0) c[1] = 1.0 * c[1];
+ if(c[1] < 0.0) c[1] = -1.0 * c[1];
+
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..0ba38a1596
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (color.rgb - 0.5);
+ gl_FragColor = vec4(c * (sign(c)), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..1097bac9a2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_frag_xvary_ref.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (color.rgb - 0.5);
+
+ if(c[0] > 0.0) c[0] = 1.0 * c[0];
+ if(c[0] < 0.0) c[0] = -1.0 * c[0];
+ if(c[1] > 0.0) c[1] = 1.0 * c[1];
+ if(c[1] < 0.0) c[1] = -1.0 * c[1];
+ if(c[2] > 0.0) c[2] = 1.0 * c[2];
+ if(c[2] < 0.0) c[2] = -1.0 * c[2];
+
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..a6dec9a51f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+ color = vec4(c * sign(c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..98bdc7fac9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sign/sign_vec3_vert_xvary_ref.vert
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 2.0 * (gtf_Color.rgb - 0.5);
+
+ if(c[0] > 0.0) c[0] = 1.0 * c[0];
+ if(c[0] < 0.0) c[0] = -1.0 * c[0];
+ if(c[1] > 0.0) c[1] = 1.0 * c[1];
+ if(c[1] < 0.0) c[1] = -1.0 * c[1];
+ if(c[2] > 0.0) c[2] = 1.0 * c[2];
+ if(c[2] < 0.0) c[2] = -1.0 * c[2];
+
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt
new file mode 100644
index 0000000000..2995c56588
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+sin_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html
new file mode 100644
index 0000000000..16e5039800
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: sin_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sin_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sin_float_frag_xvary.frag"
+ },
+ "name": "sin_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sin_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sin_vec2_frag_xvary.frag"
+ },
+ "name": "sin_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sin_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sin_vec3_frag_xvary.frag"
+ },
+ "name": "sin_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sin_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sin_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sin_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sin_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sin_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sin_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sin_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sin_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sin_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag
new file mode 100644
index 0000000000..d3eb4c8702
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ gl_FragColor = vec4(0.5 * sin(2.0 * M_PI * color.r) + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..b8f6613004
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_frag_xvary_ref.frag
@@ -0,0 +1,84 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float sinValues[17];
+ sinValues[0] = 0.0;
+ sinValues[1] = 0.382683;
+ sinValues[2] = 0.707107;
+ sinValues[3] = 0.92388;
+ sinValues[4] = 1.0;
+ sinValues[5] = 0.92388;
+ sinValues[6] = 0.707107;
+ sinValues[7] = 0.382683;
+ sinValues[8] = 0.0;
+ sinValues[9] = -0.382683;
+ sinValues[10] = -0.707107;
+ sinValues[11] = -0.92388;
+ sinValues[12] = -1.0;
+ sinValues[13] = -0.923879;
+ sinValues[14] = -0.707107;
+ sinValues[15] = -0.382683;
+ sinValues[16] = 0.0;
+
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * color.r;
+
+ float arrVal = c * 2.546478971;
+ int arr0 = int(floor(arrVal));
+ float weight = arrVal - floor(arrVal);
+ float sin_c = 0.0;
+
+ if (arr0 == 0)
+ sin_c = lerp(sinValues[0], sinValues[1], weight);
+ else if (arr0 == 1)
+ sin_c = lerp(sinValues[1], sinValues[2], weight);
+ else if (arr0 == 2)
+ sin_c = lerp(sinValues[2], sinValues[3], weight);
+ else if (arr0 == 3)
+ sin_c = lerp(sinValues[3], sinValues[4], weight);
+ else if (arr0 == 4)
+ sin_c = lerp(sinValues[4], sinValues[5], weight);
+ else if (arr0 == 5)
+ sin_c = lerp(sinValues[5], sinValues[6], weight);
+ else if (arr0 == 6)
+ sin_c = lerp(sinValues[6], sinValues[7], weight);
+ else if (arr0 == 7)
+ sin_c = lerp(sinValues[7], sinValues[8], weight);
+ else if (arr0 == 8)
+ sin_c = lerp(sinValues[8], sinValues[9], weight);
+ else if (arr0 == 9)
+ sin_c = lerp(sinValues[9], sinValues[10], weight);
+ else if (arr0 == 10)
+ sin_c = lerp(sinValues[10], sinValues[11], weight);
+ else if (arr0 == 11)
+ sin_c = lerp(sinValues[11], sinValues[12], weight);
+ else if (arr0 == 12)
+ sin_c = lerp(sinValues[12], sinValues[13], weight);
+ else if (arr0 == 13)
+ sin_c = lerp(sinValues[13], sinValues[14], weight);
+ else if (arr0 == 14)
+ sin_c = lerp(sinValues[14], sinValues[15], weight);
+ else if (arr0 == 15)
+ sin_c = lerp(sinValues[15], sinValues[16], weight);
+ else if (arr0 == 16)
+ sin_c = sinValues[16];
+
+ gl_FragColor = vec4(0.5 * sin_c + 0.5, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert
new file mode 100644
index 0000000000..fe39395cce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ color = vec4(0.5 * sin(2.0 * M_PI * gtf_Color.r) + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..68292455db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_float_vert_xvary_ref.vert
@@ -0,0 +1,38 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 2.0 * M_PI * gtf_Color.r;
+ float sign = 1.0;
+
+ float sin_c = 0.0;
+ float fact;
+ float fact_of;
+
+ // Taylors series expansion for sin
+ for(int i = 0; i < 12; i++)
+ {
+ fact = 1.0;
+ for(int j = 2; j <= 23; j++)
+ if (j <= 2 * i + 1)
+ fact *= float(j);
+
+ sin_c += sign * pow(c, 2.0 * float(i) + 1.0) / fact;
+ sign *= -1.0;
+ }
+
+ color = vec4(0.5 * sin_c + 0.5, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..efb9c543b4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ gl_FragColor = vec4(0.5 * sin(2.0 * M_PI * color.rg) + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..504e8b98b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_frag_xvary_ref.frag
@@ -0,0 +1,120 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float sinValues[17];
+ sinValues[0] = 0.0;
+ sinValues[1] = 0.382683;
+ sinValues[2] = 0.707107;
+ sinValues[3] = 0.92388;
+ sinValues[4] = 1.0;
+ sinValues[5] = 0.92388;
+ sinValues[6] = 0.707107;
+ sinValues[7] = 0.382683;
+ sinValues[8] = 0.0;
+ sinValues[9] = -0.382683;
+ sinValues[10] = -0.707107;
+ sinValues[11] = -0.92388;
+ sinValues[12] = -1.0;
+ sinValues[13] = -0.923879;
+ sinValues[14] = -0.707107;
+ sinValues[15] = -0.382683;
+ sinValues[16] = 0.0;
+
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * color.rg;
+
+ vec2 arrVal = c * 2.546478971;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ vec2 weight = arrVal - floor(arrVal);
+ vec2 sin_c = vec2(0.0, 0.0);
+
+ if (arr0x == 0)
+ sin_c.x = lerp(sinValues[0], sinValues[1], weight.x);
+ else if (arr0x == 1)
+ sin_c.x = lerp(sinValues[1], sinValues[2], weight.x);
+ else if (arr0x == 2)
+ sin_c.x = lerp(sinValues[2], sinValues[3], weight.x);
+ else if (arr0x == 3)
+ sin_c.x = lerp(sinValues[3], sinValues[4], weight.x);
+ else if (arr0x == 4)
+ sin_c.x = lerp(sinValues[4], sinValues[5], weight.x);
+ else if (arr0x == 5)
+ sin_c.x = lerp(sinValues[5], sinValues[6], weight.x);
+ else if (arr0x == 6)
+ sin_c.x = lerp(sinValues[6], sinValues[7], weight.x);
+ else if (arr0x == 7)
+ sin_c.x = lerp(sinValues[7], sinValues[8], weight.x);
+ else if (arr0x == 8)
+ sin_c.x = lerp(sinValues[8], sinValues[9], weight.x);
+ else if (arr0x == 9)
+ sin_c.x = lerp(sinValues[9], sinValues[10], weight.x);
+ else if (arr0x == 10)
+ sin_c.x = lerp(sinValues[10], sinValues[11], weight.x);
+ else if (arr0x == 11)
+ sin_c.x = lerp(sinValues[11], sinValues[12], weight.x);
+ else if (arr0x == 12)
+ sin_c.x = lerp(sinValues[12], sinValues[13], weight.x);
+ else if (arr0x == 13)
+ sin_c.x = lerp(sinValues[13], sinValues[14], weight.x);
+ else if (arr0x == 14)
+ sin_c.x = lerp(sinValues[14], sinValues[15], weight.x);
+ else if (arr0x == 15)
+ sin_c.x = lerp(sinValues[15], sinValues[16], weight.x);
+ else if (arr0x == 16)
+ sin_c.x = sinValues[16];
+
+ if (arr0y == 0)
+ sin_c.y = lerp(sinValues[0], sinValues[1], weight.y);
+ else if (arr0y == 1)
+ sin_c.y = lerp(sinValues[1], sinValues[2], weight.y);
+ else if (arr0y == 2)
+ sin_c.y = lerp(sinValues[2], sinValues[3], weight.y);
+ else if (arr0y == 3)
+ sin_c.y = lerp(sinValues[3], sinValues[4], weight.y);
+ else if (arr0y == 4)
+ sin_c.y = lerp(sinValues[4], sinValues[5], weight.y);
+ else if (arr0y == 5)
+ sin_c.y = lerp(sinValues[5], sinValues[6], weight.y);
+ else if (arr0y == 6)
+ sin_c.y = lerp(sinValues[6], sinValues[7], weight.y);
+ else if (arr0y == 7)
+ sin_c.y = lerp(sinValues[7], sinValues[8], weight.y);
+ else if (arr0y == 8)
+ sin_c.y = lerp(sinValues[8], sinValues[9], weight.y);
+ else if (arr0y == 9)
+ sin_c.y = lerp(sinValues[9], sinValues[10], weight.y);
+ else if (arr0y == 10)
+ sin_c.y = lerp(sinValues[10], sinValues[11], weight.y);
+ else if (arr0y == 11)
+ sin_c.y = lerp(sinValues[11], sinValues[12], weight.y);
+ else if (arr0y == 12)
+ sin_c.y = lerp(sinValues[12], sinValues[13], weight.y);
+ else if (arr0y == 13)
+ sin_c.y = lerp(sinValues[13], sinValues[14], weight.y);
+ else if (arr0y == 14)
+ sin_c.y = lerp(sinValues[14], sinValues[15], weight.y);
+ else if (arr0y == 15)
+ sin_c.y = lerp(sinValues[15], sinValues[16], weight.y);
+ else if (arr0y == 16)
+ sin_c.y = sinValues[16];
+
+ gl_FragColor = vec4(0.5 * sin_c + 0.5, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..910f090ce6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ color = vec4(0.5 * sin(2.0 * M_PI * gtf_Color.rg) + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..3d1567e142
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec2_vert_xvary_ref.vert
@@ -0,0 +1,62 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float sinValues[17];
+ sinValues[0] = 0.0;
+ sinValues[1] = 0.382683;
+ sinValues[2] = 0.707107;
+ sinValues[3] = 0.92388;
+ sinValues[4] = 1.0;
+ sinValues[5] = 0.92388;
+ sinValues[6] = 0.707107;
+ sinValues[7] = 0.382683;
+ sinValues[8] = 0.0;
+ sinValues[9] = -0.382683;
+ sinValues[10] = -0.707107;
+ sinValues[11] = -0.92388;
+ sinValues[12] = -1.0;
+ sinValues[13] = -0.923879;
+ sinValues[14] = -0.707107;
+ sinValues[15] = -0.382683;
+ sinValues[16] = 0.0;
+
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 2.0 * M_PI * gtf_Color.rg;
+ float sign = 1.0;
+
+ vec2 sin_c = vec2(0.0);
+ float fact;
+ float fact_of;
+
+ // Taylors series expansion for sin
+ for(int i = 0; i < 12; i++)
+ {
+ fact = 1.0;
+ for(int j = 2; j <= 23; j++)
+ if (j <= 2 * i + 1)
+ fact *= float(j);
+
+ sin_c += sign * pow(c, vec2(2.0 * float(i) + 1.0)) / fact;
+ sign *= -1.0;
+ }
+
+ color = vec4(0.5 * sin_c + 0.5, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..21f6124e41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ gl_FragColor = vec4(0.5 * sin(2.0 * M_PI * color.rgb) + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..86aada5af7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_frag_xvary_ref.frag
@@ -0,0 +1,156 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float sinValues[17];
+ sinValues[0] = 0.0;
+ sinValues[1] = 0.382683;
+ sinValues[2] = 0.707107;
+ sinValues[3] = 0.92388;
+ sinValues[4] = 1.0;
+ sinValues[5] = 0.92388;
+ sinValues[6] = 0.707107;
+ sinValues[7] = 0.382683;
+ sinValues[8] = 0.0;
+ sinValues[9] = -0.382683;
+ sinValues[10] = -0.707107;
+ sinValues[11] = -0.92388;
+ sinValues[12] = -1.0;
+ sinValues[13] = -0.923879;
+ sinValues[14] = -0.707107;
+ sinValues[15] = -0.382683;
+ sinValues[16] = 0.0;
+
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * color.rgb;
+
+ vec3 arrVal = c * 2.546478971;
+ int arr0x = int(floor(arrVal.x));
+ int arr0y = int(floor(arrVal.y));
+ int arr0z = int(floor(arrVal.z));
+ vec3 weight = arrVal - floor(arrVal);
+ vec3 sin_c = vec3(0.0, 0.0, 0.0);
+
+ if (arr0x == 0)
+ sin_c.x = lerp(sinValues[0], sinValues[1], weight.x);
+ else if (arr0x == 1)
+ sin_c.x = lerp(sinValues[1], sinValues[2], weight.x);
+ else if (arr0x == 2)
+ sin_c.x = lerp(sinValues[2], sinValues[3], weight.x);
+ else if (arr0x == 3)
+ sin_c.x = lerp(sinValues[3], sinValues[4], weight.x);
+ else if (arr0x == 4)
+ sin_c.x = lerp(sinValues[4], sinValues[5], weight.x);
+ else if (arr0x == 5)
+ sin_c.x = lerp(sinValues[5], sinValues[6], weight.x);
+ else if (arr0x == 6)
+ sin_c.x = lerp(sinValues[6], sinValues[7], weight.x);
+ else if (arr0x == 7)
+ sin_c.x = lerp(sinValues[7], sinValues[8], weight.x);
+ else if (arr0x == 8)
+ sin_c.x = lerp(sinValues[8], sinValues[9], weight.x);
+ else if (arr0x == 9)
+ sin_c.x = lerp(sinValues[9], sinValues[10], weight.x);
+ else if (arr0x == 10)
+ sin_c.x = lerp(sinValues[10], sinValues[11], weight.x);
+ else if (arr0x == 11)
+ sin_c.x = lerp(sinValues[11], sinValues[12], weight.x);
+ else if (arr0x == 12)
+ sin_c.x = lerp(sinValues[12], sinValues[13], weight.x);
+ else if (arr0x == 13)
+ sin_c.x = lerp(sinValues[13], sinValues[14], weight.x);
+ else if (arr0x == 14)
+ sin_c.x = lerp(sinValues[14], sinValues[15], weight.x);
+ else if (arr0x == 15)
+ sin_c.x = lerp(sinValues[15], sinValues[16], weight.x);
+ else if (arr0x == 16)
+ sin_c.x = sinValues[16];
+
+ if (arr0y == 0)
+ sin_c.y = lerp(sinValues[0], sinValues[1], weight.y);
+ else if (arr0y == 1)
+ sin_c.y = lerp(sinValues[1], sinValues[2], weight.y);
+ else if (arr0y == 2)
+ sin_c.y = lerp(sinValues[2], sinValues[3], weight.y);
+ else if (arr0y == 3)
+ sin_c.y = lerp(sinValues[3], sinValues[4], weight.y);
+ else if (arr0y == 4)
+ sin_c.y = lerp(sinValues[4], sinValues[5], weight.y);
+ else if (arr0y == 5)
+ sin_c.y = lerp(sinValues[5], sinValues[6], weight.y);
+ else if (arr0y == 6)
+ sin_c.y = lerp(sinValues[6], sinValues[7], weight.y);
+ else if (arr0y == 7)
+ sin_c.y = lerp(sinValues[7], sinValues[8], weight.y);
+ else if (arr0y == 8)
+ sin_c.y = lerp(sinValues[8], sinValues[9], weight.y);
+ else if (arr0y == 9)
+ sin_c.y = lerp(sinValues[9], sinValues[10], weight.y);
+ else if (arr0y == 10)
+ sin_c.y = lerp(sinValues[10], sinValues[11], weight.y);
+ else if (arr0y == 11)
+ sin_c.y = lerp(sinValues[11], sinValues[12], weight.y);
+ else if (arr0y == 12)
+ sin_c.y = lerp(sinValues[12], sinValues[13], weight.y);
+ else if (arr0y == 13)
+ sin_c.y = lerp(sinValues[13], sinValues[14], weight.y);
+ else if (arr0y == 14)
+ sin_c.y = lerp(sinValues[14], sinValues[15], weight.y);
+ else if (arr0y == 15)
+ sin_c.y = lerp(sinValues[15], sinValues[16], weight.y);
+ else if (arr0y == 16)
+ sin_c.y = sinValues[16];
+
+ if (arr0z == 0)
+ sin_c.z = lerp(sinValues[0], sinValues[1], weight.z);
+ else if (arr0z == 1)
+ sin_c.z = lerp(sinValues[1], sinValues[2], weight.z);
+ else if (arr0z == 2)
+ sin_c.z = lerp(sinValues[2], sinValues[3], weight.z);
+ else if (arr0z == 3)
+ sin_c.z = lerp(sinValues[3], sinValues[4], weight.z);
+ else if (arr0z == 4)
+ sin_c.z = lerp(sinValues[4], sinValues[5], weight.z);
+ else if (arr0z == 5)
+ sin_c.z = lerp(sinValues[5], sinValues[6], weight.z);
+ else if (arr0z == 6)
+ sin_c.z = lerp(sinValues[6], sinValues[7], weight.z);
+ else if (arr0z == 7)
+ sin_c.z = lerp(sinValues[7], sinValues[8], weight.z);
+ else if (arr0z == 8)
+ sin_c.z = lerp(sinValues[8], sinValues[9], weight.z);
+ else if (arr0z == 9)
+ sin_c.z = lerp(sinValues[9], sinValues[10], weight.z);
+ else if (arr0z == 10)
+ sin_c.z = lerp(sinValues[10], sinValues[11], weight.z);
+ else if (arr0z == 11)
+ sin_c.z = lerp(sinValues[11], sinValues[12], weight.z);
+ else if (arr0z == 12)
+ sin_c.z = lerp(sinValues[12], sinValues[13], weight.z);
+ else if (arr0z == 13)
+ sin_c.z = lerp(sinValues[13], sinValues[14], weight.z);
+ else if (arr0z == 14)
+ sin_c.z = lerp(sinValues[14], sinValues[15], weight.z);
+ else if (arr0z == 15)
+ sin_c.z = lerp(sinValues[15], sinValues[16], weight.z);
+ else if (arr0z == 16)
+ sin_c.z = sinValues[16];
+
+ gl_FragColor = vec4(0.5 * sin_c + 0.5, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..25ea3a6a49
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ color = vec4(0.5 * sin(2.0 * M_PI * gtf_Color.rgb) + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..962f1d8e9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sin/sin_vec3_vert_xvary_ref.vert
@@ -0,0 +1,62 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+float lerp(float a, float b, float s)
+{
+ return a + (b - a) * s;
+}
+
+void main (void)
+{
+ float sinValues[17];
+ sinValues[0] = 0.0;
+ sinValues[1] = 0.382683;
+ sinValues[2] = 0.707107;
+ sinValues[3] = 0.92388;
+ sinValues[4] = 1.0;
+ sinValues[5] = 0.92388;
+ sinValues[6] = 0.707107;
+ sinValues[7] = 0.382683;
+ sinValues[8] = 0.0;
+ sinValues[9] = -0.382683;
+ sinValues[10] = -0.707107;
+ sinValues[11] = -0.92388;
+ sinValues[12] = -1.0;
+ sinValues[13] = -0.923879;
+ sinValues[14] = -0.707107;
+ sinValues[15] = -0.382683;
+ sinValues[16] = 0.0;
+
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 2.0 * M_PI * gtf_Color.rgb;
+ float sign = 1.0;
+
+ vec3 sin_c = vec3(0.0);
+ float fact;
+ float fact_of;
+
+ // Taylors series expansion for sin
+ for(int i = 0; i < 12; i++)
+ {
+ fact = 1.0;
+ for(int j = 2; j <= 23; j++)
+ if (j <= 2 * i + 1)
+ fact *= float(j);
+
+ sin_c += sign * pow(c, vec3(2.0 * float(i) + 1.0)) / fact;
+ sign *= -1.0;
+ }
+
+ color = vec4(0.5 * sin_c + 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt
new file mode 100644
index 0000000000..4121dd5f8c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+smoothstep_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html
new file mode 100644
index 0000000000..cec8b66e41
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: smoothstep_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "smoothstep_float_frag_xvary_edgeconstquarter_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "smoothstep_float_frag_xvary_edgeconstquarter.frag"
+ },
+ "name": "smoothstep_float_frag_xvary_edgeconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "smoothstep_vec2_frag_xvary_edgeconstquarter.frag"
+ },
+ "name": "smoothstep_vec2_frag_xvary_edgeconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "smoothstep_vec3_frag_xvary_edgeconstquarter.frag"
+ },
+ "name": "smoothstep_vec3_frag_xvary_edgeconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "smoothstep_float_vert_xvary_edgeconstquarter_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "smoothstep_float_vert_xvary_edgeconstquarter.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "smoothstep_float_vert_xvary_edgeconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "smoothstep_vec2_vert_xvary_edgeconstquarter.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "smoothstep_vec2_vert_xvary_edgeconstquarter.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "smoothstep_vec3_vert_xvary_edgeconstquarter.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "smoothstep_vec3_vert_xvary_edgeconstquarter.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag
new file mode 100644
index 0000000000..051294c841
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float edge0 = 0.25;
+ const float edge1 = 0.75;
+ gl_FragColor = vec4(smoothstep(edge0, edge1, color.r), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag
new file mode 100644
index 0000000000..811dcdd942
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_frag_xvary_edgeconstquarter_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float edge0 = 0.25;
+ const float edge1 = 0.75;
+ float c = clamp((color.r - edge0) / (edge1 - edge0), 0.0, 1.0);
+
+ gl_FragColor = vec4(c * c * (3.0 - 2.0 * c), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert
new file mode 100644
index 0000000000..a42ca379dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float edge0 = 0.25;
+ const float edge1 = 0.75;
+ color = vec4(smoothstep(edge0, edge1, gtf_Color.r), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert
new file mode 100644
index 0000000000..8bd69f3b62
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_float_vert_xvary_edgeconstquarter_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float edge0 = 0.25;
+ const float edge1 = 0.75;
+ float c = clamp((gtf_Color.r - edge0) / (edge1 - edge0), 0.0, 1.0);
+
+ color = vec4(c * c * (3.0 - 2.0 * c), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag
new file mode 100644
index 0000000000..6d32c3d4b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge0 = vec2(0.25, 0.25);
+ const vec2 edge1 = vec2(0.75, 0.75);
+ gl_FragColor = vec4(smoothstep(edge0, edge1, color.rg), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag
new file mode 100644
index 0000000000..ffb365002f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_frag_xvary_edgeconstquarter_ref.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge0 = vec2(0.25, 0.25);
+ const vec2 edge1 = vec2(0.75, 0.75);
+ vec2 c = clamp((color.rg - edge0) / (edge1 - edge0), 0.0, 1.0);
+ gl_FragColor = vec4(c * c * (3.0 - 2.0 * c), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert
new file mode 100644
index 0000000000..0c55476372
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge0 = vec2(0.25, 0.25);
+ const vec2 edge1 = vec2(0.75, 0.75);
+ color = vec4(smoothstep(edge0, edge1, gtf_Color.rg), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert
new file mode 100644
index 0000000000..0864a3af9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec2_vert_xvary_edgeconstquarter_ref.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge0 = vec2(0.25, 0.25);
+ const vec2 edge1 = vec2(0.75, 0.75);
+ vec2 c = clamp((gtf_Color.rg - edge0) / (edge1 - edge0), 0.0, 1.0);
+ color = vec4(c * c * (3.0 - 2.0 * c), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag
new file mode 100644
index 0000000000..caca3c1f95
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge0 = vec3(0.25, 0.25, 0.25);
+ const vec3 edge1 = vec3(0.75, 0.75, 0.75);
+ gl_FragColor = vec4(smoothstep(edge0, edge1, color.rgb), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag
new file mode 100644
index 0000000000..e9ea52ad64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_frag_xvary_edgeconstquarter_ref.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge0 = vec3(0.25, 0.25, 0.25);
+ const vec3 edge1 = vec3(0.75, 0.75, 0.75);
+ vec3 c = clamp((color.rgb - edge0) / (edge1 - edge0), 0.0, 1.0);
+
+ gl_FragColor = vec4(c * c * (3.0 - 2.0 * c), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert
new file mode 100644
index 0000000000..6aa8d8c3e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge0 = vec3(0.25, 0.25, 0.25);
+ const vec3 edge1 = vec3(0.75, 0.75, 0.75);
+ color = vec4(smoothstep(edge0, edge1, gtf_Color.rgb), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert
new file mode 100644
index 0000000000..2f12993b0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/smoothstep/smoothstep_vec3_vert_xvary_edgeconstquarter_ref.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge0 = vec3(0.25, 0.25, 0.25);
+ const vec3 edge1 = vec3(0.75, 0.75, 0.75);
+ vec3 c = clamp((gtf_Color.rgb - edge0) / (edge1 - edge0), 0.0, 1.0);
+
+ color = vec4(c * c * (3.0 - 2.0 * c), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt
new file mode 100644
index 0000000000..a151ee6448
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+sqrt_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html
new file mode 100644
index 0000000000..48f368604e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: sqrt_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sqrt_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sqrt_float_frag_xvary.frag"
+ },
+ "name": "sqrt_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sqrt_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sqrt_vec2_frag_xvary.frag"
+ },
+ "name": "sqrt_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sqrt_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "sqrt_vec3_frag_xvary.frag"
+ },
+ "name": "sqrt_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sqrt_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sqrt_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sqrt_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sqrt_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sqrt_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sqrt_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "sqrt_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "sqrt_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "sqrt_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag
new file mode 100644
index 0000000000..c061c08adb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = sqrt(100.0 * color.r);
+ gl_FragColor = vec4(c * c / 100.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..5fe62a689a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ float c = 100.0 * color.r;
+ gl_FragColor = vec4(c / 100.0, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert
new file mode 100644
index 0000000000..f680e0ae54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = sqrt(100.0 * gtf_Color.r);
+ color = vec4(c * c / 100.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..8307cf719b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_float_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ float c = 100.0 * gtf_Color.r;
+ color = vec4(c / 100.0, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..9de98d8ced
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = sqrt(100.0 * color.rg);
+ gl_FragColor = vec4(c * c / 100.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..9735f24aee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 100.0 * color.rg;
+ gl_FragColor = vec4(c / 100.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..2ebedb1720
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = sqrt(100.0 * gtf_Color.rg);
+ color = vec4(c * c / 100.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..1275313c18
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec2_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 c = 100.0 * gtf_Color.rg;
+ color = vec4(c / 100.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..2c53829b64
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = sqrt(100.0 * color.rgb);
+ gl_FragColor = vec4(c * c / 100.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..f23b5f87ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_frag_xvary_ref.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 100.0 * color.rgb;
+ gl_FragColor = vec4(c / 100.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..baed8763f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = sqrt(100.0 * gtf_Color.rgb);
+ color = vec4(c * c / 100.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..39983c3079
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/sqrt/sqrt_vec3_vert_xvary_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 c = 100.0 * gtf_Color.rgb;
+ color = vec4(c / 100.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt
new file mode 100644
index 0000000000..6b8ac005dc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+step_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html
new file mode 100644
index 0000000000..1a4297a415
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: step_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "step_float_frag_xvary_edgeconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "step_float_frag_xvary_edgeconsthalf.frag"
+ },
+ "name": "step_float_frag_xvary_edgeconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "step_vec2_frag_xvary_edgeconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "step_vec2_frag_xvary_edgeconsthalf.frag"
+ },
+ "name": "step_vec2_frag_xvary_edgeconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "step_vec3_frag_xvary_edgeconsthalf_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "step_vec3_frag_xvary_edgeconsthalf.frag"
+ },
+ "name": "step_vec3_frag_xvary_edgeconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "step_float_vert_xvary_edgeconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "step_float_vert_xvary_edgeconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "step_float_vert_xvary_edgeconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "step_vec2_vert_xvary_edgeconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "step_vec2_vert_xvary_edgeconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "step_vec2_vert_xvary_edgeconsthalf.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "step_vec3_vert_xvary_edgeconsthalf_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "step_vec3_vert_xvary_edgeconsthalf.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "step_vec3_vert_xvary_edgeconsthalf.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag
new file mode 100644
index 0000000000..a79fab9e71
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float edge = 0.5;
+ gl_FragColor = vec4(step(edge, color.r), 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag
new file mode 100644
index 0000000000..b5ac9648e4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_frag_xvary_edgeconsthalf_ref.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float edge = 0.5;
+ float c = color.r;
+ if(c >= edge) c = 1.0;
+ else c = 0.0;
+
+ gl_FragColor = vec4(c, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert
new file mode 100644
index 0000000000..b7cf8c7c2d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float edge = 0.5;
+ color = vec4(step(edge, gtf_Color.r), 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert
new file mode 100644
index 0000000000..6e298d4c68
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_float_vert_xvary_edgeconsthalf_ref.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float edge = 0.5;
+ float c = gtf_Color.r;
+ if(c >= edge) c = 1.0;
+ else c = 0.0;
+
+ color = vec4(c, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag
new file mode 100644
index 0000000000..6882df1b7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge = vec2(0.5, 0.5);
+ gl_FragColor = vec4(step(edge, color.rg), 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag
new file mode 100644
index 0000000000..6643e48d8e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_frag_xvary_edgeconsthalf_ref.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge = vec2(0.5, 0.5);
+ vec2 c = color.rg;
+ if(c[0] >= edge[0])
+ {
+ c[0] = 1.0;
+ }
+ else
+ {
+ c[0] = 0.0;
+ }
+ if(c[1] >= edge[1])
+ {
+ c[1] = 1.0;
+ }
+ else
+ {
+ c[1] = 0.0;
+ }
+
+ gl_FragColor = vec4(c, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert
new file mode 100644
index 0000000000..c6c44ff0b5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge = vec2(0.5, 0.5);
+ color = vec4(step(edge, gtf_Color.rg), 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert
new file mode 100644
index 0000000000..177e9d3c5e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec2_vert_xvary_edgeconsthalf_ref.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec2 edge = vec2(0.5, 0.5);
+ vec2 c = gtf_Color.rg;
+ if(c[0] >= edge[0])
+ {
+ c[0] = 1.0;
+ }
+ else
+ {
+ c[0] = 0.0;
+ }
+ if(c[1] >= edge[1])
+ {
+ c[1] = 1.0;
+ }
+ else
+ {
+ c[1] = 0.0;
+ }
+
+ color = vec4(c, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag
new file mode 100644
index 0000000000..b27d163c46
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge = vec3(0.5, 0.5, 0.5);
+ gl_FragColor = vec4(step(edge, color.rgb), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag
new file mode 100644
index 0000000000..1dfc326ccb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_frag_xvary_edgeconsthalf_ref.frag
@@ -0,0 +1,44 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge = vec3(0.5, 0.5, 0.5);
+ vec3 c = color.rgb;
+ if(c[0] >= edge[0])
+ {
+ c[0] = 1.0;
+ }
+ else
+ {
+ c[0] = 0.0;
+ }
+ if(c[1] >= edge[1])
+ {
+ c[1] = 1.0;
+ }
+ else
+ {
+ c[1] = 0.0;
+ }
+ if(c[2] >= edge[2])
+ {
+ c[2] = 1.0;
+ }
+ else
+ {
+ c[2] = 0.0;
+ }
+
+ gl_FragColor = vec4(c, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert
new file mode 100644
index 0000000000..a943b02201
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge = vec3(0.5, 0.5, 0.5);
+ color = vec4(step(edge, gtf_Color.rgb), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert
new file mode 100644
index 0000000000..c8d2442fa6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/step/step_vec3_vert_xvary_edgeconsthalf_ref.vert
@@ -0,0 +1,45 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const vec3 edge = vec3(0.5, 0.5, 0.5);
+ vec3 c = gtf_Color.rgb;
+ if(c[0] >= edge[0])
+ {
+ c[0] = 1.0;
+ }
+ else
+ {
+ c[0] = 0.0;
+ }
+ if(c[1] >= edge[1])
+ {
+ c[1] = 1.0;
+ }
+ else
+ {
+ c[1] = 0.0;
+ }
+ if(c[2] >= edge[2])
+ {
+ c[2] = 1.0;
+ }
+ else
+ {
+ c[2] = 0.0;
+ }
+
+ color = vec4(c, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt
new file mode 100644
index 0000000000..89c3da16ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/input.run.txt
@@ -0,0 +1,8 @@
+# this file is auto-generated. DO NOT EDIT.
+struct_001_to_008.html
+struct_009_to_016.html
+struct_017_to_024.html
+struct_025_to_032.html
+struct_033_to_040.html
+struct_041_to_048.html
+struct_049_to_056.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag
new file mode 100644
index 0000000000..bc0fdd01a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_frag.frag
@@ -0,0 +1,99 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+#define ERROR_EPSILON 0.125
+
+void main (void){
+ struct second_nest
+ {
+ float sc_nt;
+ mat2 sc_mt2;
+ vec4 sc_vc4;
+ };
+
+ struct nest
+ {
+ ivec3 nt_ivc3;
+ bvec4 nt_bvc4;
+ second_nest nt_scne;
+ };
+
+ struct test_t
+ {
+ float t_fl;
+ vec2 t_vc2;
+ vec3 t_vc3;
+ mat4 t_mt4;
+ nest t_nested;
+ float t_2fl;
+ };
+
+ vec4 mt1 = vec4(31.0, 32.0, 33.0, 34.0);
+ vec4 mt2 = vec4(35.0, 36.0, 37.0, 38.0);
+ vec4 mt3 = vec4(39.0, 40.0, 41.0, 42.0);
+ vec4 mt4 = vec4(43.0, 44.0, 45.0, 46.0);
+ int i=0;
+ float sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0;
+
+ test_t a = test_t(23.0, vec2(12.0, 13.0),
+
+ vec3(163.0, 173.0, 183.0),
+
+ mat4(mt1, mt2, mt3, mt4),
+
+ nest( ivec3(73, 74, 75),
+
+ bvec4(12, 0, 17.0, 193.0 ),
+
+ second_nest(144.0, mat2(22.0, 23.0, 24.0, 25.0), vec4(57.0, 58.0, 59.0, 60.0 )
+ )
+ ),
+
+ 203.0
+ );
+
+ sum1 = a.t_mt4[0][0] + a.t_mt4[0][1] + a.t_mt4[0][2] + a.t_mt4[0][3];
+ sum2 = a.t_mt4[1][0] + a.t_mt4[1][1] + a.t_mt4[1][2] + a.t_mt4[1][3];
+ sum3 = a.t_mt4[2][0] + a.t_mt4[2][1] + a.t_mt4[2][2] + a.t_mt4[2][3];
+ sum4 = a.t_mt4[3][0] + a.t_mt4[3][1] + a.t_mt4[3][2] + a.t_mt4[3][3];
+
+ float gray;
+ if( ( a.t_fl == 23.0 ) &&
+
+ (a.t_vc2[0] == 12.0) && (a.t_vc2[1] == 13.0) &&
+
+ (a.t_vc3[0] == 163.0) && (a.t_vc3[1] == 173.0) && (a.t_vc3[2] == 183.0) &&
+
+ (sum1 > 130.0-ERROR_EPSILON && sum1 < 130.0+ERROR_EPSILON ) && (sum2 > 146.0-ERROR_EPSILON && sum2 < 146.0+ERROR_EPSILON ) && (sum3 >162.0-ERROR_EPSILON && sum3 < 162.0+ERROR_EPSILON ) && (sum4 > 178.0-ERROR_EPSILON && sum4 < 178.0+ERROR_EPSILON ) &&
+ (a.t_nested.nt_ivc3[0] == 73 ) && (a.t_nested.nt_ivc3[1] == 74 ) && (a.t_nested.nt_ivc3[2] == 75 ) &&
+
+ (a.t_nested.nt_bvc4[0] == true) && (a.t_nested.nt_bvc4[1] == false) &&
+
+ (a.t_nested.nt_bvc4[2] == true ) && (a.t_nested.nt_bvc4[0] == true) &&
+
+ (a.t_nested.nt_scne.sc_nt == 144.0) &&
+
+ (a.t_nested.nt_scne.sc_mt2[0][0] == 22.0 ) && (a.t_nested.nt_scne.sc_mt2[0][1] == 23.0 ) &&
+
+ (a.t_nested.nt_scne.sc_mt2[1][0] == 24.0 ) && (a.t_nested.nt_scne.sc_mt2[1][1] == 25.0 ) &&
+
+ (a.t_nested.nt_scne.sc_vc4[0] == 57.0 ) && (a.t_nested.nt_scne.sc_vc4[1] == 58.0 ) &&
+
+ (a.t_nested.nt_scne.sc_vc4[2] == 59.0 ) && (a.t_nested.nt_scne.sc_vc4[3] == 60.0) &&
+
+ (a.t_2fl == 203.0)
+ )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert
new file mode 100644
index 0000000000..32cf5252f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/nestedstructcomb_various_vert.vert
@@ -0,0 +1,102 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+#define ERROR_EPSILON 0.125
+
+void main (void)
+{
+ struct second_nest
+ {
+ float sc_nt;
+ mat2 sc_mt2;
+ vec4 sc_vc4;
+ };
+
+ struct nest
+ {
+ ivec3 nt_ivc3;
+ bvec4 nt_bvc4;
+ second_nest nt_scne;
+ };
+
+ struct test_t
+ {
+ float t_fl;
+ vec2 t_vc2;
+ vec3 t_vc3;
+ mat4 t_mt4;
+ nest t_nested;
+ float t_2fl;
+ };
+
+ vec4 mt1 = vec4(31.0, 32.0, 33.0, 34.0);
+ vec4 mt2 = vec4(35.0, 36.0, 37.0, 38.0);
+ vec4 mt3 = vec4(39.0, 40.0, 41.0, 42.0);
+ vec4 mt4 = vec4(43.0, 44.0, 45.0, 46.0);
+ int i=0;
+ float sum1=0.0, sum2=0.0, sum3=0.0, sum4=0.0;
+
+ test_t a = test_t(23.0, vec2(12.0, 13.0),
+
+ vec3(163.0, 173.0, 183.0),
+
+ mat4(mt1, mt2, mt3, mt4),
+
+ nest( ivec3(73, 74, 75),
+
+ bvec4(12, 0, 17.0, 193.0 ),
+
+ second_nest(144.0, mat2(22.0, 23.0, 24.0, 25.0), vec4(57.0, 58.0, 59.0, 60.0 )
+ )
+ ),
+
+ 203.0
+ );
+
+ sum1 = a.t_mt4[0][0] + a.t_mt4[0][1] + a.t_mt4[0][2] + a.t_mt4[0][3];
+ sum2 = a.t_mt4[1][0] + a.t_mt4[1][1] + a.t_mt4[1][2] + a.t_mt4[1][3];
+ sum3 = a.t_mt4[2][0] + a.t_mt4[2][1] + a.t_mt4[2][2] + a.t_mt4[2][3];
+ sum4 = a.t_mt4[3][0] + a.t_mt4[3][1] + a.t_mt4[3][2] + a.t_mt4[3][3];
+
+ float gray;
+ if( ( a.t_fl == 23.0 ) &&
+
+ (a.t_vc2[0] == 12.0) && (a.t_vc2[1] == 13.0) &&
+
+ (a.t_vc3[0] == 163.0) && (a.t_vc3[1] == 173.0) && (a.t_vc3[2] == 183.0) &&
+
+ (sum1 > 130.0-ERROR_EPSILON && sum1 < 130.0+ERROR_EPSILON ) && (sum2 > 146.0-ERROR_EPSILON && sum2 < 146.0+ERROR_EPSILON ) && (sum3 >162.0-ERROR_EPSILON && sum3 < 162.0+ERROR_EPSILON ) && (sum4 > 178.0-ERROR_EPSILON && sum4 < 178.0+ERROR_EPSILON ) &&
+ (a.t_nested.nt_ivc3[0] == 73 ) && (a.t_nested.nt_ivc3[1] == 74 ) && (a.t_nested.nt_ivc3[2] == 75 ) &&
+
+ (a.t_nested.nt_bvc4[0] == true) && (a.t_nested.nt_bvc4[1] == false) &&
+
+ (a.t_nested.nt_bvc4[2] == true ) && (a.t_nested.nt_bvc4[0] == true) &&
+
+ (a.t_nested.nt_scne.sc_nt == 144.0) &&
+
+ (a.t_nested.nt_scne.sc_mt2[0][0] == 22.0 ) && (a.t_nested.nt_scne.sc_mt2[0][1] == 23.0 ) &&
+
+ (a.t_nested.nt_scne.sc_mt2[1][0] == 24.0 ) && (a.t_nested.nt_scne.sc_mt2[1][1] == 25.0 ) &&
+
+ (a.t_nested.nt_scne.sc_vc4[0] == 57.0 ) && (a.t_nested.nt_scne.sc_vc4[1] == 58.0 ) &&
+
+ (a.t_nested.nt_scne.sc_vc4[2] == 59.0 ) && (a.t_nested.nt_scne.sc_vc4[3] == 60.0) &&
+
+ (a.t_2fl == 203.0)
+ )
+ gray=1.0;
+ else gray=0.0;
+
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html
new file mode 100644
index 0000000000..226e152da8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_001_to_008.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: struct_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_float_frag.frag"
+ },
+ "name": "struct_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_float_frag.frag"
+ },
+ "name": "structcopy_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_float_frag.frag"
+ },
+ "name": "structnest_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_bool_frag.frag"
+ },
+ "name": "struct_bool_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_bool_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_bool_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html
new file mode 100644
index 0000000000..aacd4526e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_009_to_016.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: struct_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_bool_frag.frag"
+ },
+ "name": "structcopy_bool_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_bool_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_bool_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_bool_frag.frag"
+ },
+ "name": "structnest_bool_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_bool_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_bool_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_vec2_frag.frag"
+ },
+ "name": "struct_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_vec2_frag.frag"
+ },
+ "name": "structcopy_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_vec2_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html
new file mode 100644
index 0000000000..c04ca16563
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_017_to_024.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: struct_017_to_024.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_vec2_frag.frag"
+ },
+ "name": "structnest_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_vec3_frag.frag"
+ },
+ "name": "struct_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_vec3_frag.frag"
+ },
+ "name": "structcopy_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_vec3_frag.frag"
+ },
+ "name": "structnest_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_vec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html
new file mode 100644
index 0000000000..cbbc42181b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_025_to_032.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: struct_025_to_032.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_vec4_frag.frag"
+ },
+ "name": "struct_vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_vec4_frag.frag"
+ },
+ "name": "structcopy_vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_vec4_frag.frag"
+ },
+ "name": "structnest_vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_bvec2bvec3bvec4_frag.frag"
+ },
+ "name": "struct_bvec2bvec3bvec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_bvec2bvec3bvec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_bvec2bvec3bvec4_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html
new file mode 100644
index 0000000000..3fa57169f4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_033_to_040.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: struct_033_to_040.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_bvec2bvec3bvec4_frag.frag"
+ },
+ "name": "structcopy_bvec2bvec3bvec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_bvec2bvec3bvec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_bvec2bvec3bvec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_bvec2bvec3bvec4_frag.frag"
+ },
+ "name": "structnest_bvec2bvec3bvec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_bvec2bvec3bvec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_bvec2bvec3bvec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_mat2_frag.frag"
+ },
+ "name": "struct_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_mat2_frag.frag"
+ },
+ "name": "structcopy_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_mat2_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html
new file mode 100644
index 0000000000..7cc87e2f57
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_041_to_048.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: struct_041_to_048.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_mat2_frag.frag"
+ },
+ "name": "structnest_mat2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_mat2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_mat2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_mat3_frag.frag"
+ },
+ "name": "struct_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_mat3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_mat3_frag.frag"
+ },
+ "name": "structcopy_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_mat3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_mat3_frag.frag"
+ },
+ "name": "structnest_mat3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_mat3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_mat3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html
new file mode 100644
index 0000000000..9356340e4d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_049_to_056.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: struct_049_to_056.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "struct_mat4_frag.frag"
+ },
+ "name": "struct_mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "struct_mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "struct_mat4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structcopy_mat4_frag.frag"
+ },
+ "name": "structcopy_mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structcopy_mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structcopy_mat4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "structnest_mat4_frag.frag"
+ },
+ "name": "structnest_mat4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "structnest_mat4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "structnest_mat4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "nestedstructcomb_various_frag.frag"
+ },
+ "name": "nestedstructcomb_various_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "nestedstructcomb_various_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "nestedstructcomb_various_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag
new file mode 100644
index 0000000000..88affd9767
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_frag.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ bool a;
+ bool b;
+ bool c;
+ bool d;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(bool(12), bool(0), bool(25.5), bool(0.0));
+ float gray = 0.0;
+ if( (s.a==true) && (s.b==false) && (s.c == true) && (s.d==false))
+ gray=1.0;
+ else
+ gray =0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert
new file mode 100644
index 0000000000..0a3b81b46d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bool_vert.vert
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ bool a;
+ bool b;
+ bool c;
+ bool d;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(bool(12), bool(0), bool(25.5), bool(0.0));
+ float gray = 0.0;
+ if( (s.a==true) && (s.b==false) && (s.c == true) && (s.d==false))
+ gray=1.0;
+ else
+ gray =0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag
new file mode 100644
index 0000000000..1f8c7cfb6a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_frag.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ bvec2 a;
+ bvec3 b;
+ bvec4 c;
+};
+
+void main (void)
+{
+ sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) );
+ float gray = 0.0;
+ if( (s.a[0]) && (s.a[1]) && (s.b[0]) && (!s.b[1]) && (s.b[2]) && (s.c[0]) && (s.c[1]) && (s.c[2]) )
+ gray=1.0;
+ else
+ gray =0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert
new file mode 100644
index 0000000000..f82612477d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_bvec2bvec3bvec4_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ bvec2 a;
+ bvec3 b;
+ bvec4 c;
+};
+
+void main (void)
+{
+ sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) );
+ float gray = 0.0;
+ if( (s.a[0]) && (s.a[1]) && (s.b[0]) && (!s.b[1]) && (s.b[2]) && (s.c[0]) && (s.c[1]) && (s.c[2]) )
+ gray=1.0;
+ else
+ gray =0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag
new file mode 100644
index 0000000000..50c29bf575
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(1.0, 2.0, 4.0, 8.0);
+ gl_FragColor = vec4(vec3((s.a + s.b + s.c + s.d) / 15.0), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert
new file mode 100644
index 0000000000..27ad8c0fde
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_float_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(1.0, 2.0, 4.0, 8.0);
+ color = vec4(vec3((s.a + s.b + s.c + s.d) / 15.0), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag
new file mode 100644
index 0000000000..043c948f4d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ mat2 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) );
+ gl_FragColor = vec4( vec3( (s.a[0][0] + s.a[0][1] + s.a[1][0] + s.a[1][1]) / 80.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert
new file mode 100644
index 0000000000..6298630d07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat2_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ mat2 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) );
+ color = vec4( vec3( (s.a[0][0] + s.a[0][1] + s.a[1][0] + s.a[1][1]) / 80.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag
new file mode 100644
index 0000000000..1caa22aa7b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_frag.frag
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ mat3 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) );
+ float sum=0.0;
+ int i,j;
+
+ sum = sum + s.a[0][0];
+ sum = sum + s.a[0][1];
+ sum = sum + s.a[0][2];
+ sum = sum + s.a[1][0];
+ sum = sum + s.a[1][1];
+ sum = sum + s.a[1][2];
+ sum = sum + s.a[2][0];
+ sum = sum + s.a[2][1];
+ sum = sum + s.a[2][2];
+
+ gl_FragColor = vec4( vec3( sum / 550.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert
new file mode 100644
index 0000000000..f2880dc29d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat3_vert.vert
@@ -0,0 +1,37 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ mat3 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) );
+ float sum=0.0;
+
+ sum = sum + s.a[0][0];
+ sum = sum + s.a[0][1];
+ sum = sum + s.a[0][2];
+
+ sum = sum + s.a[1][0];
+ sum = sum + s.a[1][1];
+ sum = sum + s.a[1][2];
+
+ sum = sum + s.a[2][0];
+ sum = sum + s.a[2][1];
+ sum = sum + s.a[2][2];
+
+ color = vec4( vec3( sum / 550.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag
new file mode 100644
index 0000000000..bfb6fe1918
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ mat4 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0,
+ 71.0, 63.0, 90.0, 118.0,
+ 128.0, 44.0, 57.0, 143.0,
+ 151.0, 14.0, 15.0, 21.0 ) );
+ float sum=0.0;
+ int i,j;
+
+ sum = sum + s.a[0][0];
+ sum = sum + s.a[0][1];
+ sum = sum + s.a[0][2];
+ sum = sum + s.a[0][3];
+ sum = sum + s.a[1][0];
+ sum = sum + s.a[1][1];
+ sum = sum + s.a[1][2];
+ sum = sum + s.a[1][3];
+ sum = sum + s.a[2][0];
+ sum = sum + s.a[2][1];
+ sum = sum + s.a[2][2];
+ sum = sum + s.a[2][3];
+ sum = sum + s.a[3][0];
+ sum = sum + s.a[3][1];
+ sum = sum + s.a[3][2];
+ sum = sum + s.a[3][3];
+
+ gl_FragColor = vec4( vec3( sum / 995.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert
new file mode 100644
index 0000000000..5f21dea131
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_mat4_vert.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ mat4 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0,
+ 71.0, 63.0, 90.0, 118.0,
+ 128.0, 44.0, 57.0, 143.0,
+ 151.0, 14.0, 15.0, 21.0 ) );
+ float sum=0.0;
+
+ sum = sum + s.a[0][0];
+ sum = sum + s.a[0][1];
+ sum = sum + s.a[0][2];
+ sum = sum + s.a[0][3];
+
+ sum = sum + s.a[1][0];
+ sum = sum + s.a[1][1];
+ sum = sum + s.a[1][2];
+ sum = sum + s.a[1][3];
+
+ sum = sum + s.a[2][0];
+ sum = sum + s.a[2][1];
+ sum = sum + s.a[2][2];
+ sum = sum + s.a[2][3];
+
+ sum = sum + s.a[3][0];
+ sum = sum + s.a[3][1];
+ sum = sum + s.a[3][2];
+ sum = sum + s.a[3][3];
+
+ color = vec4( vec3( sum / 995.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag
new file mode 100644
index 0000000000..1e8e54360d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ vec2 a;
+ vec2 b;
+};
+
+
+void main (void)
+{
+ sabcd s = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) );
+
+ gl_FragColor = vec4( vec3( (s.a[0] + s.a[1] + s.b[0] + s.b[1]) / 80.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert
new file mode 100644
index 0000000000..b7c7588767
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec2_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ vec2 a;
+ vec2 b;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) );
+ color = vec4( vec3( (s.a[0] + s.a[1] + s.b[0] + s.b[1]) / 80.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag
new file mode 100644
index 0000000000..aba8516a94
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ vec3 a;
+ vec3 b;
+};
+
+
+void main (void)
+{
+ sabcd s = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) );
+
+ gl_FragColor = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.b[0] + s.b[1] + s.b[2]) / 150.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert
new file mode 100644
index 0000000000..09c5bb54c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec3_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ vec3 a;
+ vec3 b;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) );
+ color = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.b[0] + s.b[1] + s.b[2]) / 150.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag
new file mode 100644
index 0000000000..3d03168955
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ vec4 a;
+ vec4 b;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) );
+ gl_FragColor = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.a[3] + s.b[0] + s.b[1] + s.b[2] + s.b[3]) / 250.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert
new file mode 100644
index 0000000000..3cd7d37047
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/struct_vec4_vert.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ vec4 a;
+ vec4 b;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) );
+ color = vec4( vec3( (s.a[0] + s.a[1] + s.a[2] + s.a[3] + s.b[0] + s.b[1] + s.b[2] + s.b[3]) / 250.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag
new file mode 100644
index 0000000000..39e2a1054b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_frag.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ bool a;
+ bool b;
+ bool c;
+ bool d;
+};
+
+
+
+void main (void)
+{
+ sabcd s1 = sabcd(bool(12), bool(0), bool(25.5), bool(0.0));
+ sabcd s2 = sabcd(bool(0.0), bool(0.0), bool(0.0), bool(0.0));
+ s2 = s1;
+ float gray = 0.0;
+ if( (s2.a==true) && (s2.b==false) && (s2.c == true) && (s2.d==false))
+ gray=1.0;
+ else
+ gray =0.0;
+ gl_FragColor = vec4(gray,gray,gray,1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert
new file mode 100644
index 0000000000..7149f8848c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bool_vert.vert
@@ -0,0 +1,38 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ bool a;
+ bool b;
+ bool c;
+ bool d;
+};
+
+
+
+void main (void)
+{
+ sabcd s1 = sabcd(bool(12), bool(0), bool(25.5), bool(0.0));
+ sabcd s2 = sabcd(bool(0.0), bool(0.0), bool(0.0), bool(0.0));
+ s2 = s1;
+ float gray = 0.0;
+ if( (s2.a==true) && (s2.b==false) && (s2.c == true) && (s2.d==false))
+ gray=1.0;
+ else
+ gray =0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag
new file mode 100644
index 0000000000..d30d390c81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_frag.frag
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ bvec2 a;
+ bvec3 b;
+ bvec4 c;
+};
+
+void main (void)
+{
+ sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) );
+ sabcd s2 = sabcd( bvec2(0, 0), bvec3(0.0, 0.0, 0.0), bvec4(0.0, 0.0, 0.0, 0.0 ) );
+ s2 = s;
+ float gray = 0.0;
+ if( (s2.a[0]) && (s2.a[1]) && (s2.b[0]) && (!s2.b[1]) && (s2.b[2]) && (s2.c[0]) && (s2.c[1]) && (s2.c[2]) )
+ gray=1.0;
+ else
+ gray =0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert
new file mode 100644
index 0000000000..24f3981d03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_bvec2bvec3bvec4_vert.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ bvec2 a;
+ bvec3 b;
+ bvec4 c;
+};
+
+void main (void)
+{
+ sabcd s = sabcd( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ) );
+ sabcd s2 = sabcd( bvec2(0, 0), bvec3(0.0, 0.0, 0.0), bvec4(0.0, 0.0, 0.0, 0.0 ) );
+ s2 = s;
+ float gray = 0.0;
+ if( (s2.a[0]) && (s2.a[1]) && (s2.b[0]) && (!s2.b[1]) && (s2.b[2]) && (s2.c[0]) && (s2.c[1]) && (s2.c[2]) && (s2.c[3]) )
+ gray=1.0;
+ else
+ gray =0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag
new file mode 100644
index 0000000000..de34d38e48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_frag.frag
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(1.0, 2.0, 4.0, 8.0);
+ sabcd s2 = sabcd(0.0, 0.0, 0.0, 0.0);
+ s2 = s;
+ gl_FragColor = vec4((s.a + s.b + s.c + s.d) / 15.0, (s2.a + s2.b + s2.c + s2.d) / 15.0, 1.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert
new file mode 100644
index 0000000000..baf2c7afe7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_float_vert.vert
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ float a;
+ float b;
+ float c;
+ float d;
+};
+
+
+
+void main (void)
+{
+ sabcd s = sabcd(1.0, 2.0, 4.0, 8.0);
+ sabcd s2 = sabcd(0.0, 0.0, 0.0, 0.0);
+ s2 = s;
+ color = vec4((s.a + s.b + s.c + s.d) / 15.0, (s2.a + s2.b + s2.c + s2.d) / 15.0, 1.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag
new file mode 100644
index 0000000000..78de99d99b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_frag.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ mat2 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) );
+ sabcd s2 = sabcd(mat2(0.0, 0.0, 0.0, 0.0) );
+ s2 = s;
+ gl_FragColor = vec4( vec3( (s2.a[0][0] + s2.a[0][1] + s2.a[1][0] + s2.a[1][1]) / 80.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert
new file mode 100644
index 0000000000..1f7222178a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat2_vert.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ mat2 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat2(12.0, 29.0, 13.0, 26.0) );
+ sabcd s2 = sabcd(mat2(0.0, 0.0, 0.0, 0.0) );
+ s2 = s;
+ color = vec4( vec3( (s2.a[0][0] + s2.a[0][1] + s2.a[1][0] + s2.a[1][1]) / 80.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag
new file mode 100644
index 0000000000..fe7c54f2e2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_frag.frag
@@ -0,0 +1,38 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ mat3 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) );
+ sabcd s2 = sabcd(mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
+ s2 = s;
+ float sum=0.0;
+ int i,j;
+
+ sum = sum + s2.a[0][0];
+ sum = sum + s2.a[0][1];
+ sum = sum + s2.a[0][2];
+ sum = sum + s2.a[1][0];
+ sum = sum + s2.a[1][1];
+ sum = sum + s2.a[1][2];
+ sum = sum + s2.a[2][0];
+ sum = sum + s2.a[2][1];
+ sum = sum + s2.a[2][2];
+
+ gl_FragColor = vec4( vec3( sum / 550.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert
new file mode 100644
index 0000000000..c836dc75eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat3_vert.vert
@@ -0,0 +1,39 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ mat3 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat3(12.0, 29.0, 13.0, 26.0, 71.0, 63.0, 90.0, 118.0, 128.0) );
+ sabcd s2 = sabcd(mat3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) );
+ s2 = s;
+ float sum=0.0;
+
+ sum = sum + s2.a[0][0];
+ sum = sum + s2.a[0][1];
+ sum = sum + s2.a[0][2];
+
+ sum = sum + s2.a[1][0];
+ sum = sum + s2.a[1][1];
+ sum = sum + s2.a[1][2];
+
+ sum = sum + s2.a[2][0];
+ sum = sum + s2.a[2][1];
+ sum = sum + s2.a[2][2];
+
+ color = vec4( vec3( sum / 550.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag
new file mode 100644
index 0000000000..ab3c925fa9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_frag.frag
@@ -0,0 +1,51 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ mat4 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0,
+ 71.0, 63.0, 90.0, 118.0,
+ 128.0, 44.0, 57.0, 143.0,
+ 151.0, 14.0, 15.0, 21.0 ) );
+ sabcd s2 = sabcd(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 ) );
+ s2 = s;
+ float sum=0.0;
+ int i,j;
+
+ sum = sum + s2.a[0][0];
+ sum = sum + s2.a[0][1];
+ sum = sum + s2.a[0][2];
+ sum = sum + s2.a[0][3];
+ sum = sum + s2.a[1][0];
+ sum = sum + s2.a[1][1];
+ sum = sum + s2.a[1][2];
+ sum = sum + s2.a[1][3];
+ sum = sum + s2.a[2][0];
+ sum = sum + s2.a[2][1];
+ sum = sum + s2.a[2][2];
+ sum = sum + s2.a[2][3];
+ sum = sum + s2.a[3][0];
+ sum = sum + s2.a[3][1];
+ sum = sum + s2.a[3][2];
+ sum = sum + s2.a[3][3];
+
+ gl_FragColor = vec4( vec3( sum / 995.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert
new file mode 100644
index 0000000000..fdb5a889fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_mat4_vert.vert
@@ -0,0 +1,53 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ mat4 a;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(mat4(12.0, 29.0, 13.0, 26.0,
+ 71.0, 63.0, 90.0, 118.0,
+ 128.0, 44.0, 57.0, 143.0,
+ 151.0, 14.0, 15.0, 21.0 ) );
+ sabcd s2 = sabcd(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 ) );
+ s2 = s;
+ float sum=0.0;
+
+ sum = sum + s2.a[0][0];
+ sum = sum + s2.a[0][1];
+ sum = sum + s2.a[0][2];
+ sum = sum + s2.a[0][3];
+
+ sum = sum + s2.a[1][0];
+ sum = sum + s2.a[1][1];
+ sum = sum + s2.a[1][2];
+ sum = sum + s2.a[1][3];
+
+ sum = sum + s2.a[2][0];
+ sum = sum + s2.a[2][1];
+ sum = sum + s2.a[2][2];
+ sum = sum + s2.a[2][3];
+
+ sum = sum + s2.a[3][0];
+ sum = sum + s2.a[3][1];
+ sum = sum + s2.a[3][2];
+ sum = sum + s2.a[3][3];
+
+ color = vec4( vec3( sum / 995.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag
new file mode 100644
index 0000000000..9acaeaa23f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_frag.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ vec2 a;
+ vec2 b;
+};
+
+
+void main (void)
+{
+ sabcd s1 = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) );
+ sabcd s2 = sabcd(vec2(0.0, 0.0), vec2(0.0, 0.0) );
+ s2 = s1;
+ gl_FragColor = vec4( vec3( (s2.a[0] + s2.a[1] + s2.b[0] + s2.b[1]) / 80.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert
new file mode 100644
index 0000000000..54f7de5b5e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec2_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ vec2 a;
+ vec2 b;
+};
+
+
+
+void main (void)
+{
+ sabcd s1 = sabcd(vec2(12.0, 29.0), vec2(13.0, 26.0) );
+ sabcd s2 = sabcd(vec2(0.0, 0.0), vec2(0.0, 0.0) );
+ s2 = s1;
+ color = vec4( vec3( (s2.a[0] + s2.a[1] + s2.b[0] + s2.b[1]) / 80.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag
new file mode 100644
index 0000000000..cd3f12ccb1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_frag.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct sabcd
+{
+ vec3 a;
+ vec3 b;
+};
+
+
+void main (void)
+{
+ sabcd s = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) );
+ sabcd s2 = sabcd(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0 ) );
+ s2 = s;
+ gl_FragColor = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.b[0] + s2.b[1] + s2.b[2]) / 150.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert
new file mode 100644
index 0000000000..eeddebe2ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec3_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+
+
+struct sabcd
+{
+ vec3 a;
+ vec3 b;
+};
+
+
+
+void main (void)
+{
+ sabcd s1 = sabcd(vec3(12.0, 29.0, 32.0), vec3(13.0, 26.0, 38.0 ) );
+ sabcd s2 = sabcd(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0 ) );
+ s2 = s1;
+ color = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.b[0] + s2.b[1] + s2.b[2]) / 150.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag
new file mode 100644
index 0000000000..bf02e6cd61
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_frag.frag
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct sabcd
+{
+ vec4 a;
+ vec4 b;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) );
+ sabcd s2 = sabcd(vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0 ) );
+ s2 = s;
+ gl_FragColor = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.a[3] + s2.b[0] + s2.b[1] + s2.b[2] + s2.b[3]) / 250.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert
new file mode 100644
index 0000000000..af30524ed2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structcopy_vec4_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct sabcd
+{
+ vec4 a;
+ vec4 b;
+};
+
+void main (void)
+{
+ sabcd s = sabcd(vec4(12.0, 29.0, 32.0, 47.0), vec4(13.0, 26.0, 38.0, 53.0 ) );
+ sabcd s2 = sabcd(vec4(0.0, 0.0, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0 ) );
+ s2 = s;
+ color = vec4( vec3( (s2.a[0] + s2.a[1] + s2.a[2] + s2.a[3] + s2.b[0] + s2.b[1] + s2.b[2] + s2.b[3]) / 250.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag
new file mode 100644
index 0000000000..74c30e5103
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_frag.frag
@@ -0,0 +1,38 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ bool b;
+};
+
+struct nesta
+{
+ bool a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(bool(1.0), nestb(bool(0.0))));
+ float gray = 0.0;
+
+ if( (s.nest_a.a == true) && (s.nest_a.nest_b.b == false))
+ gray=1.0;
+ else
+ gray =0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert
new file mode 100644
index 0000000000..3cfc2cf722
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bool_vert.vert
@@ -0,0 +1,41 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ bool b;
+};
+
+struct nesta
+{
+ bool a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(bool(1.0), nestb(bool(0.0))));
+ float gray = 0.0;
+
+ if( (s.nest_a.a == true) && (s.nest_a.nest_b.b == false))
+ gray=1.0;
+ else
+ gray =0.0;
+ color = vec4(gray, gray, gray, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag
new file mode 100644
index 0000000000..d4515dbd2f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_frag.frag
@@ -0,0 +1,54 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+struct nestb
+{
+ bvec2 a2;
+ bvec3 b2;
+ bvec4 c2;
+};
+
+struct nesta
+{
+ bvec2 a1;
+ bvec3 b1;
+ bvec4 c1;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest( nesta( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ),
+ nestb( bvec2(28, 0), bvec3(0.0, 0.0, 1.0), bvec4(0.0, 17.0, 145, 0 )
+ )
+ )
+ );
+ float gray = 0.0;
+ if( ( s.nest_a.a1[0] ) && ( s.nest_a.a1[1] ) &&
+ ( s.nest_a.b1[0] ) && (! (s.nest_a.b1[1]) ) && ( s.nest_a.b1[2] ) &&
+ ( s.nest_a.c1[0] ) && ( s.nest_a.c1[1] ) && ( s.nest_a.c1[2] ) && ( s.nest_a.c1[3] ) &&
+ ( s.nest_a.nest_b.a2[0] ) && ( !( s.nest_a.nest_b.a2[1] ) ) &&
+ (! ( s.nest_a.nest_b.b2[0] ) ) && (! ( s.nest_a.nest_b.b2[1] ) ) && (s.nest_a.nest_b.b2[2]) &&
+ (! ( s.nest_a.nest_b.c2[0] ) ) && (s.nest_a.nest_b.c2[1]) && (s.nest_a.nest_b.c2[2]) && (! ( s.nest_a.nest_b.c2[3] ) )
+ )
+ gray=1.0;
+ else
+ gray =0.0;
+
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert
new file mode 100644
index 0000000000..c0ca10fc08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_bvec2bvec3bvec4_vert.vert
@@ -0,0 +1,57 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ bvec2 a2;
+ bvec3 b2;
+ bvec4 c2;
+};
+
+struct nesta
+{
+ bvec2 a1;
+ bvec3 b1;
+ bvec4 c1;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+
+ nest s = nest( nesta( bvec2(12, 13), bvec3(14.0, 0.0, 139.0), bvec4(25.5, 17.0, 145, 163 ),
+ nestb( bvec2(28, 0), bvec3(0.0, 0.0, 1.0), bvec4(0.0, 17.0, 145, 0 )
+ )
+ )
+ );
+
+ float gray = 0.0;
+
+ if( ( s.nest_a.a1[0] ) && ( s.nest_a.a1[1] ) &&
+ ( s.nest_a.b1[0] ) && (! (s.nest_a.b1[1]) ) && ( s.nest_a.b1[2] ) &&
+ ( s.nest_a.c1[0] ) && ( s.nest_a.c1[1] ) && ( s.nest_a.c1[2] ) && ( s.nest_a.c1[3] ) &&
+ ( s.nest_a.nest_b.a2[0] ) && ( !( s.nest_a.nest_b.a2[1] ) ) &&
+ (! ( s.nest_a.nest_b.b2[0] ) ) && (! ( s.nest_a.nest_b.b2[1] ) ) && (s.nest_a.nest_b.b2[2]) &&
+ (! ( s.nest_a.nest_b.c2[0] ) ) && (s.nest_a.nest_b.c2[1]) && (s.nest_a.nest_b.c2[2]) && (! ( s.nest_a.nest_b.c2[3] ) )
+ )
+ gray=1.0;
+ else
+ gray =0.0;
+ color = vec4(gray, gray, gray, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag
new file mode 100644
index 0000000000..b914193aa1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_frag.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ float b;
+};
+
+struct nesta
+{
+ float a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(1.0, nestb(2.0)));
+ gl_FragColor = vec4(vec3((s.nest_a.a + s.nest_a.nest_b.b) / 3.0), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert
new file mode 100644
index 0000000000..98436ea212
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_float_vert.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ float b;
+};
+
+struct nesta
+{
+ float a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(1.0, nestb(2.0)));
+ color = vec4(vec3((s.nest_a.a + s.nest_a.nest_b.b) / 3.0), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag
new file mode 100644
index 0000000000..9b16175271
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_frag.frag
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ mat2 b;
+};
+
+struct nesta
+{
+ mat2 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta( mat2(11, 13, 29, 33), nestb( mat2(12, 19, 79, 81) ) ) );
+
+
+ gl_FragColor = vec4( vec3( (s.nest_a.a[0][0] + s.nest_a.a[0][1] + s.nest_a.a[1][0] + s.nest_a.a[1][1] + s.nest_a.nest_b.b[0][0] + s.nest_a.nest_b.b[0][1] + s.nest_a.nest_b.b[1][0] + s.nest_a.nest_b.b[1][1] ) / 277.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert
new file mode 100644
index 0000000000..1aae92236d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat2_vert.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ mat2 b;
+};
+
+struct nesta
+{
+ mat2 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta( mat2(11, 13, 29, 33), nestb( mat2(12, 19, 79, 81) ) ) );
+ color = vec4( vec3( (s.nest_a.a[0][0] + s.nest_a.a[0][1] + s.nest_a.a[1][0] + s.nest_a.a[1][1] + s.nest_a.nest_b.b[0][0] + s.nest_a.nest_b.b[0][1] + s.nest_a.nest_b.b[1][0] + s.nest_a.nest_b.b[1][1] ) / 277.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag
new file mode 100644
index 0000000000..407981499c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_frag.frag
@@ -0,0 +1,62 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ mat3 b;
+};
+
+struct nesta
+{
+ mat3 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta( mat3(11, 13, 29, 33, 63, 13, 49, 57, 71), nestb( mat3(12, 19, 79, 81, 35, 51, 73, 66, 23) ) ) );
+ float sum1=0.0,sum2=0.0;
+ int i,j;
+
+ sum1 = sum1 + s.nest_a.a[0][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][0];
+
+ sum1 = sum1 + s.nest_a.a[0][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][1];
+
+ sum1 = sum1 + s.nest_a.a[0][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][2];
+
+ sum1 = sum1 + s.nest_a.a[1][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][0];
+
+ sum1 = sum1 + s.nest_a.a[1][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][1];
+
+ sum1 = sum1 + s.nest_a.a[1][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][2];
+
+ sum1 = sum1 + s.nest_a.a[2][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][0];
+
+ sum1 = sum1 + s.nest_a.a[2][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][1];
+
+ sum1 = sum1 + s.nest_a.a[2][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][2];
+
+ gl_FragColor = vec4( vec3( ( sum1 + sum2 )/ 778.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert
new file mode 100644
index 0000000000..4870801b7d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat3_vert.vert
@@ -0,0 +1,57 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ mat3 b;
+};
+
+struct nesta
+{
+ mat3 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta( mat3(11, 13, 29, 33, 63, 13, 49, 57, 71), nestb( mat3(12, 19, 79, 81, 35, 51, 73, 66, 23) ) ) );
+ float sum1=0.0,sum2=0.0;
+
+ sum1 = sum1 + s.nest_a.a[0][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][0];
+ sum1 = sum1 + s.nest_a.a[0][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][1];
+ sum1 = sum1 + s.nest_a.a[0][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][2];
+
+ sum1 = sum1 + s.nest_a.a[1][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][0];
+ sum1 = sum1 + s.nest_a.a[1][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][1];
+ sum1 = sum1 + s.nest_a.a[1][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][2];
+
+ sum1 = sum1 + s.nest_a.a[2][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][0];
+ sum1 = sum1 + s.nest_a.a[2][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][1];
+ sum1 = sum1 + s.nest_a.a[2][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][2];
+
+ color = vec4( vec3( ( sum1 + sum2 )/ 778.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag
new file mode 100644
index 0000000000..147b8c5ba4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_frag.frag
@@ -0,0 +1,83 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ mat4 b;
+};
+
+struct nesta
+{
+ mat4 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta( mat4(11, 13, 29, 33, 63, 13, 49, 57, 71, 47, 91, 101, 167, 21, 39, 41), nestb( mat4(12, 19, 79, 81, 35, 51, 73, 66, 23, 134, 121, 156, 76, 23, 24, 78) ) ) );
+ float sum1=0.0,sum2=0.0;
+ int i,j;
+
+ sum1 = sum1 + s.nest_a.a[0][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][0];
+
+ sum1 = sum1 + s.nest_a.a[0][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][1];
+
+ sum1 = sum1 + s.nest_a.a[0][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][2];
+
+ sum1 = sum1 + s.nest_a.a[0][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][3];
+
+ sum1 = sum1 + s.nest_a.a[1][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][0];
+
+ sum1 = sum1 + s.nest_a.a[1][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][1];
+
+ sum1 = sum1 + s.nest_a.a[1][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][2];
+
+ sum1 = sum1 + s.nest_a.a[1][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][3];
+
+ sum1 = sum1 + s.nest_a.a[2][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][0];
+
+ sum1 = sum1 + s.nest_a.a[2][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][1];
+
+ sum1 = sum1 + s.nest_a.a[2][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][2];
+
+ sum1 = sum1 + s.nest_a.a[2][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][3];
+
+ sum1 = sum1 + s.nest_a.a[3][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][0];
+
+ sum1 = sum1 + s.nest_a.a[3][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][1];
+
+ sum1 = sum1 + s.nest_a.a[3][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][2];
+
+ sum1 = sum1 + s.nest_a.a[3][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][3];
+
+ gl_FragColor = vec4( vec3( ( sum1 + sum2 )/ 1897.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert
new file mode 100644
index 0000000000..b6bd4a21d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_mat4_vert.vert
@@ -0,0 +1,72 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ mat4 b;
+};
+
+struct nesta
+{
+ mat4 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta( mat4(11, 13, 29, 33, 63, 13, 49, 57, 71, 47, 91, 101, 167, 21, 39, 41), nestb( mat4(12, 19, 79, 81, 35, 51, 73, 66, 23, 134, 121, 156, 76, 23, 24, 78) ) ) );
+ float sum1=0.0,sum2=0.0;
+
+ sum1 = sum1 + s.nest_a.a[0][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][0];
+ sum1 = sum1 + s.nest_a.a[0][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][1];
+ sum1 = sum1 + s.nest_a.a[0][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][2];
+ sum1 = sum1 + s.nest_a.a[0][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[0][3];
+
+ sum1 = sum1 + s.nest_a.a[1][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][0];
+ sum1 = sum1 + s.nest_a.a[1][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][1];
+ sum1 = sum1 + s.nest_a.a[1][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][2];
+ sum1 = sum1 + s.nest_a.a[1][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[1][3];
+
+ sum1 = sum1 + s.nest_a.a[2][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][0];
+ sum1 = sum1 + s.nest_a.a[2][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][1];
+ sum1 = sum1 + s.nest_a.a[2][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][2];
+ sum1 = sum1 + s.nest_a.a[2][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[2][3];
+
+ sum1 = sum1 + s.nest_a.a[3][0];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][0];
+ sum1 = sum1 + s.nest_a.a[3][1];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][1];
+ sum1 = sum1 + s.nest_a.a[3][2];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][2];
+ sum1 = sum1 + s.nest_a.a[3][3];
+ sum2 = sum2 + s.nest_a.nest_b.b[3][3];
+
+ color = vec4( vec3( ( sum1 + sum2 )/ 1897.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag
new file mode 100644
index 0000000000..e59911fec9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_frag.frag
@@ -0,0 +1,33 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ vec2 b;
+};
+
+struct nesta
+{
+ vec2 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(vec2(11, 13), nestb(vec2(12, 19) ) ) );
+
+ gl_FragColor = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] ) / 55.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert
new file mode 100644
index 0000000000..b7a6bfd88c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec2_vert.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ vec2 b;
+};
+
+struct nesta
+{
+ vec2 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(vec2(11, 13), nestb(vec2(12, 19) ) ) );
+ color = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] ) / 55.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag
new file mode 100644
index 0000000000..fa650ac2ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_frag.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ vec3 b;
+};
+
+struct nesta
+{
+ vec3 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(vec3(11, 13, 17), nestb(vec3(12, 19, 29) ) ) );
+ gl_FragColor = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2]) / 101.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert
new file mode 100644
index 0000000000..6d9247639d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec3_vert.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ vec3 b;
+};
+
+struct nesta
+{
+ vec3 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(vec3(11, 13, 17), nestb(vec3(12, 19, 29) ) ) );
+ color = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2]) / 101.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag
new file mode 100644
index 0000000000..bdd595424b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_frag.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+struct nestb
+{
+ vec4 b;
+};
+
+struct nesta
+{
+ vec4 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(vec4(11, 13, 17, 31), nestb(vec4(12, 19, 29, 69) ) ) );
+ gl_FragColor = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.a[3] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2] + s.nest_a.nest_b.b[3]) / 201.0 ), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert
new file mode 100644
index 0000000000..46fad09a83
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/struct/structnest_vec4_vert.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+struct nestb
+{
+ vec4 b;
+};
+
+struct nesta
+{
+ vec4 a;
+ nestb nest_b;
+};
+
+struct nest
+{
+ nesta nest_a;
+};
+
+void main (void)
+{
+ nest s = nest(nesta(vec4(11, 13, 17, 31), nestb(vec4(12, 19, 29, 69) ) ) );
+ color = vec4( vec3( (s.nest_a.a[0] + s.nest_a.a[1] + s.nest_a.a[2] + s.nest_a.a[3] + s.nest_a.nest_b.b[0] + s.nest_a.nest_b.b[1] + s.nest_a.nest_b.b[2] + s.nest_a.nest_b.b[3]) / 201.0 ), 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt
new file mode 100644
index 0000000000..11fe45566a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/input.run.txt
@@ -0,0 +1,16 @@
+# this file is auto-generated. DO NOT EDIT.
+swizzlers_001_to_008.html
+swizzlers_009_to_016.html
+swizzlers_017_to_024.html
+swizzlers_025_to_032.html
+swizzlers_033_to_040.html
+swizzlers_041_to_048.html
+swizzlers_049_to_056.html
+swizzlers_057_to_064.html
+swizzlers_065_to_072.html
+swizzlers_073_to_080.html
+swizzlers_081_to_088.html
+swizzlers_089_to_096.html
+swizzlers_097_to_104.html
+swizzlers_105_to_112.html
+swizzlers_113_to_120.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html
new file mode 100644
index 0000000000..3331c6a6cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_001_to_008.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_xyzw_1vec4_frag.frag"
+ },
+ "name": "vec4_xyzw_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_xyzw_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_xyzw_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_zwxy_1vec4_frag.frag"
+ },
+ "name": "vec4_zwxy_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_zwxy_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_zwxy_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_yxwz_1vec4_frag.frag"
+ },
+ "name": "vec4_yxwz_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_yxwz_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_yxwz_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_wxzy_1vec4_frag.frag"
+ },
+ "name": "vec4_wxzy_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_wxzy_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_wxzy_1vec4_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html
new file mode 100644
index 0000000000..74677ea969
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_009_to_016.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_xyz_w_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_xyz_w_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_xyz_w_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_xyz_w_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_zwx_y_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_zwx_y_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_zwx_y_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_zwx_y_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_yxw_z_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_yxw_z_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_yxw_z_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_yxw_z_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_wxz_y_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_wxz_y_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_wxz_y_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_wxz_y_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html
new file mode 100644
index 0000000000..812c44ea48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_017_to_024.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_017_to_024.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_xy_zw_2vec2_frag.frag"
+ },
+ "name": "vec4_xy_zw_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_xy_zw_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_xy_zw_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_zx_wy_2vec2_frag.frag"
+ },
+ "name": "vec4_zx_wy_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_zx_wy_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_zx_wy_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_yx_wz_2vec2_frag.frag"
+ },
+ "name": "vec4_yx_wz_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_yx_wz_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_yx_wz_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_wx_zy_2vec2_frag.frag"
+ },
+ "name": "vec4_wx_zy_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_wx_zy_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_wx_zy_2vec2_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html
new file mode 100644
index 0000000000..6dd61f8f61
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_025_to_032.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_025_to_032.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_x_y_z_w_4float_frag.frag"
+ },
+ "name": "vec4_x_y_z_w_4float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_x_y_z_w_4float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_x_y_z_w_4float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_xyz_1vec3_frag.frag"
+ },
+ "name": "vec3_xyz_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_xyz_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_xyz_1vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_yxz_1vec3_frag.frag"
+ },
+ "name": "vec3_yxz_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_yxz_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_yxz_1vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_zyx_1vec3_frag.frag"
+ },
+ "name": "vec3_zyx_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_zyx_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_zyx_1vec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html
new file mode 100644
index 0000000000..2352584bfd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_033_to_040.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_033_to_040.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_xy_z_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_xy_z_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_xy_z_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_xy_z_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_xz_y_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_xz_y_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_xz_y_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_xz_y_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_yz_x_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_yz_x_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_yz_x_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_yz_x_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_zx_y_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_zx_y_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_zx_y_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_zx_y_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html
new file mode 100644
index 0000000000..8f6ae6e13b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_041_to_048.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_041_to_048.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_rgba_1vec4_frag.frag"
+ },
+ "name": "vec4_rgba_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_rgba_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_rgba_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_barg_1vec4_frag.frag"
+ },
+ "name": "vec4_barg_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_barg_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_barg_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_grab_1vec4_frag.frag"
+ },
+ "name": "vec4_grab_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_grab_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_grab_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_arbg_1vec4_frag.frag"
+ },
+ "name": "vec4_arbg_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_arbg_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_arbg_1vec4_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html
new file mode 100644
index 0000000000..0a0c5fb477
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_049_to_056.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_049_to_056.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_rgb_a_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_rgb_a_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_rgb_a_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_rgb_a_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_bar_g_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_bar_g_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_bar_g_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_bar_g_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_gra_b_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_gra_b_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_gra_b_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_gra_b_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_arb_g_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_arb_g_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_arb_g_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_arb_g_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html
new file mode 100644
index 0000000000..4418250007
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_057_to_064.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_057_to_064.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_rg_ba_2vec2_frag.frag"
+ },
+ "name": "vec4_rg_ba_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_rg_ba_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_rg_ba_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_br_ag_2vec2_frag.frag"
+ },
+ "name": "vec4_br_ag_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_br_ag_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_br_ag_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_gr_ab_2vec2_frag.frag"
+ },
+ "name": "vec4_gr_ab_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_gr_ab_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_gr_ab_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_ar_bg_2vec2_frag.frag"
+ },
+ "name": "vec4_ar_bg_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_ar_bg_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_ar_bg_2vec2_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html
new file mode 100644
index 0000000000..fcd80d4009
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_065_to_072.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_065_to_072.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_r_g_b_a_4float_frag.frag"
+ },
+ "name": "vec4_r_g_b_a_4float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_r_g_b_a_4float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_r_g_b_a_4float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_rgb_1vec3_frag.frag"
+ },
+ "name": "vec3_rgb_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_rgb_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_rgb_1vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_grb_1vec3_frag.frag"
+ },
+ "name": "vec3_grb_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_grb_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_grb_1vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_bgr_1vec3_frag.frag"
+ },
+ "name": "vec3_bgr_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_bgr_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_bgr_1vec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html
new file mode 100644
index 0000000000..7e23ef6f19
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_073_to_080.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_073_to_080.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_rg_b_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_rg_b_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_rg_b_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_rg_b_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_rb_g_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_rb_g_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_rb_g_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_rb_g_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_gb_r_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_gb_r_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_gb_r_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_gb_r_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_br_g_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_br_g_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_br_g_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_br_g_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html
new file mode 100644
index 0000000000..e9d888c8d6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_081_to_088.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_081_to_088.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_stpq_1vec4_frag.frag"
+ },
+ "name": "vec4_stpq_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_stpq_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_stpq_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_pqst_1vec4_frag.frag"
+ },
+ "name": "vec4_pqst_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_pqst_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_pqst_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_tsqp_1vec4_frag.frag"
+ },
+ "name": "vec4_tsqp_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_tsqp_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_tsqp_1vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_qspt_1vec4_frag.frag"
+ },
+ "name": "vec4_qspt_1vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_qspt_1vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_qspt_1vec4_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html
new file mode 100644
index 0000000000..24a16ba7d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_089_to_096.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_089_to_096.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_stp_q_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_stp_q_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_stp_q_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_stp_q_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_pqs_t_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_pqs_t_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_pqs_t_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_pqs_t_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_tsq_p_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_tsq_p_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_tsq_p_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_tsq_p_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_qsp_t_1vec3_1float_frag.frag"
+ },
+ "name": "vec4_qsp_t_1vec3_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_qsp_t_1vec3_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_qsp_t_1vec3_1float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html
new file mode 100644
index 0000000000..7d29fca4b9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_097_to_104.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_097_to_104.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_st_pq_2vec2_frag.frag"
+ },
+ "name": "vec4_st_pq_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_st_pq_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_st_pq_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_ps_qt_2vec2_frag.frag"
+ },
+ "name": "vec4_ps_qt_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_ps_qt_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_ps_qt_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_ts_qp_2vec2_frag.frag"
+ },
+ "name": "vec4_ts_qp_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_ts_qp_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_ts_qp_2vec2_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_qs_pt_2vec2_frag.frag"
+ },
+ "name": "vec4_qs_pt_2vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_qs_pt_2vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_qs_pt_2vec2_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html
new file mode 100644
index 0000000000..38d95f6232
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_105_to_112.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_105_to_112.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_s_t_p_q_4float_frag.frag"
+ },
+ "name": "vec4_s_t_p_q_4float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec4_s_t_p_q_4float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_s_t_p_q_4float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_stp_1vec3_frag.frag"
+ },
+ "name": "vec3_stp_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_stp_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_stp_1vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_tsp_1vec3_frag.frag"
+ },
+ "name": "vec3_tsp_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_tsp_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_tsp_1vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_pts_1vec3_frag.frag"
+ },
+ "name": "vec3_pts_1vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_pts_1vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_pts_1vec3_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html
new file mode 100644
index 0000000000..f62ab3800f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/swizzlers_113_to_120.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: swizzlers_113_to_120.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_st_p_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_st_p_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_st_p_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_st_p_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_sp_t_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_sp_t_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_sp_t_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_sp_t_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_tp_s_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_tp_s_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_tp_s_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_tp_s_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_ps_t_1vec2_1float_frag.frag"
+ },
+ "name": "vec3_ps_t_1vec2_1float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "vec3_ps_t_1vec2_1float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_ps_t_1vec2_1float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag
new file mode 100644
index 0000000000..a2776d9430
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ vec3 t = m.bgr;
+ vec4 a = vec4(t.b, t.g, t.r ,al.a);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert
new file mode 100644
index 0000000000..3bf609e92a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_bgr_1vec3_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ vec3 t = m.bgr;
+ vec4 a = vec4(t.b, t.g, t.r, lightloc.a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..037da28f85
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ float k = m.g;
+ vec2 n = m.br;
+ vec4 a = vec4(n.g, k, n.r, al.a);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..7f638fd239
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_br_g_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ vec2 t = m.br;
+ float k = m.g;
+ vec4 a = vec4(t.g, k, t.r, lightloc.a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..372d722cf4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ float k = m.r;
+ vec2 n = m.gb;
+ vec4 a = vec4(k, n.r, n.g, al.a);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..b497ab3cb3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_gb_r_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ vec2 t = m.gb;
+ float k = m.r;
+ vec4 a = vec4(k, t.r, t.g, lightloc.a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag
new file mode 100644
index 0000000000..0e236aadd4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ vec3 t = m.grb;
+ vec4 a = vec4(t.g, t.r, t.b ,al.a);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert
new file mode 100644
index 0000000000..a1ad9dae56
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_grb_1vec3_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ vec3 t = m.grb;
+ vec4 a = vec4(t.g, t.r, t.b, lightloc.a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..3d207a26ad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ float k = m.t;
+ vec2 n = m.ps;
+ vec4 a = vec4(n.t, k, n.s, al.q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..3f17f0602b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_ps_t_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ vec2 t = m.ps;
+ float k = m.t;
+ vec4 a = vec4(t.t, k, t.s, lightloc.q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag
new file mode 100644
index 0000000000..308bbad045
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ vec3 t = m.pts;
+ vec4 a = vec4(t.p, t.t, t.s ,al.q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert
new file mode 100644
index 0000000000..6d1b1f1bf1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_pts_1vec3_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ vec3 t = m.pts;
+ vec4 a = vec4(t.p, t.t, t.s, lightloc.q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..a249894a26
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ float k = m.g;
+ vec2 n = m.rb;
+ vec4 a = vec4(n.r, k, n.g, al.a);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..95d3b9afd8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rb_g_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ vec2 t = m.rb;
+ float k = m.g;
+ vec4 a = vec4(t.r, k, t.g, lightloc.a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..8451056b91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ float k = m.b;
+ vec2 n = m.rg;
+ vec4 a = vec4(n, k, al.a);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..2a5386ad67
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rg_b_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ vec2 t = m.rg;
+ float k = m.b;
+ vec4 a = vec4(t, k, lightloc.a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag
new file mode 100644
index 0000000000..10df1fe982
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ vec4 a = vec4(m.rgb,al.a);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert
new file mode 100644
index 0000000000..6b8ab108d9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_rgb_1vec3_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ vec4 a = vec4(m.rgb,lightloc.a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..1a7a95d56d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ float k = m.t;
+ vec2 n = m.sp;
+ vec4 a = vec4(n.s, k, n.t, al.q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..5972e92745
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_sp_t_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ vec2 t = m.sp;
+ float k = m.t;
+ vec4 a = vec4(t.s, k, t.t, lightloc.q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..e9259b0daf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ float k = m.p;
+ vec2 n = m.st;
+ vec4 a = vec4(n, k, al.q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..99ff032ee7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_st_p_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ vec2 t = m.st;
+ float k = m.p;
+ vec4 a = vec4(t, k, lightloc.q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag
new file mode 100644
index 0000000000..e0010e2ee1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ vec4 a = vec4(m.stp,al.q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert
new file mode 100644
index 0000000000..d73986f5c4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_stp_1vec3_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ vec4 a = vec4(m.stp,lightloc.q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..8ffdb56fd5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ float k = m.s;
+ vec2 n = m.tp;
+ vec4 a = vec4(k, n.s, n.t, al.q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..97f3814bbf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tp_s_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ vec2 t = m.tp;
+ float k = m.s;
+ vec4 a = vec4(k, t.s, t.t, lightloc.q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag
new file mode 100644
index 0000000000..6a72e98da7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ vec3 t = m.tsp;
+ vec4 a = vec4(t.t, t.s, t.p ,al.q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert
new file mode 100644
index 0000000000..010fd37584
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_tsp_1vec3_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ vec3 t = m.tsp;
+ vec4 a = vec4(t.t, t.s, t.p, lightloc.q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..09f2e91c54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ float k = m.z;
+ vec2 n = m.xy;
+ vec4 a = vec4(n, k, al.w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..9f55aa7865
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xy_z_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ vec2 t = m.xy;
+ float k = m.z;
+ vec4 a = vec4(t, k, lightloc.w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag
new file mode 100644
index 0000000000..f712b9115c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ vec4 a = vec4(m.xyz,al.w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert
new file mode 100644
index 0000000000..009b1b1279
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xyz_1vec3_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ vec4 a = vec4(m.xyz,lightloc.w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..1ad1201999
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ float k = m.y;
+ vec2 n = m.xz;
+ vec4 a = vec4(n.x, k, n.y, al.w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..c316eb2883
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_xz_y_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ vec2 t = m.xz;
+ float k = m.y;
+ vec4 a = vec4(t.x, k, t.y, lightloc.w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag
new file mode 100644
index 0000000000..8f0c4c8909
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ vec3 t = m.yxz;
+ vec4 a = vec4(t.y, t.x, t.z ,al.w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert
new file mode 100644
index 0000000000..0e821301e0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yxz_1vec3_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ vec3 t = m.yxz;
+ vec4 a = vec4(t.y, t.x, t.z, lightloc.w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..92a36a3c7c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ float k = m.x;
+ vec2 n = m.yz;
+ vec4 a = vec4(k, n.x, n.y, al.w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..63cffb9f00
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_yz_x_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ vec2 t = m.yz;
+ float k = m.x;
+ vec4 a = vec4(k, t.x, t.y, lightloc.w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag
new file mode 100644
index 0000000000..2da5e7a29d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_frag.frag
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ float k = m.y;
+ vec2 n = m.zx;
+ vec4 a = vec4(n.y, k, n.x, al.w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert
new file mode 100644
index 0000000000..d3ffff954b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zx_y_1vec2_1float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ vec2 t = m.zx;
+ float k = m.y;
+ vec4 a = vec4(t.y, k, t.x, lightloc.w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag
new file mode 100644
index 0000000000..ecb1a826a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ vec3 t = m.zyx;
+ vec4 a = vec4(t.z, t.y, t.x ,al.w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert
new file mode 100644
index 0000000000..b99908f3d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec3_zyx_1vec3_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ vec3 t = m.zyx;
+ vec4 a = vec4(t.z, t.y, t.x, lightloc.w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag
new file mode 100644
index 0000000000..ef69029678
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.ar;
+ vec2 n = al.bg;
+ vec4 a = vec4(m.g, n.g, n.r, m.r);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert
new file mode 100644
index 0000000000..61640a32ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ar_bg_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.ar;
+ vec2 n = lightloc.bg;
+ vec4 a = vec4(m.g, n.g, n.r, m.r);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..166b0e64c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.arb;
+ float g = al.g;
+ vec4 a = vec4(m.g, g, m.b, m.r);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..a89418a204
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arb_g_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.arb;
+ float g = lightloc.g;
+ vec4 a = vec4(m.g, g, m.b, m.r);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag
new file mode 100644
index 0000000000..8cbced527f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.arbg;
+ vec4 a = vec4(m.g, m.a, m.b, m.r);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert
new file mode 100644
index 0000000000..1da338eb80
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_arbg_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.arbg;
+ vec4 a = vec4(m.g, m.a, m.b, m.r);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..9c6ddb8d86
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.bar;
+ float g = al.g;
+ vec4 a = vec4(m.b, g, m.r, m.g);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..5d319a6932
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_bar_g_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.bar;
+ float g = lightloc.g;
+ vec4 a = vec4(m.b, g, m.r, m.g);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag
new file mode 100644
index 0000000000..c472bb1a20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.barg;
+ vec4 a = vec4(m.b, m.a, m.r, m.g);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert
new file mode 100644
index 0000000000..4b9fb8cb3c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_barg_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.barg;
+ vec4 a = vec4(m.b, m.a, m.r, m.g);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag
new file mode 100644
index 0000000000..684dd7bf2a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.br;
+ vec2 n = al.ag;
+ vec4 a = vec4(m.g, n.g, m.r, n.r);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert
new file mode 100644
index 0000000000..759aeebda8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_br_ag_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.br;
+ vec2 n = lightloc.ag;
+ vec4 a = vec4(m.g, n.g, m.r, n.r);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag
new file mode 100644
index 0000000000..75300c6d8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.gr;
+ vec2 n = al.ab;
+ vec4 a = vec4(m.g, m.r, n.g, n.r);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert
new file mode 100644
index 0000000000..5a329a7213
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gr_ab_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.gr;
+ vec2 n = lightloc.ab;
+ vec4 a = vec4(m.g, m.r, n.g, n.r);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..317a577627
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.gra;
+ float b = al.b;
+ vec4 a = vec4(m.g, m.r, b, m.b);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..43237d1aad
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_gra_b_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.gra;
+ float b = lightloc.b;
+ vec4 a = vec4(m.g, m.r, b, m.b);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag
new file mode 100644
index 0000000000..7ff712d481
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.grab;
+ vec4 a = vec4(m.g, m.r, m.a, m.b);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert
new file mode 100644
index 0000000000..07bf632f3c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_grab_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.grab;
+ vec4 a = vec4(m.g, m.r, m.a, m.b);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..6ffc5c8a36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.pqs;
+ float t = al.t;
+ vec4 a = vec4(m.p, t, m.s, m.t);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..52219ee965
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqs_t_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.pqs;
+ float t = lightloc.t;
+ vec4 a = vec4(m.p, t, m.s, m.t);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag
new file mode 100644
index 0000000000..47671ad158
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.pqst;
+ vec4 a = vec4(m.p, m.q, m.s, m.t);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert
new file mode 100644
index 0000000000..083ada8e3b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_pqst_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.pqst;
+ vec4 a = vec4(m.p, m.q, m.s, m.t);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag
new file mode 100644
index 0000000000..437ff91f76
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.ps;
+ vec2 n = al.qt;
+ vec4 a = vec4(m.t, n.t, m.s, n.s);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert
new file mode 100644
index 0000000000..4661630a8a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ps_qt_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.ps;
+ vec2 n = lightloc.qt;
+ vec4 a = vec4(m.t, n.t, m.s, n.s);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag
new file mode 100644
index 0000000000..12a1b7059b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.qs;
+ vec2 n = al.pt;
+ vec4 a = vec4(m.t, n.t, n.s, m.s);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert
new file mode 100644
index 0000000000..d6431ecc7c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qs_pt_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.qs;
+ vec2 n = lightloc.pt;
+ vec4 a = vec4(m.t, n.t, n.s, m.s);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..95ca6a056f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.qsp;
+ float t = al.t;
+ vec4 a = vec4(m.t, t, m.p, m.s);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..e49030cbfb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qsp_t_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.qsp;
+ float t = lightloc.t;
+ vec4 a = vec4(m.t, t, m.p, m.s);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag
new file mode 100644
index 0000000000..7573162261
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.qspt;
+ vec4 a = vec4(m.t, m.q, m.p, m.s);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert
new file mode 100644
index 0000000000..7f6c261151
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_qspt_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.qspt;
+ vec4 a = vec4(m.t, m.q, m.p, m.s);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag
new file mode 100644
index 0000000000..52fe031673
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ float r = al.r;
+ float g = al.g;
+ float b = al.b;
+ float a = al.a;
+ vec4 m = vec4(r,g,b,a);
+ gl_FragColor = m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert
new file mode 100644
index 0000000000..14c4866968
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_r_g_b_a_4float_vert.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ float r = lightloc.r;
+ float g = lightloc.g;
+ float b = lightloc.b;
+ float a = lightloc.a;
+ vec4 m = vec4(r, g, b, a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag
new file mode 100644
index 0000000000..4118f7ddf1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.rg;
+ vec2 n = al.ba;
+ vec4 a = vec4(m,n);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert
new file mode 100644
index 0000000000..ac954debff
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rg_ba_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.rg;
+ vec2 n = lightloc.ba;
+ vec4 a = vec4(m,n);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..92622af66a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.rgb;
+ float a = al.a;
+ vec4 b = vec4(m, a);
+ gl_FragColor = b;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..c55fb9fc87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgb_a_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.rgb;
+ float a = lightloc.a;
+ vec4 b = vec4(m, a);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * b;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag
new file mode 100644
index 0000000000..1ef518f324
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.rgba;
+ gl_FragColor = m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert
new file mode 100644
index 0000000000..2242839919
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_rgba_1vec4_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.rgba;
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag
new file mode 100644
index 0000000000..78819c9054
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ float s = al.s;
+ float t = al.t;
+ float p = al.p;
+ float q = al.q;
+ vec4 m = vec4(s,t,p,q);
+ gl_FragColor = m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert
new file mode 100644
index 0000000000..4f935e09b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_s_t_p_q_4float_vert.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ float s = lightloc.s;
+ float t = lightloc.t;
+ float p = lightloc.p;
+ float q = lightloc.q;
+ vec4 m = vec4(s, t, p, q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag
new file mode 100644
index 0000000000..da5f862976
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.st;
+ vec2 n = al.pq;
+ vec4 a = vec4(m,n);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert
new file mode 100644
index 0000000000..2209220d51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_st_pq_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.st;
+ vec2 n = lightloc.pq;
+ vec4 a = vec4(m,n);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..34b906d56b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.stp;
+ float q = al.q;
+ vec4 a = vec4(m, q);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..16f955e55a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stp_q_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.stp;
+ float q = lightloc.q;
+ vec4 a = vec4(m, q);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag
new file mode 100644
index 0000000000..593d052c89
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.stpq;
+ gl_FragColor = m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert
new file mode 100644
index 0000000000..ff907fdd75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_stpq_1vec4_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.stpq;
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag
new file mode 100644
index 0000000000..ad542e6998
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.ts;
+ vec2 n = al.qp;
+ vec4 a = vec4(m.t, m.s, n.t, n.s);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert
new file mode 100644
index 0000000000..fc3fa55523
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_ts_qp_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.ts;
+ vec2 n = lightloc.qp;
+ vec4 a = vec4(m.t, m.s, n.t, n.s);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..54e551dd13
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.tsq;
+ float p = al.p;
+ vec4 a = vec4(m.t, m.s, p, m.p);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..5a0cf0e953
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsq_p_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.tsq;
+ float p = lightloc.p;
+ vec4 a = vec4(m.t, m.s, p, m.p);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag
new file mode 100644
index 0000000000..f5bf88f717
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.tsqp;
+ vec4 a = vec4(m.t, m.s, m.q, m.p);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert
new file mode 100644
index 0000000000..45c526341e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_tsqp_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.tsqp;
+ vec4 a = vec4(m.t, m.s, m.q, m.p);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag
new file mode 100644
index 0000000000..faa8c0fbf2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.wx;
+ vec2 n = al.zy;
+ vec4 a = vec4(m.y, n.y, n.x, m.x);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert
new file mode 100644
index 0000000000..494eaf153d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wx_zy_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.wx;
+ vec2 n = lightloc.zy;
+ vec4 a = vec4(m.y, n.y, n.x, m.x);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..bafad02b8d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.wxz;
+ float y = al.y;
+ vec4 a = vec4(m.y, y, m.z, m.x);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..084f3d4a1d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxz_y_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.wxz;
+ float y = lightloc.y;
+ vec4 a = vec4(m.y, y, m.z, m.x);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag
new file mode 100644
index 0000000000..abaaa1aa77
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.wxzy;
+ vec4 a = vec4(m.y, m.w, m.z, m.x);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert
new file mode 100644
index 0000000000..8f2b037b06
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_wxzy_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.wxzy;
+ vec4 a = vec4(m.y, m.w, m.z, m.x);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag
new file mode 100644
index 0000000000..994da3ce0a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ float x = al.x;
+ float y = al.y;
+ float z = al.z;
+ float w = al.w;
+ vec4 m = vec4(x,y,z,w);
+ gl_FragColor = m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert
new file mode 100644
index 0000000000..5e7f41e394
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_x_y_z_w_4float_vert.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ float x = lightloc.x;
+ float y = lightloc.y;
+ float z = lightloc.z;
+ float w = lightloc.w;
+ vec4 m = vec4(x, y, z, w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag
new file mode 100644
index 0000000000..711da4cf75
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.xy;
+ vec2 n = al.zw;
+ vec4 a = vec4(m,n);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert
new file mode 100644
index 0000000000..0748e4cb54
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xy_zw_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.xy;
+ vec2 n = lightloc.zw;
+ vec4 a = vec4(m,n);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..99f089d135
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.xyz;
+ float w = al.w;
+ vec4 a = vec4(m, w);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..2a25017092
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyz_w_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.xyz;
+ float w = lightloc.w;
+ vec4 a = vec4(m, w);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag
new file mode 100644
index 0000000000..6dff1ea7f2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_frag.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.xyzw;
+ gl_FragColor = m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert
new file mode 100644
index 0000000000..c0b6cdd40d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_xyzw_1vec4_vert.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.xyzw;
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * m;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag
new file mode 100644
index 0000000000..f95d684285
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.yx;
+ vec2 n = al.wz;
+ vec4 a = vec4(m.y, m.x, n.y, n.x);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert
new file mode 100644
index 0000000000..1267691845
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yx_wz_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.yx;
+ vec2 n = lightloc.wz;
+ vec4 a = vec4(m.y, m.x, n.y, n.x);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..82aba37d4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.yxw;
+ float z = al.z;
+ vec4 a = vec4(m.y, m.x, z, m.z);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..c524df25fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxw_z_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.yxw;
+ float z = lightloc.z;
+ vec4 a = vec4(m.y, m.x, z, m.z);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag
new file mode 100644
index 0000000000..14310197ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.yxwz;
+ vec4 a = vec4(m.y, m.x, m.w, m.z);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert
new file mode 100644
index 0000000000..067db03781
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_yxwz_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.yxwz;
+ vec4 a = vec4(m.y, m.x, m.w, m.z);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag
new file mode 100644
index 0000000000..f29772e7b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec3 m = al.zwx;
+ float y = al.y;
+ vec4 a = vec4(m.z, y, m.x, m.y);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert
new file mode 100644
index 0000000000..246b73233a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwx_y_1vec3_1float_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec3 m = lightloc.zwx;
+ float y = lightloc.y;
+ vec4 a = vec4(m.z, y, m.x, m.y);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag
new file mode 100644
index 0000000000..ac70137458
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec4 m = al.zwxy;
+ vec4 a = vec4(m.z, m.w, m.x, m.y);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert
new file mode 100644
index 0000000000..dd3dc55b69
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zwxy_1vec4_vert.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec4 m = lightloc.zwxy;
+ vec4 a = vec4(m.z, m.w, m.x, m.y);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag
new file mode 100644
index 0000000000..ea23356bd5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+void main (void)
+{
+ vec4 al = color;
+ vec2 m = al.zx;
+ vec2 n = al.wy;
+ vec4 a = vec4(m.y, n.y, m.x, n.x);
+ gl_FragColor = a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert
new file mode 100644
index 0000000000..ffad811987
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/swizzlers/vec4_zx_wy_2vec2_vert.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 lightloc = gtf_Vertex;
+ vec2 m = lightloc.zx;
+ vec2 n = lightloc.wy;
+ vec4 a = vec4(m.y, n.y, m.x, n.x);
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * a;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt
new file mode 100644
index 0000000000..443a00f700
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+tan_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html
new file mode 100644
index 0000000000..25451bfc5c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: tan_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_float_frag_xvary.frag"
+ },
+ "name": "tan_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec2_frag_xvary.frag"
+ },
+ "name": "tan_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec3_frag_xvary.frag"
+ },
+ "name": "tan_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "tan_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "tan_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "tan_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "tan_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "tan_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "tan_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "tan_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "tan_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "tan_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag
new file mode 100644
index 0000000000..6235d05d08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (color.r - 0.5);
+ float o;
+
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * tan(c) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 / tan(c) + 0.5;
+ gl_FragColor = vec4(o, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..308e399685
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (color.r - 0.5);
+ float o;
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * (sin(c) / cos(c)) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 * (cos(c) / sin(c)) + 0.5;
+ gl_FragColor = vec4(o, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert
new file mode 100644
index 0000000000..3a2bfc0968
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (gtf_Color.r - 0.5);
+ float o;
+
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * tan(c) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 / tan(c) + 0.5;
+ color = vec4(o, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..074502f61d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (gtf_Color.r - 0.5);
+ float o;
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * (sin(c) / cos(c)) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 * (cos(c) / sin(c)) + 0.5;
+ color = vec4(o, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..523a66208b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ gl_FragColor = vec4(o, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..5cf357da34
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ gl_FragColor = vec4(o, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..7c04171302
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (gtf_Color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ color = vec4(o, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..01b0079917
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert
@@ -0,0 +1,31 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (gtf_Color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ color = vec4(o, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..4f1c5cdad7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * tan(c.b) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 / tan(c.b) + 0.5;
+
+ gl_FragColor = vec4(o, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..4e3f7bd792
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * (sin(c.b) / cos(c.b)) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 * (cos(c.b) / sin(c.b)) + 0.5;
+
+ gl_FragColor = vec4(o, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..0fdecde16d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * tan(c.b) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 / tan(c.b) + 0.5;
+
+ color = vec4(o, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..8f38b30f87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert
@@ -0,0 +1,36 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * (sin(c.b) / cos(c.b)) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 * (cos(c.b) / sin(c.b)) + 0.5;
+
+ color = vec4(o, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag
new file mode 100644
index 0000000000..2cdd4c00bf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ bvec4 a = bvec4(0, 23, 0.0, 23.0);
+ float gray;
+ if( (a[0] == false) && (a[1] == true) && (a[2] == false) && (a[3] == true) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert
new file mode 100644
index 0000000000..01c1e9e9de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/bvec4_2int_2float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ bvec4 a = bvec4(0, 23, 0.0, 23.0);
+ float gray;
+ if( (a[0] == false) && (a[1] == true) && (a[2] == false) && (a[3] == true) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt
new file mode 100644
index 0000000000..e5ba07f12c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/input.run.txt
@@ -0,0 +1,4 @@
+# this file is auto-generated. DO NOT EDIT.
+vec_001_to_008.html
+vec_009_to_016.html
+vec_017_to_018.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag
new file mode 100644
index 0000000000..6bbb90cf26
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ ivec3 a = ivec3(20, 13, 17);
+ float gray;
+ if( (a[0] == 20) && (a[1] == 13) && (a[2] == 17) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert
new file mode 100644
index 0000000000..b0000f85f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/ivec3_3int_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ ivec3 a = ivec3(20, 13, 17);
+ float gray;
+ if( (a[0] == 20) && (a[1] == 13) && (a[2] == 17) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag
new file mode 100644
index 0000000000..34aa150a83
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 a = vec2(13.0,53.0);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert
new file mode 100644
index 0000000000..44080bf8d2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_2float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 a = vec2(13.0,53.0);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag
new file mode 100644
index 0000000000..ef702ec599
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 b = vec3(13.0, 53.0, 139.0);
+ vec2 a = vec2(b);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert
new file mode 100644
index 0000000000..403e573141
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec2_vec3_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 b = vec3(13.0, 53.0, 139.0);
+ vec2 a = vec2(b);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag
new file mode 100644
index 0000000000..455d116a7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 b = vec2(53.0, 139.0);
+ vec3 a = vec3(13.0, b);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert
new file mode 100644
index 0000000000..7aa19d0c9e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_float_vec2_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 b = vec2(53.0, 139.0);
+ vec3 a = vec3(13.0, b);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag
new file mode 100644
index 0000000000..b6efa60724
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec2 b = vec2(13.0, 53.0);
+ vec3 a = vec3(b, 139.0);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert
new file mode 100644
index 0000000000..ecdbf1d919
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec2_float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec2 b = vec2(13.0, 53.0);
+ vec3 a = vec3(b,139.0);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag
new file mode 100644
index 0000000000..21e072d5fb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec4 b = vec4(13.0, 53.0, 139.0, 217.0);
+ vec3 a = vec3(b);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert
new file mode 100644
index 0000000000..1123d6d4fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec3_vec4_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 b = vec4(13.0, 53.0, 139.0, 217.0);
+ vec3 a = vec3(b);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag
new file mode 100644
index 0000000000..f593564381
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ ivec4 init = ivec4(2,3,5,9);
+ vec4 a = vec4(init);
+ float gray;
+ if( (a[0] == 2.0) && (a[1] == 3.0) && (a[2] == 5.0) && (a[3] == 9.0) )
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert
new file mode 100644
index 0000000000..e556f398d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_ivec4_vert.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ ivec4 init = ivec4(2,3,5,9);
+ vec4 a = vec4(init);
+ float gray;
+ if( (a[0] == 2.0) && (a[1] == 3.0) && (a[2] == 5.0) && (a[3] == 9.0) )
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag
new file mode 100644
index 0000000000..9ab9f585ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_frag.frag
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ vec3 b = vec3(13.0, 53.0, 139.0);
+ vec4 a = vec4(b, 217.0);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) && (a[3] == 217.0))
+ gray=1.0;
+ else gray=0.0;
+ gl_FragColor = vec4(gray, gray, gray, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert
new file mode 100644
index 0000000000..f11b422a51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec4_vec3_float_vert.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ vec3 b = vec3(13.0, 53.0, 139.0);
+ vec4 a = vec4(b, 217.0);
+ float gray;
+ if( (a[0] == 13.0) && (a[1] == 53.0) && (a[2] == 139.0) && (a[3] == 217.0))
+ gray=1.0;
+ else gray=0.0;
+ color = vec4(gray, gray, gray, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html
new file mode 100644
index 0000000000..251efd5e84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_001_to_008.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: vec_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec2_2float_frag.frag"
+ },
+ "name": "vec2_2float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec2_2float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec2_2float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_ivec4_frag.frag"
+ },
+ "name": "vec4_ivec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_ivec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_ivec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "ivec3_3int_frag.frag"
+ },
+ "name": "ivec3_3int_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "ivec3_3int_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "ivec3_3int_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "bvec4_2int_2float_frag.frag"
+ },
+ "name": "bvec4_2int_2float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "bvec4_2int_2float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "bvec4_2int_2float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html
new file mode 100644
index 0000000000..b846cfb195
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_009_to_016.html
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: vec_009_to_016.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec2_vec3_frag.frag"
+ },
+ "name": "vec2_vec3_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec2_vec3_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec2_vec3_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_vec4_frag.frag"
+ },
+ "name": "vec3_vec4_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec3_vec4_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_vec4_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_vec2_float_frag.frag"
+ },
+ "name": "vec3_vec2_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec3_vec2_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_vec2_float_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec3_float_vec2_frag.frag"
+ },
+ "name": "vec3_float_vec2_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec3_float_vec2_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3_float_vec2_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html
new file mode 100644
index 0000000000..f82639522d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec/vec_017_to_018.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: vec_017_to_018.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "vec4_vec3_float_frag.frag"
+ },
+ "name": "vec4_vec3_float_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 1.0,
+ 1.0,
+ 1.0,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec4_vec3_float_vert.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec4_vec3_float_vert.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt
new file mode 100644
index 0000000000..1d1f9189d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+vec3_001_to_008.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html
new file mode 100644
index 0000000000..6c4c642388
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3_001_to_008.html
@@ -0,0 +1,313 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+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.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: vec3_001_to_008.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 2,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.0,
+ 0.75,
+ 0.25,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "vec3array_frag.frag"
+ },
+ "name": "vec3array_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec3single_vert.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 1,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.5
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3single_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.5,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec3arrayindirect_vert.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 2,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.0,
+ 0.75,
+ 0.25,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3arrayindirect_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.5,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec3arraydirect_vert.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 2,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.0,
+ 0.75,
+ 0.25,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3arraydirect_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "vec3array_vert.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 2,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.0,
+ 0.75,
+ 0.25,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "vec3array_vert.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 1,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.5
+ ]
+ }
+ },
+ "fragmentShader": "vec3single_frag.frag"
+ },
+ "name": "vec3single_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.5,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 2,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.0,
+ 0.75,
+ 0.25,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "vec3arrayindirect_frag.frag"
+ },
+ "name": "vec3arrayindirect_frag.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "result": {
+ "count": 1,
+ "type": "uniform4fv",
+ "value": [
+ 0.5,
+ 0.5,
+ 0.5,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "../default/expected.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "uniforms": {
+ "lightPosition": {
+ "count": 2,
+ "type": "uniform3fv",
+ "value": [
+ 0.25,
+ 0.75,
+ 0.0,
+ 0.75,
+ 0.25,
+ 1.0
+ ]
+ }
+ },
+ "fragmentShader": "vec3arraydirect_frag.frag"
+ },
+ "name": "vec3arraydirect_frag.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag
new file mode 100644
index 0000000000..0b13eee69d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_frag.frag
@@ -0,0 +1,32 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//
+// vec3array_frag.frag: Simple Fragment shader using vec3 to get colors.
+//
+//
+
+varying vec4 color;
+
+uniform vec3 lightPosition[2];
+
+void main(void)
+{
+ vec3 v[2];
+
+ v[1] = vec3(color.r, color.g, color.b);
+
+
+ v[0] = lightPosition[1];
+
+
+ gl_FragColor = vec4(v[1] + v[1], 0.0)/2.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert
new file mode 100644
index 0000000000..91651bccee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3array_vert.vert
@@ -0,0 +1,30 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+//
+// vec3array_vert.vert: Simple vertex shader using vec3 to get colors.
+//
+//
+
+varying vec4 color;
+uniform vec3 lightPosition[2];
+
+void main(void)
+{
+ vec3 v[2];
+
+ v[1] = vec3(gtf_Color.r, gtf_Color.g, gtf_Color.b);
+
+ v[0] = lightPosition[1];
+
+ color = vec4(v[1] + v[1], 0.0)/2.0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag
new file mode 100644
index 0000000000..042af3233d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//
+// vec3arraydirect_frag.frag: Fragment shader solid color
+//
+//
+//
+
+uniform vec3 lightPosition[2];
+varying vec4 color;
+
+void main(void)
+{
+ gl_FragColor = vec4(lightPosition[0] + lightPosition[1], 0.0) * 0.5;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert
new file mode 100644
index 0000000000..a68009f5e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arraydirect_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+//
+// vec3arraydirect_vert.vert: Vertex shader solid color
+//
+//
+//
+
+uniform vec3 lightPosition[2];
+varying vec4 color;
+
+void main(void)
+{
+
+ color = vec4(lightPosition[0] + lightPosition[1], 0.0) * 0.5;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag
new file mode 100644
index 0000000000..a1252a9253
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_frag.frag
@@ -0,0 +1,38 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//
+// vec3arrayindirect_frag.frag: Fragment shader solid color
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform vec3 lightPosition[2];
+varying vec4 color;
+
+void main(void)
+{
+ int i;
+
+ gl_FragColor = vec4(0.0);
+
+ /*
+ // No indirect indexing in fragment shaders
+ for (i = 0; i < 2; i++)
+ {
+ gl_FragColor += vec4(lightPosition[i], 0.0);
+ }
+ */
+ gl_FragColor += vec4(lightPosition[0], 0.0);
+ gl_FragColor += vec4(lightPosition[1], 0.0);
+
+ gl_FragColor /= 2.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert
new file mode 100644
index 0000000000..8da406319f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3arrayindirect_vert.vert
@@ -0,0 +1,34 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+//
+// vec3arrayindirect_vert.vert: Vertex shader solid color
+// The vec3 values are determined at runtime.
+//
+//
+
+uniform vec3 lightPosition[2];
+varying vec4 color;
+
+void main(void)
+{
+ color = vec4(0.0);
+
+ for (int i = 0; i < 2; i++)
+ {
+ color += vec4(lightPosition[i], 0.0);
+ }
+
+ color /= 2.0;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag
new file mode 100644
index 0000000000..73148c40ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_frag.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//
+// vec3Matrix_frag.frag: Fragment shader solid color
+//
+//
+//
+
+uniform vec3 lightPosition;
+varying vec4 color;
+
+void main(void)
+{
+ gl_FragColor = vec4(lightPosition, 0.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert
new file mode 100644
index 0000000000..386aaacde5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/vec3/vec3single_vert.vert
@@ -0,0 +1,28 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+//
+// vec3Matrix_vert.vert: Vertex shader solid color
+//
+//
+//
+
+uniform vec3 lightPosition;
+varying vec4 color;
+
+void main(void)
+{
+
+ color = vec4(lightPosition, 0.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag
new file mode 100644
index 0000000000..ad6b60241a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D gtf_Texture0;
+varying vec4 color;
+varying vec4 gtf_TexCoord[1];
+
+void main (void)
+{
+ gl_FragColor = color * texture2D(gtf_Texture0, gtf_TexCoord[0].xy);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert
new file mode 100644
index 0000000000..f16ba31304
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/compressed_paletted_texture/compressed_paletted_texture.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 gtf_TexCoord[1];
+attribute vec4 gtf_MultiTexCoord0;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gtf_TexCoord[0] = gtf_MultiTexCoord0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag
new file mode 100644
index 0000000000..4371f9a7fc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.frag
@@ -0,0 +1,51 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+// This fragment shader computes an image representation of the derivative of
+// sine. The derivative of sine is cosine. This shader's output is compared to
+// the reference shader that computes an image representation of cosine
+// directly.
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float sine;
+ float cosine;
+
+#ifdef GL_OES_standard_derivatives
+ sine = sin(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI));
+ cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * dFdx(sine));
+#else
+ cosine = 0.5;
+#endif
+
+ if( gl_FragCoord.x < SAFETY_BOUND )
+ {
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag
new file mode 100644
index 0000000000..263b5b7f3c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.frag
@@ -0,0 +1,44 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float cosine;
+
+ if( gl_FragCoord.x < SAFETY_BOUND )
+ {
+ // horizontal cosine wave with a period of 128 pixels
+#ifdef GL_OES_standard_derivatives
+ cosine = REDUCE_RANGE(cos(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI)));
+#else
+ cosine = 0.5;
+#endif
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdx/dFdx_frag_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag
new file mode 100644
index 0000000000..6956f59620
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.frag
@@ -0,0 +1,51 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+// This fragment shader computes an image representation of the derivative of
+// sine. The derivative of sine is cosine. This shader's output is compared to
+// the reference shader that computes an image representation of cosine
+// directly.
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float sine;
+ float cosine;
+
+#ifdef GL_OES_standard_derivatives
+ sine = sin(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI));
+ cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * dFdy(sine));
+#else
+ cosine = 0.5;
+#endif
+
+ if( gl_FragCoord.y < SAFETY_BOUND )
+ {
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert
new file mode 100644
index 0000000000..642c65f958
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag
new file mode 100644
index 0000000000..bd4555a47a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.frag
@@ -0,0 +1,47 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float cosine;
+
+ if( gl_FragCoord.y < SAFETY_BOUND )
+ {
+ // vertical cosine wave with a period of 128 pixels
+
+#ifdef GL_OES_standard_derivatives
+ cosine = REDUCE_RANGE(cos(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI)));
+#else
+ cosine = 0.5;
+#endif
+
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert
new file mode 100644
index 0000000000..642c65f958
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/dFdy/dFdy_frag_ref.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag
new file mode 100644
index 0000000000..48175cd07e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert
new file mode 100644
index 0000000000..dc31499b90
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag
new file mode 100644
index 0000000000..48cd225675
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D gtf_Texture0;
+varying vec4 color;
+varying vec4 gtf_TexCoord[1];
+
+void main (void)
+{
+ gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].xy);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert
new file mode 100644
index 0000000000..0088a62147
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/default_shaders/default_textured.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 gtf_TexCoord[1];
+attribute vec4 gtf_MultiTexCoord0;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gtf_TexCoord[0] = gtf_MultiTexCoord0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag
new file mode 100644
index 0000000000..ebe8461533
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+
+varying vec2 vertXY;
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float func;
+ float funcfwidth;
+
+#ifdef GL_OES_standard_derivatives
+ // fwidth of average of horizontal and vertical sine waves with periods of 128 pixels, scaled to go from -1 to +1
+ func = 0.5 * (sin(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI)) + sin(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI)));
+ funcfwidth = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * fwidth(func));
+#else
+ funcfwidth = 0.5;
+#endif
+
+ if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) )
+ {
+ gl_FragColor = vec4(funcfwidth, funcfwidth, funcfwidth, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag
new file mode 100644
index 0000000000..cc5be437d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+varying vec2 vertXY;
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float cosine;
+ float sine;
+
+#ifdef GL_OES_standard_derivatives
+ // fwidth of horizontal sine wave with a period of 128 pixels, scaled to go from -1 to +1
+ sine = sin(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI));
+ cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * fwidth(sine));
+#else
+ cosine = 0.5;
+#endif
+
+ if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) )
+ {
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dx.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag
new file mode 100644
index 0000000000..cd555f623e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.frag
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+
+varying vec2 vertXY;
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float cosine;
+ float sine;
+
+#ifdef GL_OES_standard_derivatives
+ // fwidth of vertical sine wave with a period of 128 pixels, scaled to go from -1 to +1
+ sine = sin(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI));
+ cosine = REDUCE_RANGE((128.0 / (2.0 * M_PI)) * fwidth(sine));
+#else
+ cosine = 0.5;
+#endif
+
+ if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) )
+ {
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_dy.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag
new file mode 100644
index 0000000000..c80b0007d1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.frag
@@ -0,0 +1,47 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float func;
+
+ if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) )
+ {
+ // average of horizontal and vertical abs cosine waves with periods of 128 pixels
+
+#ifdef GL_OES_standard_derivatives
+ func = REDUCE_RANGE(0.5 * (abs(cos(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI))) + abs(cos(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI)))));
+#else
+ func = 0.5;
+#endif
+
+ gl_FragColor = vec4(func, func, func, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag
new file mode 100644
index 0000000000..045591208e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0]..
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float cosine;
+
+ if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) )
+ {
+ // horizontal abs cosine wave with a period of 128 pixels
+
+#ifdef GL_OES_standard_derivatives
+ cosine = REDUCE_RANGE(abs(cos(fract(gl_FragCoord.x / 128.0) * (2.0 * M_PI))));
+#else
+ cosine = 0.5;
+#endif
+
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dx.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag
new file mode 100644
index 0000000000..d187cf8de0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.frag
@@ -0,0 +1,47 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+#extension GL_OES_standard_derivatives : enable
+precision mediump float;
+#endif
+
+// setting a boundary for cases where screen sizes may exceed the precision
+// of the arithmetic used.
+#define SAFETY_BOUND 500.0
+
+// Macro to scale/bias the range of output. If input is [-1.0, 1.0], maps to [0.5, 1.0].
+// Accounts for precision errors magnified by derivative operation.
+#define REDUCE_RANGE(A) ((A) + 3.0) / 4.0
+
+
+uniform float viewportwidth;
+uniform float viewportheight;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float cosine;
+
+ if( (gl_FragCoord.x < SAFETY_BOUND) && (gl_FragCoord.y < SAFETY_BOUND) )
+ {
+ // vertical abs cosine wave with a period of 128 pixels
+
+#ifdef GL_OES_standard_derivatives
+ cosine = REDUCE_RANGE(abs(cos(fract(gl_FragCoord.y / 128.0) * (2.0 * M_PI))));
+#else
+ cosine = 0.5;
+#endif
+
+ gl_FragColor = vec4(cosine, cosine, cosine, 1.0);
+ }
+ else discard;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert
new file mode 100644
index 0000000000..57ebf867ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2ExtensionTests/fwidth/fwidth_frag_ref_dy.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying vec2 vertXY;
+
+void main (void)
+{
+ vertXY = gtf_Vertex.xy;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag
new file mode 100644
index 0000000000..ff3ef82b98
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D gtf_Texture0;
+varying vec4 color;
+varying vec4 gtf_TexCoord[1];
+
+void main (void)
+{
+ gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0) * color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert
new file mode 100644
index 0000000000..9b8f753d58
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert
@@ -0,0 +1,144 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_MultiTexCoord0;
+
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform mat3 gtf_NormalMatrix;
+
+varying vec4 gtf_TexCoord[1];
+varying vec4 color;
+
+vec4 Ambient;
+vec4 Diffuse;
+vec4 Specular;
+
+const vec3 lightPosition = vec3(0.0, 0.0, 1.0);
+const vec3 spotDirection = vec3(0.0, 0.0, -1.0);
+const float spotCutoff = 180.0;
+const float spotExponent = 0.0;
+
+const float lightAttenuationConstant = 1.0;
+const float lightAttenuationLinear = 0.0;
+const float lightAttenuationQuadratic = 0.0;
+
+const vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 0.0);
+vec4 lightDiffuse = vec4(1.0, 1.0, 1.0, 1.0);
+vec4 lightSpecular = vec4(1.0, 1.0, 1.0, 1.0);
+
+const float materialShininess = 0.0;
+
+const vec4 sceneColor = vec4(0.0, 0.0, 0.0, 0.0);
+
+void spotLight(in int i,
+ in vec3 normal,
+ in vec3 eye,
+ in vec3 ecPosition3
+ )
+{
+ float nDotVP; // normal . light direction
+ float nDotHV; // normal . light half vector
+ float pf; // power factor
+ float spotDot; // cosine of angle between spotlight
+ float spotAttenuation; // spotlight attenuation factor
+ float attenuation; // computed attenuation factor
+ float d; // distance from surface to light source
+ vec3 VP; // direction from surface to light position
+ vec3 halfVector; // direction of maximum highlights
+
+ // Compute vector from surface to light position
+ VP = lightPosition - ecPosition3;
+
+ // Compute distance between surface and light position
+ d = length(VP);
+
+ // Normalize the vector from surface to light position
+ VP = normalize(VP);
+
+ // Compute attenuation
+ attenuation = 1.0 / (lightAttenuationConstant +
+ lightAttenuationLinear * d +
+ lightAttenuationQuadratic * d * d);
+
+ // See if point on surface is inside cone of illumination
+ spotDot = dot(-VP, normalize(spotDirection));
+
+ if (spotDot < cos(radians(spotCutoff)))
+ spotAttenuation = 0.0; // light adds no contribution
+ else
+ spotAttenuation = pow(spotDot, spotExponent);
+
+ // Combine the spotlight and distance attenuation.
+ attenuation *= spotAttenuation;
+
+ halfVector = normalize(VP + eye);
+
+ nDotVP = max(0.0, dot(normal, VP));
+ nDotHV = max(0.0, dot(normal, halfVector));
+
+ if (nDotVP == 0.0)
+ pf = 0.0;
+ else
+ pf = pow(nDotHV, materialShininess);
+
+ Ambient += lightAmbient * attenuation;
+ Diffuse += lightDiffuse * nDotVP * attenuation;
+ Specular += lightSpecular * pf * attenuation;
+}
+
+vec3 fnormal(void)
+{
+ //Compute the normal
+ vec3 normal = gtf_NormalMatrix * gtf_Normal;
+ normal = normalize(normal);
+
+ return normal;
+}
+
+void flight(in vec3 normal, in vec4 ecPosition, float alphaFade)
+{
+ vec3 ecPosition3;
+ vec3 eye;
+
+ ecPosition3 = (vec3 (ecPosition)) / ecPosition.w;
+ eye = vec3 (0.0, 0.0, 1.0);
+
+ // Clear the light intensity accumulators
+ Ambient = vec4 (0.0);
+ Diffuse = vec4 (0.0);
+ Specular = vec4 (0.0);
+
+ //lightSpecular = gtf_Color;
+
+ spotLight(0, normal, eye, ecPosition3);
+
+ color = sceneColor +
+ Ambient * gtf_Color +
+ Diffuse * gtf_Color;
+ color += Specular * gtf_Color;
+ color = clamp( color, 0.0, 1.0 );
+
+ color.a *= alphaFade;
+}
+
+void main (void)
+{
+ vec3 transformedNormal;
+ float alphaFade = 1.0;
+
+ vec4 ecPosition = gtf_Vertex;
+
+ color = gtf_Color;
+ gtf_TexCoord[0] = gtf_MultiTexCoord0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ transformedNormal = fnormal();
+ flight(transformedNormal, ecPosition, alphaFade);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag
new file mode 100644
index 0000000000..509c7c1f42
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D gtf_Texture0;
+uniform sampler2D gtf_Texture1;
+
+varying vec4 color;
+varying vec4 gtf_TexCoord[2];
+
+void main (void)
+{
+ gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0);
+ gl_FragColor += texture2D(gtf_Texture1, gtf_TexCoord[1].st, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert
new file mode 100644
index 0000000000..e98a85ca14
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_MultiTexCoord0;
+attribute vec4 gtf_MultiTexCoord1;
+
+varying vec4 color;
+varying vec4 gtf_TexCoord[2];
+
+void main (void)
+{
+ color = gtf_Color;
+ gtf_TexCoord[0] = gtf_MultiTexCoord0;
+ gtf_TexCoord[1] = gtf_MultiTexCoord1;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag
new file mode 100644
index 0000000000..48175cd07e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert
new file mode 100644
index 0000000000..53ffa4bf18
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+attribute float gtf_PointSize;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = gtf_PointSize;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag
new file mode 100644
index 0000000000..51f59a41a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D gtf_Texture0;
+varying vec4 color;
+varying vec4 gtf_TexCoord[1];
+
+void main (void)
+{
+ if (gtf_TexCoord[0].s == 1.0)
+ gl_FragColor = color;
+ else
+ gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag
new file mode 100644
index 0000000000..48175cd07e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert
new file mode 100644
index 0000000000..319999cb93
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag
new file mode 100644
index 0000000000..48cd225675
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform sampler2D gtf_Texture0;
+varying vec4 color;
+varying vec4 gtf_TexCoord[1];
+
+void main (void)
+{
+ gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].xy);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert
new file mode 100644
index 0000000000..0088a62147
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 gtf_TexCoord[1];
+attribute vec4 gtf_MultiTexCoord0;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gtf_TexCoord[0] = gtf_MultiTexCoord0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag
new file mode 100644
index 0000000000..55ec693c20
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert
new file mode 100644
index 0000000000..cdccf706ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert
@@ -0,0 +1,132 @@
+
+/*
+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.
+*/
+
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform mat3 gtf_NormalMatrix;
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+attribute vec3 gtf_Normal;
+
+varying vec4 color;
+
+vec4 Ambient;
+vec4 Diffuse;
+vec4 Specular;
+
+const vec3 lightPosition = vec3(0.0, 0.0, 10.0);
+const float lightAttenuationConstant = 1.0;
+const float lightAttenuationLinear = 0.0;
+const float lightAttenuationQuadratic = 0.0;
+
+const vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 0.0);
+vec4 lightDiffuse = vec4(1.0, 0.0, 0.0, 1.0);
+
+const vec4 materialAmbient = vec4(0.0, 0.0, 0.0, 1.0);
+const vec4 materialDiffuse = vec4(1.0, 1.0, 1.0, 1.0);
+const vec4 materialSpecular = vec4(0.0, 0.0, 0.0, 0.0);
+const float materialShininess = 20.0;
+
+const vec4 sceneColor = vec4(0.0, 0.0, 0.0, 0.0);
+
+
+void pointLight(in int i, in vec3 normal, in vec3 eye, in vec3 ecPosition3)
+{
+ float nDotVP; // normal . light direction
+ float nDotHV; // normal . light half vector
+ float pf; // power factor
+ float attenuation; // computed attenuation factor
+ float d; // distance from surface to light source
+ vec3 VP; // direction from surface to light position
+ vec3 halfVector; // direction of maximum highlights
+
+ // Compute vector from surface to light position
+ VP = lightPosition - ecPosition3;
+
+ // Compute distance between surface and light position
+ d = length(VP);
+
+ // Normalize the vector from surface to light position
+ VP = normalize(VP);
+
+ // Compute attenuation
+ attenuation = 1.0 / (lightAttenuationConstant +
+ lightAttenuationLinear * d +
+ lightAttenuationQuadratic * d * d);
+
+ halfVector = normalize(VP + eye);
+
+ nDotVP = max(0.0, dot(normal, VP));
+ nDotHV = max(0.0, dot(normal, halfVector));
+
+ if (nDotVP == 0.0)
+ {
+ pf = 0.0;
+ }
+ else
+ {
+ pf = pow(nDotHV, materialShininess);
+
+ }
+ Ambient += lightAmbient * attenuation;
+ Diffuse += lightDiffuse * nDotVP * attenuation;
+// Specular += lightSpecular * pf * attenuation;
+}
+
+vec3 fnormal(void)
+{
+ //Compute the normal
+ vec3 normal = gtf_Normal * gtf_NormalMatrix;
+ normal = normalize(normal);
+
+ // This should change to "return normal" but for this test, we force a normal pointing towards the light
+ // return normal
+ return vec3(0.0, 0.0, 1.0);
+}
+
+void flight(in vec3 normal, in vec4 ecPosition, float alphaFade)
+{
+ vec3 ecPosition3;
+ vec3 eye;
+
+ ecPosition3 = (vec3 (ecPosition)) / ecPosition.w;
+ eye = vec3 (0.0, 0.0, 1.0);
+
+ // Clear the light intensity accumulators
+ Ambient = vec4 (0.0);
+ Diffuse = vec4 (0.0);
+ Specular = vec4 (0.0);
+
+ lightDiffuse = gtf_Color;
+
+ pointLight(0, normal, eye, ecPosition3);
+
+ color = sceneColor +
+ Ambient * materialAmbient +
+ Diffuse * materialDiffuse;
+ color += Specular * materialSpecular;
+ color = clamp( color, 0.0, 1.0 );
+
+ color.a *= alphaFade;
+}
+
+
+void main (void)
+{
+ vec3 transformedNormal;
+ float alphaFade = 1.0;
+
+ // Eye-coordinate position of vertex, needed in various calculations
+ vec4 ecPosition = gtf_ModelViewMatrix * gtf_Vertex;
+
+ // Do fixed functionality vertex transform
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ transformedNormal = fnormal();
+ flight(transformedNormal, ecPosition, alphaFade);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag
new file mode 100644
index 0000000000..48175cd07e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert
new file mode 100644
index 0000000000..7d58312714
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag
new file mode 100644
index 0000000000..48175cd07e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert
new file mode 100644
index 0000000000..b4e21c7d50
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform float gtf_PointSize;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = gtf_PointSize;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag
new file mode 100644
index 0000000000..f5da783f45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag
@@ -0,0 +1,14 @@
+
+/*
+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.
+*/
+
+
+uniform sampler2D gtf_Texture0;
+
+void main (void)
+{
+ gl_FragColor = texture2D(gtf_Texture0, gl_PointCoord.st);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert
new file mode 100644
index 0000000000..8123bf829f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute float gtf_PointSize;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+void main (void)
+{
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = gtf_PointSize;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag
new file mode 100644
index 0000000000..d332207839
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+varying vec4 color;
+varying float dotClip[2];
+
+void main (void)
+{
+ if (dotClip[0] >= 0.0 || dotClip[1] >= 0.0)
+ discard;
+
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert
new file mode 100644
index 0000000000..48d13d3d8a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert
@@ -0,0 +1,27 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+varying float dotClip[2];
+
+void main (void)
+{
+ vec4 userClipPlanes[2];
+ userClipPlanes[0] = vec4(0.0, 1.0, 0.0, 0.0);
+ userClipPlanes[1] = vec4(-1.0, 0.0, 0.0, 0.0);
+
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+
+ dotClip[0] = dot(userClipPlanes[0], gl_Position);
+ dotClip[1] = dot(userClipPlanes[1], gl_Position);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag
new file mode 100644
index 0000000000..4f3fe797b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float GrainSize;
+uniform vec3 DarkColor;
+uniform vec3 colorSpread;
+
+varying float lightIntensity;
+varying vec3 Position;
+
+void main (void)
+{
+ //
+ // cheap noise
+ //
+ vec3 location = Position;
+
+ vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0));
+ vec3 noise = Position * 10.0 - floorvec - 0.5;
+ noise *= noise;
+ location += noise * 0.12;
+
+ //
+ // distance from axis
+ //
+ float dist = location.x * location.x + location.z * location.z;
+ float grain = dist / GrainSize;
+
+ //
+ // grain effects as function of distance
+ //
+ float brightness = fract(grain);
+ if (brightness > 0.5)
+ brightness = (1.0 - brightness);
+ vec3 color = DarkColor + 0.5 * brightness * (colorSpread);
+
+ brightness = fract(grain*7.0);
+ if (brightness > 0.5)
+ brightness = 1.0 - brightness;
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // also as a function of lines parallel to the axis
+ //
+ brightness = fract(grain*47.0);
+ float line = fract(Position.z + Position.x);
+ float snap = floor(line * 30.0) * (1.0/30.0);
+ if (line < snap + 0.004)
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // apply lighting effects from vertex processor
+ //
+ color *= lightIntensity;
+ color = clamp(color, 0.0, 1.0);
+
+ gl_FragColor = vec4(color, 0.1)
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert
new file mode 100644
index 0000000000..b04c21efe3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/attach_shader/unsuccessfulcompile_vert.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag
new file mode 100644
index 0000000000..2d895c8c8c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.frag
@@ -0,0 +1,47 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert
new file mode 100644
index 0000000000..44564ce7cd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/bind_attribute_location/brick.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute vec3 myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2[1]);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert
new file mode 100644
index 0000000000..b04c21efe3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/brick.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag
new file mode 100644
index 0000000000..fdab13ace1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/texture.frag
@@ -0,0 +1,35 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+//
+// wobble.frag: Fragment shader for wobbling a texture
+//
+// author: Antonio Tejada
+//
+//
+
+varying vec3 Position;
+varying float lightIntensity;
+
+/* Constants */
+
+uniform sampler2D sampler2d; // value of sampler2d = 0
+varying vec4 gtf_TexCoord[1];
+
+void main (void)
+{
+ vec3 lightColor = vec3(texture2D(sampler2d, vec2(gtf_TexCoord[0]))) * lightIntensity;
+
+ vec3 ct = clamp(lightColor, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag
new file mode 100644
index 0000000000..4f3fe797b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float GrainSize;
+uniform vec3 DarkColor;
+uniform vec3 colorSpread;
+
+varying float lightIntensity;
+varying vec3 Position;
+
+void main (void)
+{
+ //
+ // cheap noise
+ //
+ vec3 location = Position;
+
+ vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0));
+ vec3 noise = Position * 10.0 - floorvec - 0.5;
+ noise *= noise;
+ location += noise * 0.12;
+
+ //
+ // distance from axis
+ //
+ float dist = location.x * location.x + location.z * location.z;
+ float grain = dist / GrainSize;
+
+ //
+ // grain effects as function of distance
+ //
+ float brightness = fract(grain);
+ if (brightness > 0.5)
+ brightness = (1.0 - brightness);
+ vec3 color = DarkColor + 0.5 * brightness * (colorSpread);
+
+ brightness = fract(grain*7.0);
+ if (brightness > 0.5)
+ brightness = 1.0 - brightness;
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // also as a function of lines parallel to the axis
+ //
+ brightness = fract(grain*47.0);
+ float line = fract(Position.z + Position.x);
+ float snap = floor(line * 30.0) * (1.0/30.0);
+ if (line < snap + 0.004)
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // apply lighting effects from vertex processor
+ //
+ color *= lightIntensity;
+ color = clamp(color, 0.0, 1.0);
+
+ gl_FragColor = vec4(color, 0.1)
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/compile_shader/wood.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/delete_object/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/detach_shader/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag
new file mode 100644
index 0000000000..03a0aa8703
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.frag
@@ -0,0 +1,29 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+varying vec4 color;
+varying vec4 texCoord[1];
+
+uniform sampler2D gtf_Texture0;
+uniform int gtf_UseTexture;
+
+void main (void)
+{
+ if ( gtf_UseTexture == 1 )
+ {
+ gl_FragColor = texture2D(gtf_Texture0, texCoord[0].xy);
+ }
+ else
+ {
+ gl_FragColor = color;
+ }
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert
new file mode 100644
index 0000000000..f1edf81011
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/framebuffer_objects/fboShader0.vert
@@ -0,0 +1,23 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_MultiTexCoord0;
+
+varying vec4 texCoord[1];
+varying vec4 color;
+
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+void main (void)
+{
+ color = gtf_Color;
+ texCoord[0] = gtf_MultiTexCoord0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert
new file mode 100644
index 0000000000..17102a01c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert
@@ -0,0 +1,45 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec3 gtf_Normal;
+attribute mat2 myAttrib2m;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib2m[0][0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert
new file mode 100644
index 0000000000..d6fea1125b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert
@@ -0,0 +1,45 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec3 gtf_Normal;
+attribute mat3 myAttrib3m;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib3m[0][0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert
new file mode 100644
index 0000000000..5c28d78aaf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert
@@ -0,0 +1,45 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec3 gtf_Normal;
+attribute mat4 myAttrib4m;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib4m[0][0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert
new file mode 100644
index 0000000000..c36a4e1133
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert
@@ -0,0 +1,48 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec3 gtf_Normal;
+attribute float myAttrib1f;
+attribute vec2 myAttrib2f;
+attribute vec3 myAttrib3f;
+attribute vec4 myAttrib4f;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib1f + myAttrib2f[0] + myAttrib3f[0] + myAttrib4f[0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag
new file mode 100644
index 0000000000..3d926c53ea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.frag
@@ -0,0 +1,45 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert
new file mode 100644
index 0000000000..8629782a45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_uniform/brick.vert
@@ -0,0 +1,71 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+varying float lightIntensity;
+varying vec3 Position;
+
+ // Used in the vertex shader.
+uniform mat3 gtf_NormalMatrix; //< 1
+uniform mat4 gtf_ModelViewMatrix; //< 2
+uniform mat4 gtf_ModelViewProjectionMatrix; //< 3
+uniform float myAttrib1f; //< 4
+uniform vec2 myAttrib2f; //< 5
+uniform vec3 LightPosition; //< 6
+uniform vec4 myAttrib4f; //< 7
+uniform int myAttrib1i; //< 8
+uniform ivec2 myAttrib2i; //< 9
+uniform ivec3 myAttrib3i; //< 10
+uniform ivec4 myAttrib4i; //< 11
+uniform bool myAttrib1b; //< 12
+uniform bvec2 myAttrib2b; //< 13
+uniform bvec3 myAttrib3b; //< 14
+uniform bvec4 myAttrib4b; //< 15
+uniform mat2 myAttrib2m; //< 16
+uniform mat3 myAttrib3m; //< 17
+uniform mat4 myAttrib4m; //< 18
+uniform float myUniformfv[5]; //< 19
+ // Used in the fragment shader.
+uniform vec3 brickColor; //< 20
+uniform vec3 mortarColor; //< 21
+uniform float brickMortarWidth; //< 22
+uniform float brickMortarHeight; //< 23
+uniform float mwf; //< 24
+uniform float mhf; //< 25
+
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib1f + myAttrib2f[0] + myAttrib4f[0]
+ + float(myAttrib1i) + float(myAttrib2i[0]) + float(myAttrib3i[0]) + float(myAttrib4i[0])
+ + float(myAttrib1b) + float(myAttrib2b[0]) + float(myAttrib3b[0]) + float(myAttrib4b[0])
+ + myAttrib2m[0][0] + myAttrib3m[0][0] + myAttrib4m[0][0]
+ + myUniformfv[0] + myUniformfv[1] + myUniformfv[2] + myUniformfv[3] + myUniformfv[4];
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag
new file mode 100644
index 0000000000..3d830261ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec3 colors;
+
+void main (void)
+{
+ gl_FragColor = vec4 (colors, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert
new file mode 100644
index 0000000000..3b0c0ba6f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_attribute_location/brick.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute float myAttribute1;
+attribute float myAttribute2;
+attribute float myAttribute3;
+
+varying vec3 colors;
+
+void main(void)
+{
+ colors = vec3(myAttribute1, 0, 0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_handle/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert
new file mode 100644
index 0000000000..35b8ecbafc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_uniform_location/brick.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag
new file mode 100644
index 0000000000..3ee1988465
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec3 tc;
+
+void main (void)
+{
+ vec3 foo = tc;
+ gl_FragColor = vec4 (foo, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert
new file mode 100644
index 0000000000..03666713db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramInfoLog_2.0/simple.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform vec3 triangleColor;
+varying vec3 tc;
+
+void main(void)
+{
+ tc = triangleColor;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert
new file mode 100644
index 0000000000..35b8ecbafc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetProgramiv_2.0/brick.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag
new file mode 100644
index 0000000000..3ee1988465
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.frag
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec3 tc;
+
+void main (void)
+{
+ vec3 foo = tc;
+ gl_FragColor = vec4 (foo, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert
new file mode 100644
index 0000000000..03666713db
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetShaderInfoLog_2.0/simple.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform vec3 triangleColor;
+varying vec3 tc;
+
+void main(void)
+{
+ tc = triangleColor;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag
new file mode 100644
index 0000000000..2c0fc9e2c6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.frag
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform bool funi1;
+uniform bvec2 funi2;
+uniform bvec3 funi3;
+uniform bvec4 funi4;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 temp = vec4(0.0, 0.0, 0.0, 0.0);
+ if(funi1 || funi2[0] && funi2[1] && funi3[0] && funi3[1] && funi3[2] || funi4[0] && funi4[1] && funi4[2] && funi4[3])
+ temp = vec4(1.0, 0.0, 0.5, 1.0);
+ gl_FragColor = temp + color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert
new file mode 100644
index 0000000000..33bcf06a9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/bvec_tests.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform bool vuni1;
+uniform bvec2 vuni2;
+uniform bvec3 vuni3;
+uniform bvec4 vuni4;
+varying vec4 color;
+
+void main (void)
+{
+ if(vuni1 || vuni2[0] && vuni2[1] && vuni3[0] && vuni3[1] && vuni3[2] || vuni4[0] && vuni4[1] && vuni4[2] && vuni4[3])
+ color = vec4(1.0, 0.0, 0.5, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag
new file mode 100644
index 0000000000..4d0cabe58d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform int funi1;
+uniform ivec2 funi2;
+uniform ivec3 funi3;
+uniform ivec4 funi4;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 temp = vec4(float(funi1), float(funi2[0] + funi2[1]), float(funi3[0] + funi3[1] + funi3[2]), float(funi4[0] + funi4[1] + funi4[2] + funi4[3]));
+ gl_FragColor = temp + color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert
new file mode 100644
index 0000000000..ce7159c386
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/ivec_tests.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform int vuni1;
+uniform ivec2 vuni2;
+uniform ivec3 vuni3;
+uniform ivec4 vuni4;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(float(vuni1), float(vuni2[0] + vuni2[1]), float(vuni3[0] + vuni3[1] + vuni3[2]), float(vuni4[0] + vuni4[1] + vuni4[2] + vuni4[3]) );
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag
new file mode 100644
index 0000000000..f963f96f36
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.frag
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform mat2 funi2;
+uniform mat3 funi3;
+uniform mat4 funi4;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 temp = vec4( funi2[0][0] + funi2[0][1] + funi2[1][0] + funi2[1][1],
+
+ funi3[0][0] + funi3[0][1] + funi3[0][2] + funi3[1][0] + funi3[1][1] + funi3[1][2] + funi3[2][0] + funi3[2][1] + funi3[2][2],
+
+ funi4[0][0] + funi4[0][1] + funi4[0][2] + funi4[0][3] + funi4[1][0] + funi4[1][1] + funi4[1][2] + funi4[1][3] + funi4[2][0] + funi4[2][1] + funi4[2][2] + funi4[2][3] + funi4[3][0] + funi4[3][1] + funi4[3][2] + funi4[3][3], 1.0 );
+ gl_FragColor = temp + color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert
new file mode 100644
index 0000000000..9479dc919b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/mat_tests.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform mat2 vuni2;
+uniform mat3 vuni3;
+uniform mat4 vuni4;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4( vuni2[0][0] + vuni2[0][1] + vuni2[1][0] + vuni2[1][1],
+
+ vuni3[0][0] + vuni3[0][1] + vuni3[0][2] + vuni3[1][0] + vuni3[1][1] + vuni3[1][2] + vuni3[2][0] + vuni3[2][1] + vuni3[2][2],
+
+ vuni4[0][0] + vuni4[0][1] + vuni4[0][2] + vuni4[0][3] + vuni4[1][0] + vuni4[1][1] + vuni4[1][2] + vuni4[1][3] + vuni4[2][0] + vuni4[2][1] + vuni4[2][2] + vuni4[2][3] + vuni4[3][0] + vuni4[3][1] + vuni4[3][2] + vuni4[3][3], 1.0 );
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag
new file mode 100644
index 0000000000..18f3e349a4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float funi1;
+uniform vec2 funi2;
+uniform vec3 funi3;
+uniform vec4 funi4;
+varying vec4 color;
+
+void main (void)
+{
+ vec4 temp = vec4(funi1, funi2[0] + funi2[1], funi3[0] + funi3[1] + funi3[2], funi4[0] + funi4[1] + funi4[2] + funi4[3]);
+ gl_FragColor = temp + color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert
new file mode 100644
index 0000000000..25f96f4464
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetUniform/vec_tests.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform float vuni1;
+uniform vec2 vuni2;
+uniform vec3 vuni3;
+uniform vec4 vuni4;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(vuni1, vuni2[0] + vuni2[1], vuni3[0] + vuni3[1] + vuni3[2], vuni4[0] + vuni4[1] + vuni4[2] + vuni4[3]);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert
new file mode 100644
index 0000000000..a9ba12e213
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute mat3 att3;
+attribute mat4 att4;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4( 1.0,
+
+ att3[0][0] + att3[0][1] + att3[0][2] + att3[1][0] + att3[1][1] + att3[1][2] + att3[2][0] + att3[2][1] + att3[2][2],
+
+ att4[0][0] + att4[0][1] + att4[0][2] + att4[0][3] + att4[1][0] + att4[1][1] + att4[1][2] + att4[1][3] + att4[2][0] + att4[2][1] + att4[2][2] + att4[2][3] + att4[3][0] + att4[3][1] + att4[3][2] + att4[3][3], 1.0 );
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert
new file mode 100644
index 0000000000..06bba63ae6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/mat_tests2.vert
@@ -0,0 +1,24 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute mat2 att2;
+attribute mat3 att3;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4( att2[0][0] + att2[0][1] + att2[1][0] + att2[1][1],
+
+ att3[0][0] + att3[0][1] + att3[0][2] + att3[1][0] + att3[1][1] + att3[1][2] + att3[2][0] + att3[2][1] + att3[2][2],
+
+ 1.0, 1.0 );
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert
new file mode 100644
index 0000000000..3218e9a73f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glGetVertexAttrib/vec_tests.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute float att1;
+attribute vec2 att2;
+attribute vec3 att3;
+attribute vec4 att4;
+varying vec4 color;
+
+void main (void)
+{
+ color = vec4(att1, att2.x + att2.y, att3.x + att3.y + att3.z, att4.x + att4.y + att4.z + att4.w);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag
new file mode 100644
index 0000000000..b2813604c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform bool color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (float(color), 0.0, 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag
new file mode 100644
index 0000000000..fcd1d2e0d4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying float col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert
new file mode 100644
index 0000000000..8fcd8c1bd2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1b_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform bool color;
+varying float col;
+void main (void)
+{
+ col = float(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag
new file mode 100644
index 0000000000..8494f30c37
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color, 0.0, 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag
new file mode 100644
index 0000000000..fdd9357a9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying float col;
+void main (void)
+{
+ gl_FragColor = vec4 (col, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert
new file mode 100644
index 0000000000..ece9ee5e84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1f_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform float color;
+varying float col;
+void main (void)
+{
+ col = color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag
new file mode 100644
index 0000000000..f733d43d48
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform int color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color, 0.0, 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag
new file mode 100644
index 0000000000..fdd9357a9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.frag
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying float col;
+void main (void)
+{
+ gl_FragColor = vec4 (col, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert
new file mode 100644
index 0000000000..5070175baf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/1i_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform int color;
+varying float col;
+void main (void)
+{
+ col = float(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag
new file mode 100644
index 0000000000..42a72c719e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21f_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float color[2];
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0], color[1], 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag
new file mode 100644
index 0000000000..d222ed18cf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/21i_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform int color[2];
+
+void main (void)
+{
+ float r = float(color[0]);
+ float g = float(color[1]);
+ gl_FragColor = vec4 (r/256.0, g/256.0, 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag
new file mode 100644
index 0000000000..b44a935cf4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22f_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec2 color[2];
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0][0], color[0][1], color[1][0], color[1][1]);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag
new file mode 100644
index 0000000000..f2b0ae1b3e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/22i_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform ivec2 color[2];
+
+void main (void)
+{
+ float r = float(color[0][0]);
+ float g = float(color[0][1]);
+ float b = float(color[1][0]);
+ float a = float(color[1][1]);
+
+ gl_FragColor = vec4 (r/256.0, g/256.0, b/256.0, a/256.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag
new file mode 100644
index 0000000000..c89502f293
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23f_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec3 color[2];
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2],
+ color[1][0] + color[1][1] + color[1][2],
+ 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag
new file mode 100644
index 0000000000..b2fb09f2c8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/23i_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform ivec3 color[2];
+
+void main (void)
+{
+ float r = float(color[0][0] + color[0][1] + color[0][2]);
+ float g = float(color[1][0] + color[1][1] + color[1][2]);
+
+ gl_FragColor = vec4(r/256.0, g/256.0, 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag
new file mode 100644
index 0000000000..787ecba389
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24f_frag.frag
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec4 color[2];
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2] + color[0][3],
+ color[1][0] + color[1][1] + color[1][2] + color[1][3],
+ 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag
new file mode 100644
index 0000000000..aef4a8489c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/24i_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform ivec4 color[2];
+
+void main (void)
+{
+ float r = float(color[0][0] + color[0][1] + color[0][2] + color[0][3]);
+ float g = float(color[1][0] + color[1][1] + color[1][2] + color[1][3]);
+
+ gl_FragColor = vec4 (r/256.0, g/256.0, 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag
new file mode 100644
index 0000000000..7b6eb3f2b1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform bvec2 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (vec2(color), 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag
new file mode 100644
index 0000000000..83bf3e6539
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec2 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col[0], col[1], 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert
new file mode 100644
index 0000000000..8285a0eb87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2b_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform bvec2 color;
+varying vec2 col;
+void main (void)
+{
+ col = vec2(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag
new file mode 100644
index 0000000000..2039a887a2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec2 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color, 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag
new file mode 100644
index 0000000000..44dac79c82
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec2 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert
new file mode 100644
index 0000000000..159d66c795
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2f_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform vec2 color;
+varying vec2 col;
+void main (void)
+{
+ col = color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag
new file mode 100644
index 0000000000..4494014822
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform ivec2 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0], color[1], 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag
new file mode 100644
index 0000000000..44dac79c82
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec2 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert
new file mode 100644
index 0000000000..fd14f20c5a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2i_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform ivec2 color;
+varying vec2 col;
+void main (void)
+{
+ col = vec2(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag
new file mode 100644
index 0000000000..fe562e63d0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/2m_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform mat2 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0][0] + color[0][1], color[1][0] + color[1][1], 0.0, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag
new file mode 100644
index 0000000000..bd97506459
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform bvec3 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (vec3(color), 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag
new file mode 100644
index 0000000000..c17b9a1480
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec3 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col[0], col[1], col[2], 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert
new file mode 100644
index 0000000000..b9b8fd4893
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3b_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform bvec3 color;
+varying vec3 col;
+void main (void)
+{
+ col = vec3(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag
new file mode 100644
index 0000000000..f0fa6853c7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec3 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color, 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag
new file mode 100644
index 0000000000..2e98a8660c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec3 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert
new file mode 100644
index 0000000000..c5562f04b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3f_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform vec3 color;
+varying vec3 col;
+void main (void)
+{
+ col = color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag
new file mode 100644
index 0000000000..e17402b6da
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform ivec3 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0], color[1], color[2], 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag
new file mode 100644
index 0000000000..2e98a8660c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec3 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert
new file mode 100644
index 0000000000..7b2aa4bb25
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3i_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform ivec3 color;
+varying vec3 col;
+void main (void)
+{
+ col = vec3(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag
new file mode 100644
index 0000000000..bcc8f4a5a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/3m_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform mat3 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2],
+ color[1][0] + color[1][1] + color[1][2],
+ color[2][0] + color[2][1] + color[2][2],
+ 1.0);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag
new file mode 100644
index 0000000000..de9abd75bf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform bvec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (float(color[0]), float(color[1]), float(color[2]), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag
new file mode 100644
index 0000000000..c6c01468a7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_firstthree_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col[0], col[1], col[2], 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag
new file mode 100644
index 0000000000..8d84731315
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform bvec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (float(color[1]), float(color[2]), float(color[3]), 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag
new file mode 100644
index 0000000000..869d183e06
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_lastthree_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col[1], col[2], col[3], 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert
new file mode 100644
index 0000000000..c09ce89491
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4b_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform bvec4 color;
+varying vec4 col;
+void main (void)
+{
+ col = vec4(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag
new file mode 100644
index 0000000000..7b071c0347
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0], color[1], color[2], color[3]);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag
new file mode 100644
index 0000000000..96b06e0786
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col[0], col[1], col[2], col[3]);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert
new file mode 100644
index 0000000000..71d88d9610
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4f_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform vec4 color;
+varying vec4 col;
+void main (void)
+{
+ col = color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag
new file mode 100644
index 0000000000..55d9053c52
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_frag.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform ivec4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0], color[1], color[2], color[3]);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag
new file mode 100644
index 0000000000..96b06e0786
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 col;
+
+void main (void)
+{
+ gl_FragColor = vec4 (col[0], col[1], col[2], col[3]);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert
new file mode 100644
index 0000000000..42cdfaa4e3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4i_vert.vert
@@ -0,0 +1,18 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute vec4 gtf_Color;
+uniform ivec4 color;
+varying vec4 col;
+void main (void)
+{
+ col = vec4(color);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag
new file mode 100644
index 0000000000..d0600049bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/4m_frag.frag
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform mat4 color;
+
+void main (void)
+{
+ gl_FragColor = vec4 (color[0][0] + color[0][1] + color[0][2] + color[0][3],
+ color[1][0] + color[1][1] + color[1][2] + color[1][3],
+ color[2][0] + color[2][1] + color[2][2] + color[2][3],
+ color[3][0] + color[3][1] + color[3][2] + color[3][3]);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert
new file mode 100644
index 0000000000..b62c57df92
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/default.vert
@@ -0,0 +1,16 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+void main (void)
+{
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+ gl_PointSize = 1.0;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag
new file mode 100644
index 0000000000..e08688b5a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color; // Apply it on a per vertex level
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert
new file mode 100644
index 0000000000..b2edd70556
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2VSU.vert
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform mat4 transforms;
+uniform mat4 anotherMatrix;
+
+varying vec4 color;
+
+void main(void)
+{
+ color = gtf_Color; // color is per vertex and matches glColor already used by Vertex
+
+ gl_Position = gtf_ModelViewProjectionMatrix* transforms * anotherMatrix * gtf_Vertex;
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag
new file mode 100644
index 0000000000..e08688b5a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color; // Apply it on a per vertex level
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert
new file mode 100644
index 0000000000..59e6497387
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrix2arrayVSU.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform mat4 transforms[2];
+
+varying vec4 color;
+
+void main(void)
+{
+ color = gtf_Color; // color is per vertex and matches glColor already used by Vertex
+
+ gl_Position = gtf_ModelViewProjectionMatrix* transforms[0] * transforms[1] * gtf_Vertex;
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag
new file mode 100644
index 0000000000..e08688b5a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color; // Apply it on a per vertex level
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert
new file mode 100644
index 0000000000..4643a15bec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/glUniform/matrixVSU.vert
@@ -0,0 +1,21 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+uniform mat4 transforms;
+varying vec4 color;
+
+void main(void)
+{
+ color = gtf_Color; // color is per vertex and matches glColor used
+
+ gl_Position = gtf_ModelViewProjectionMatrix* transforms * gtf_Vertex;
+
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag
new file mode 100644
index 0000000000..4f3fe797b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float GrainSize;
+uniform vec3 DarkColor;
+uniform vec3 colorSpread;
+
+varying float lightIntensity;
+varying vec3 Position;
+
+void main (void)
+{
+ //
+ // cheap noise
+ //
+ vec3 location = Position;
+
+ vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0));
+ vec3 noise = Position * 10.0 - floorvec - 0.5;
+ noise *= noise;
+ location += noise * 0.12;
+
+ //
+ // distance from axis
+ //
+ float dist = location.x * location.x + location.z * location.z;
+ float grain = dist / GrainSize;
+
+ //
+ // grain effects as function of distance
+ //
+ float brightness = fract(grain);
+ if (brightness > 0.5)
+ brightness = (1.0 - brightness);
+ vec3 color = DarkColor + 0.5 * brightness * (colorSpread);
+
+ brightness = fract(grain*7.0);
+ if (brightness > 0.5)
+ brightness = 1.0 - brightness;
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // also as a function of lines parallel to the axis
+ //
+ brightness = fract(grain*47.0);
+ float line = fract(Position.z + Position.x);
+ float snap = floor(line * 30.0) * (1.0/30.0);
+ if (line < snap + 0.004)
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // apply lighting effects from vertex processor
+ //
+ color *= lightIntensity;
+ color = clamp(color, 0.0, 1.0);
+
+ gl_FragColor = vec4(color, 0.1)
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert
new file mode 100644
index 0000000000..b04c21efe3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/link_program/unsuccessfulcompile_vert.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag
new file mode 100644
index 0000000000..01fae5b25f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.frag
@@ -0,0 +1,14 @@
+
+/*
+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.
+*/
+
+
+varying mediump vec4 color;
+
+void main (void)
+{
+ gl_FragColor = color;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert
new file mode 100644
index 0000000000..bc68fc3881
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/precision_specifiers/precision_specifiers.vert
@@ -0,0 +1,25 @@
+
+/*
+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.
+*/
+
+
+attribute highp vec4 gtf_Color;
+attribute highp vec4 gtf_Vertex;
+uniform highp mat4 gtf_ModelViewProjectionMatrix;
+varying highp vec4 color;
+
+void main (void)
+{
+ mediump int x = 5;
+ lowp int y = 3;
+ mediump float x2 = 5.0;
+ lowp float y2 = 1.0;
+
+ color = vec4(x + y, x2 * y2, x, 1.0);
+
+ color = gtf_Color;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag
new file mode 100644
index 0000000000..863acf1776
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.frag
@@ -0,0 +1,17 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 tc;
+
+void main (void)
+{
+ gl_FragColor = tc;
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert
new file mode 100644
index 0000000000..453cfeb4dd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/relink_program/simple.vert
@@ -0,0 +1,20 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+attribute float gtf_Color;
+
+varying vec4 tc;
+
+void main (void)
+{
+ tc = vec4(gtf_Color, 0.0, 0.0, 1.0);
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag
new file mode 100644
index 0000000000..4f3fe797b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float GrainSize;
+uniform vec3 DarkColor;
+uniform vec3 colorSpread;
+
+varying float lightIntensity;
+varying vec3 Position;
+
+void main (void)
+{
+ //
+ // cheap noise
+ //
+ vec3 location = Position;
+
+ vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0));
+ vec3 noise = Position * 10.0 - floorvec - 0.5;
+ noise *= noise;
+ location += noise * 0.12;
+
+ //
+ // distance from axis
+ //
+ float dist = location.x * location.x + location.z * location.z;
+ float grain = dist / GrainSize;
+
+ //
+ // grain effects as function of distance
+ //
+ float brightness = fract(grain);
+ if (brightness > 0.5)
+ brightness = (1.0 - brightness);
+ vec3 color = DarkColor + 0.5 * brightness * (colorSpread);
+
+ brightness = fract(grain*7.0);
+ if (brightness > 0.5)
+ brightness = 1.0 - brightness;
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // also as a function of lines parallel to the axis
+ //
+ brightness = fract(grain*47.0);
+ float line = fract(Position.z + Position.x);
+ float snap = floor(line * 30.0) * (1.0/30.0);
+ if (line < snap + 0.004)
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // apply lighting effects from vertex processor
+ //
+ color *= lightIntensity;
+ color = clamp(color, 0.0, 1.0);
+
+ gl_FragColor = vec4(color, 0.1)
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert
new file mode 100644
index 0000000000..514042bd8f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/shader_source/unsuccessfulcompile_vert.vert
@@ -0,0 +1,44 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Vertex_Color;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos);
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag
new file mode 100644
index 0000000000..a0493e9158
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/three_uniforms/4f_frag.frag
@@ -0,0 +1,22 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform vec4 color;
+uniform ivec4 icolor;
+uniform bool flag;
+
+void main (void)
+{
+ if(flag)
+ gl_FragColor = vec4 (icolor[0], icolor[1], icolor[2], icolor[3]);
+ else
+ gl_FragColor = vec4 (color[0], color[1], color[2], color[3]);
+} \ No newline at end of file
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag
new file mode 100644
index 0000000000..4f3fe797b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float GrainSize;
+uniform vec3 DarkColor;
+uniform vec3 colorSpread;
+
+varying float lightIntensity;
+varying vec3 Position;
+
+void main (void)
+{
+ //
+ // cheap noise
+ //
+ vec3 location = Position;
+
+ vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0));
+ vec3 noise = Position * 10.0 - floorvec - 0.5;
+ noise *= noise;
+ location += noise * 0.12;
+
+ //
+ // distance from axis
+ //
+ float dist = location.x * location.x + location.z * location.z;
+ float grain = dist / GrainSize;
+
+ //
+ // grain effects as function of distance
+ //
+ float brightness = fract(grain);
+ if (brightness > 0.5)
+ brightness = (1.0 - brightness);
+ vec3 color = DarkColor + 0.5 * brightness * (colorSpread);
+
+ brightness = fract(grain*7.0);
+ if (brightness > 0.5)
+ brightness = 1.0 - brightness;
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // also as a function of lines parallel to the axis
+ //
+ brightness = fract(grain*47.0);
+ float line = fract(Position.z + Position.x);
+ float snap = floor(line * 30.0) * (1.0/30.0);
+ if (line < snap + 0.004)
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // apply lighting effects from vertex processor
+ //
+ color *= lightIntensity;
+ color = clamp(color, 0.0, 1.0);
+
+ gl_FragColor = vec4(color, 0.1)
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert
new file mode 100644
index 0000000000..b04c21efe3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/use_program/unsuccessfulcompile_vert.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_frag.frag
@@ -0,0 +1,46 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert
new file mode 100644
index 0000000000..19faf8698b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/successfulcompile_vert.vert
@@ -0,0 +1,26 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform float Scale;
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex) * Scale;
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ lightIntensity = dot(normalize(LightPosition - vec3(pos)), tnorm) * 1.5;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag
new file mode 100644
index 0000000000..4f3fe797b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_frag.frag
@@ -0,0 +1,66 @@
+
+/*
+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.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+uniform float GrainSize;
+uniform vec3 DarkColor;
+uniform vec3 colorSpread;
+
+varying float lightIntensity;
+varying vec3 Position;
+
+void main (void)
+{
+ //
+ // cheap noise
+ //
+ vec3 location = Position;
+
+ vec3 floorvec = vec3(floor(Position.x * 10.0), 0.0, floor(Position.z * 10.0));
+ vec3 noise = Position * 10.0 - floorvec - 0.5;
+ noise *= noise;
+ location += noise * 0.12;
+
+ //
+ // distance from axis
+ //
+ float dist = location.x * location.x + location.z * location.z;
+ float grain = dist / GrainSize;
+
+ //
+ // grain effects as function of distance
+ //
+ float brightness = fract(grain);
+ if (brightness > 0.5)
+ brightness = (1.0 - brightness);
+ vec3 color = DarkColor + 0.5 * brightness * (colorSpread);
+
+ brightness = fract(grain*7.0);
+ if (brightness > 0.5)
+ brightness = 1.0 - brightness;
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // also as a function of lines parallel to the axis
+ //
+ brightness = fract(grain*47.0);
+ float line = fract(Position.z + Position.x);
+ float snap = floor(line * 30.0) * (1.0/30.0);
+ if (line < snap + 0.004)
+ color -= 0.5 * brightness * colorSpread;
+
+ //
+ // apply lighting effects from vertex processor
+ //
+ color *= lightIntensity;
+ color = clamp(color, 0.0, 1.0);
+
+ gl_FragColor = vec4(color, 0.1)
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert
new file mode 100644
index 0000000000..b04c21efe3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/validate_program/unsuccessfulcompile_vert.vert
@@ -0,0 +1,43 @@
+
+/*
+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.
+*/
+
+
+attribute vec3 gtf_Normal;
+attribute vec4 gtf_Vertex;
+uniform mat3 gtf_NormalMatrix;
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+uniform vec3 NotActiveOne;
+attribute float myAttribute1;
+attribute float myAttribute2;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex_Color;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ //float spec = clamp(dot(reflectVec, viewVec), 0.0, 1.0);
+ float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert
new file mode 100644
index 0000000000..1632a0ee88
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/vertex_program_point_size/point_size.vert
@@ -0,0 +1,19 @@
+
+/*
+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.
+*/
+
+
+attribute vec4 gtf_Vertex;
+attribute vec4 gtf_Color;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ color = gtf_Color;
+ gl_PointSize = 20.0;
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md
new file mode 100644
index 0000000000..e44d84eae4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/README.md
@@ -0,0 +1,20 @@
+OpenGL ES 2.0 GLSL conformance tests
+====================================
+
+The python script, process-ogles2-tests.py, in this folder generates some
+WebGL conformance tests from a subset of the OpenGL ES 2.0 conformance
+tests.
+
+To run it you must have a copy of the OpenGL ES 2.0 conformance test
+source then run it like this
+
+ python process-ogles2-tests.py <path/to/ogles2tests>/GTF_ES/glsl/GTF/mustpass.run
+
+Note: Before running you can safely delete the GTF_ES folder in this
+folder. Everything inside will be regenerated by the script above.
+
+IMPORTANT: From the OpenGL ES 2.0 conformance tests only the .vert and
+.frag files are open source licenesed. All other files in that suite are
+not open source.
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt
new file mode 100644
index 0000000000..e6b87db93a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/mustpass.run.txt
@@ -0,0 +1,64 @@
+# this file is auto-generated. DO NOT EDIT.
+GL/abs/input.run.txt
+GL/acos/input.run.txt
+GL/all/input.run.txt
+GL/any/input.run.txt
+GL/array/input.run.txt
+GL/asin/input.run.txt
+GL/atan/input.run.txt
+GL/biConstants/input.run.txt
+GL/biuDepthRange/input.run.txt
+GL/build/input.run.txt
+GL/built_in_varying_array_out_of_bounds/input.run.txt
+GL/ceil/input.run.txt
+GL/clamp/input.run.txt
+GL/control_flow/input.run.txt
+GL/cos/input.run.txt
+GL/cross/input.run.txt
+GL/default/input.run.txt
+GL/degrees/input.run.txt
+GL/discard/input.run.txt
+GL/distance/input.run.txt
+GL/dot/input.run.txt
+GL/equal/input.run.txt
+GL/exp/input.run.txt
+GL/exp2/input.run.txt
+GL/faceforward/input.run.txt
+GL/floor/input.run.txt
+GL/fract/input.run.txt
+GL/functions/input.run.txt
+GL/gl_FragCoord/input.run.txt
+GL/gl_FrontFacing/input.run.txt
+GL/greaterThan/input.run.txt
+GL/greaterThanEqual/input.run.txt
+GL/inversesqrt/input.run.txt
+GL/length/input.run.txt
+GL/lessThan/input.run.txt
+GL/lessThanEqual/input.run.txt
+GL/log/input.run.txt
+GL/log2/input.run.txt
+GL/mat/input.run.txt
+GL/mat3/input.run.txt
+GL/matrixCompMult/input.run.txt
+GL/max/input.run.txt
+GL/min/input.run.txt
+GL/mix/input.run.txt
+GL/mod/input.run.txt
+GL/normalize/input.run.txt
+GL/not/input.run.txt
+GL/notEqual/input.run.txt
+GL/operators/input.run.txt
+GL/pow/input.run.txt
+GL/radians/input.run.txt
+GL/reflect/input.run.txt
+GL/refract/input.run.txt
+GL/sign/input.run.txt
+GL/sin/input.run.txt
+GL/smoothstep/input.run.txt
+GL/sqrt/input.run.txt
+GL/step/input.run.txt
+GL/struct/input.run.txt
+GL/swizzlers/input.run.txt
+GL/tan/input.run.txt
+GL/vec/input.run.txt
+GL/vec3/input.run.txt
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js
new file mode 100644
index 0000000000..b2a1500496
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/ogles-utils.js
@@ -0,0 +1,791 @@
+/*
+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.
+*/
+OpenGLESTestRunner = (function(){
+var wtu = WebGLTestUtils;
+var gl;
+
+var HALF_GRID_MAX_SIZE = 32;
+var KNOWN_ATTRIBS = [
+ "gtf_Vertex",
+ "gtf_Color"
+];
+
+var GTFPIXELTOLERANCE = 24;
+var GTFACCEPTABLEFAILURECONT = 10;
+var GTFAMDPIXELTOLERANCE = 12;
+var GTFSCORETOLERANCE = 0.65;
+var GTFNCCTOLARANCEZERO = 0.25;
+var GTFKERNALSIZE = 5;
+
+function log(msg) {
+ // debug(msg);
+}
+
+function compareImages(refData, tstData, width, height, diff) {
+ function isPixelSame(offset) {
+ // First do simple check
+ if (Math.abs(refData[offset + 0] - tstData[offset + 0]) <= GTFPIXELTOLERANCE &&
+ Math.abs(refData[offset + 1] - tstData[offset + 1]) <= GTFPIXELTOLERANCE &&
+ Math.abs(refData[offset + 2] - tstData[offset + 2]) <= GTFPIXELTOLERANCE) {
+ return true;
+ }
+
+ // TODO: Implement crazy check that's used in OpenGL ES 2.0 conformance tests.
+ // NOTE: on Desktop things seem to be working. Maybe the more complex check
+ // is needed for embedded systems?
+ return false;
+ }
+
+ var same = true;
+ for (var yy = 0; yy < height; ++yy) {
+ for (var xx = 0; xx < width; ++xx) {
+ var offset = (yy * width + xx) * 4;
+ var diffOffset = ((height - yy - 1) * width + xx) * 4;
+ diff[diffOffset + 0] = 0;
+ diff[diffOffset + 1] = 0;
+ diff[diffOffset + 2] = 0;
+ diff[diffOffset + 3] = 255;
+ if (!isPixelSame(offset)) {
+ diff[diffOffset] = 255;
+ if (same) {
+ same = false;
+ testFailed("pixel @ (" + xx + ", " + yy + " was [" +
+ tstData[offset + 0] + "," +
+ tstData[offset + 1] + "," +
+ tstData[offset + 2] + "," +
+ tstData[offset + 3] + "] expected [" +
+ refData[offset + 0] + "," +
+ refData[offset + 1] + "," +
+ refData[offset + 2] + "," +
+ refData[offset + 3] + "]")
+ }
+ }
+ }
+ }
+ return same;
+}
+
+function persp(fovy, aspect, n, f) {
+ var dz = f - n;
+ var rad = fovy / 2.0 * 3.14159265 / 180;
+
+ var s = Math.sin(rad);
+ if (dz == 0 || s == 0 || aspect == 0)
+ return;
+
+ var cot = Math.cos(rad) / s;
+
+ return [
+ cot / aspect,
+ 0.0,
+ 0.0,
+ 0.0,
+
+ 0.0,
+ cot,
+ 0.0,
+ 0.0,
+
+ 0.0,
+ 0.0,
+ -(f + n) / dz,
+ -1.0,
+
+ 0.0,
+ 0.0,
+ -2.0 * f * n / dz,
+ 0.0
+ ];
+}
+
+function setAttribs(attribs, buffers) {
+ for (var name in attribs) {
+ var buffer = buffers[name];
+ if (!buffer) {
+ testFailed("no buffer for attrib:" + name);
+ continue;
+ }
+ var loc = attribs[name];
+ log("setup attrib: " + loc + " as " + name);
+ var buf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(buffer.data), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(loc);
+ gl.vertexAttribPointer(loc, buffer.numComponents, gl.FLOAT, false, 0, 0);
+ }
+}
+
+function drawSquare(attribs) {
+ var buffers = {
+ "gtf_Vertex": {
+ data: [
+ 1.0, -1.0, -2.0,
+ 1.0, 1.0, -2.0,
+ -1.0, -1.0, -2.0,
+ -1.0, 1.0, -2.0
+ ],
+ numComponents: 3
+ },
+ "gtf_Color": {
+ data: [
+ 0.5, 1.0, 0.0,
+ 0.0, 1.0, 1.0,
+ 1.0, 0.0, 0.0,
+ 0.5, 0.0, 1.0
+ ],
+ numComponents: 3,
+ },
+ "gtf_SecondaryColor": {
+ data: [
+ 0.5, 0.0, 1.0,
+ 1.0, 0.0, 0.0,
+ 0.0, 1.0, 1.0,
+ 0.5, 1.0, 0.0
+ ],
+ numComponents: 3,
+ },
+ "gtf_Normal": {
+ data: [
+ 0.5, 0.0, 1.0,
+ 1.0, 0.0, 0.0,
+ 0.0, 1.0, 1.0,
+ 0.5, 1.0, 0.0
+ ],
+ numComponents: 3,
+ },
+ "gtf_MultiTexCoord0": {
+ data: [
+ 1.0, 0.0,
+ 1.0, 1.0,
+ 0.0, 0.0,
+ 0.0, 1.0
+ ],
+ numComponents: 2,
+ },
+ "gtf_FogCoord": {
+ data: [
+ 0.0,
+ 1.0,
+ 0.0,
+ 1.0
+ ],
+ numComponents: 1,
+ }
+ };
+ setAttribs(attribs, buffers);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+}
+
+function drawFrontBackSquare(attribs) {
+ var front = {
+ "gtf_Vertex": {
+ data: [
+ 1.0, -1.0, -2.0,
+ 1.0, 0.0, -2.0,
+ -1.0, -1.0, -2.0,
+ -1.0, 0.0, -2.0
+ ],
+ numComponents: 3
+ },
+ "gtf_Color": {
+ data: [
+ 0.0, 1.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 0.0, 1.0, 0.0
+ ],
+ numComponents: 3,
+ },
+ "gtf_MultiTexCoord0": {
+ data: [
+ 1.0, 0.0,
+ 1.0, 0.5,
+ 0.0, 0.0,
+ 0.0, 0.5
+ ],
+ numComponents: 2,
+ }
+ };
+ setAttribs(attribs, front);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+
+ var back = {
+ "gtf_Vertex": {
+ data: [
+ 1.0, 1.0, -2.0,
+ 1.0, 0.0, -2.0,
+ -1.0, 1.0, -2.0,
+ -1.0, 0.0, -2.0
+ ],
+ numComponents: 3
+ },
+ "gtf_Color": {
+ data: [
+ 1.0, 0.0, 0.0,
+ 1.0, 0.0, 0.0,
+ 1.0, 0.0, 0.0,
+ 1.0, 0.0, 0.0
+ ],
+ numComponents: 3,
+ },
+ "gtf_MultiTexCoord0": {
+ data: [
+ 1.0, 0.1,
+ 1.0, 0.5,
+ 0.0, 0.1,
+ 0.0, 0.5
+ ],
+ numComponents: 2,
+ }
+ };
+ setAttribs(attribs, back);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+}
+
+function drawGrid(attribs, width, height) {
+ var n = Math.min(Math.floor(Math.max(width, height) / 4), HALF_GRID_MAX_SIZE);
+
+ var numVertices = (n + n) * (n + n) * 6;
+
+ var gridVertices = [];
+ var gridColors = [];
+ var gridSecColors = [];
+ var gridNormals = [];
+ var gridFogCoords = [];
+ var gridTexCoords0 = [];
+
+ var currentVertex = 0;
+ var currentColor = 0;
+ var currentSecColor = 0;
+ var currentTexCoord0 = 0;
+ var currentNormal = 0;
+ var currentFogCoord = 0;
+
+ var z = -2.0;
+ for(var i = -n; i < n; ++i)
+ {
+ var x1 = i / n;
+ var x2 = (i + 1) / n;
+ for(var j = -n; j < n; ++j)
+ {
+ var y1 = j / n;
+ var y2 = (j + 1) / n;
+
+ // VERTEX 0
+ gridVertices[currentVertex++] = x1;
+ gridVertices[currentVertex++] = y1;
+ gridVertices[currentVertex++] = z;
+ gridColors[currentColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
+ gridColors[currentColor++] = (x1 + 1.0) / 2.0;
+ gridColors[currentColor++] = (y1 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
+ gridSecColors[currentSecColor++] = (x2 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (x1 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (y1 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
+ gridNormals[currentNormal++] = (x2 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = (y2 + 1.0) / 2.0;
+ gridFogCoords[currentFogCoord++] = (y1 + 1.0) / 2.0;
+
+ // VERTEX 1
+ gridVertices[currentVertex++] = x2;
+ gridVertices[currentVertex++] = y1;
+ gridVertices[currentVertex++] = z;
+ gridColors[currentColor++] = 1.0 - (x2 + y1 + 2.0) / 4.0;
+ gridColors[currentColor++] = (x2 + 1.0) / 2.0;
+ gridColors[currentColor++] = (y1 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = 1.0 - (x1 + y2 + 2.0) / 4.0;
+ gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (x2 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (y1 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = 1.0 - (x1 + y2 + 2.0) / 4.0;
+ gridNormals[currentNormal++] = (x1 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = (y2 + 1.0) / 2.0;
+ gridFogCoords[currentFogCoord++] = (y1 + 1.0) / 2.0;
+
+ // VERTEX 2
+ gridVertices[currentVertex++] = x2;
+ gridVertices[currentVertex++] = y2;
+ gridVertices[currentVertex++] = z;
+ gridColors[currentColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
+ gridColors[currentColor++] = (x2 + 1.0) / 2.0;
+ gridColors[currentColor++] = (y2 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
+ gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = (y1 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (x2 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (y2 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
+ gridNormals[currentNormal++] = (x1 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = (y1 + 1.0) / 2.0;
+ gridFogCoords[currentFogCoord++] = (y2 + 1.0) / 2.0;
+
+ // VERTEX 2
+ gridVertices[currentVertex++] = x2;
+ gridVertices[currentVertex++] = y2;
+ gridVertices[currentVertex++] = z;
+ gridColors[currentColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
+ gridColors[currentColor++] = (x2 + 1.0) / 2.0;
+ gridColors[currentColor++] = (y2 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
+ gridSecColors[currentSecColor++] = (x1 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = (y1 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (x2 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (y2 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
+ gridNormals[currentNormal++] = (x1 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = (y1 + 1.0) / 2.0;
+ gridFogCoords[currentFogCoord++] = (y2 + 1.0) / 2.0;
+
+ // VERTEX 3
+ gridVertices[currentVertex++] = x1;
+ gridVertices[currentVertex++] = y2;
+ gridVertices[currentVertex++] = z;
+ gridColors[currentColor++] = 1.0 - (x1 + y2 + 2.0) / 4.0;
+ gridColors[currentColor++] = (x1 + 1.0) / 2.0;
+ gridColors[currentColor++] = (y2 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = 1.0 - (x2 + y1 + 2.0) / 4.0;
+ gridSecColors[currentSecColor++] = (x2 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = (y1 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (x1 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (y2 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = 1.0 - (x2 + y1 + 2.0) / 4.0;
+ gridNormals[currentNormal++] = (x2 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = (y1 + 1.0) / 2.0;
+ gridFogCoords[currentFogCoord++] = (y2 + 1.0) / 2.0;
+
+ // VERTEX 0
+ gridVertices[currentVertex++] = x1;
+ gridVertices[currentVertex++] = y1;
+ gridVertices[currentVertex++] = z;
+ gridColors[currentColor++] = 1.0 - (x1 + y1 + 2.0) / 4.0;
+ gridColors[currentColor++] = (x1 + 1.0) / 2.0;
+ gridColors[currentColor++] = (y1 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
+ gridSecColors[currentSecColor++] = (x2 + 1.0) / 2.0;
+ gridSecColors[currentSecColor++] = (y2 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (x1 + 1.0) / 2.0;
+ gridTexCoords0[currentTexCoord0++] = (y1 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = 1.0 - (x2 + y2 + 2.0) / 4.0;
+ gridNormals[currentNormal++] = (x2 + 1.0) / 2.0;
+ gridNormals[currentNormal++] = (y2 + 1.0) / 2.0;
+ gridFogCoords[currentFogCoord++] = (y1 + 1.0) / 2.0;
+ }
+ }
+
+ var buffers = {
+ "gtf_Vertex": { data: gridVertices, numComponents: 3 },
+ "gtf_Color": { data: gridColors, numComponents: 3 },
+ "gtf_SecondaryColor": { data: gridSecColors, numComponents: 3 },
+ "gtf_Normal": { data: gridNormals, numComponents: 3 },
+ "gtf_FogCoord": { data: gridFogCoords, numComponents: 1 },
+ "gtf_MultiTexCoord0": { data: gridTexCoords0, numComponents: 2 }
+ };
+ setAttribs(attribs, buffers);
+ gl.drawArrays(gl.TRIANGLES, 0, numVertices);
+}
+
+var MODEL_FUNCS = {
+ square: drawSquare,
+ frontbacksquare: drawFrontBackSquare,
+ grid: drawGrid
+};
+
+function drawWithProgram(program, programInfo, test) {
+ gl.useProgram(program);
+ var attribs = { };
+
+ var numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);
+ for (var ii = 0; ii < numAttribs; ++ii) {
+ var info = gl.getActiveAttrib(program, ii);
+ var name = info.name;
+ var location = gl.getAttribLocation(program, name);
+ attribs[name] = location;
+
+ if (KNOWN_ATTRIBS.indexOf(name) < 0) {
+ testFailed("unknown attrib:" + name)
+ }
+ }
+
+ var uniforms = { };
+ var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+ for (var ii = 0; ii < numUniforms; ++ii) {
+ var info = gl.getActiveUniform(program, ii);
+ var name = info.name;
+ if (name.match(/\[0\]$/)) {
+ name = name.substr(0, name.length - 3);
+ }
+ var location = gl.getUniformLocation(program, name);
+ uniforms[name] = {location: location};
+ }
+
+ var getUniformLocation = function(name) {
+ var uniform = uniforms[name];
+ if (uniform) {
+ uniform.used = true;
+ return uniform.location;
+ }
+ return null;
+ }
+
+ // Set known uniforms
+ var loc = getUniformLocation("gtf_ModelViewProjectionMatrix");
+ if (loc) {
+ gl.uniformMatrix4fv(
+ loc,
+ false,
+ persp(60, 1, 1, 30));
+ }
+ var loc = getUniformLocation("viewportwidth");
+ if (loc) {
+ gl.uniform1f(loc, gl.canvas.width);
+ }
+ var loc = getUniformLocation("viewportheight");
+ if (loc) {
+ gl.uniform1f(loc, gl.canvas.height);
+ }
+
+ // Set test specific uniforms
+ for (var name in programInfo.uniforms) {
+ var location = getUniformLocation(name);
+ if (!location) {
+ continue;
+ }
+ var uniform = programInfo.uniforms[name];
+ var type = uniform.type;
+ var value = uniform.value;
+ var transpose = uniform.transpose;
+ if (transpose !== undefined) {
+ log("gl." + type + '("' + name + '", ' + transpose + ", " + value + ")");
+ gl[type](location, transpose, value);
+ } else if (!type.match("v$")) {
+ var args = [location];
+ for (var ii = 0; ii < value.length; ++ii) {
+ args.push(value[ii]);
+ }
+ gl[type].apply(gl, args);
+ log("gl." + type + '("' + name + '", ' + args.slice(1) + ")");
+ } else {
+ log("gl." + type + '("' + name + '", ' + value + ")");
+ gl[type](location, value);
+ }
+ var err = gl.getError();
+ if (err != gl.NO_ERROR) {
+ testFailed(wtu.glEnumToString(gl, err) + " generated setting uniform: " + name);
+ }
+ }
+
+ // Filter out specified built-in uniforms
+ if (programInfo.builtin_uniforms) {
+ var num_builtins_found = 0;
+ var valid_values = programInfo.builtin_uniforms.valid_values;
+ for (var index in valid_values) {
+ var uniform = uniforms[valid_values[index]];
+ if (uniform) {
+ ++num_builtins_found;
+ uniform.builtin = true;
+ }
+ }
+
+ var min_required = programInfo.builtin_uniforms.min_required;
+ if (num_builtins_found < min_required) {
+ testFailed("only found " + num_builtins_found + " of " + min_required +
+ " required built-in uniforms: " + valid_values);
+ }
+ }
+
+ // Check for unset uniforms
+ for (var name in uniforms) {
+ var uniform = uniforms[name];
+ if (!uniform.used && !uniform.builtin) {
+ testFailed("uniform " + name + " never set");
+ }
+ }
+
+
+ for (var state in test.state) {
+ var fields = test.state[state];
+ switch (state) {
+ case 'depthrange':
+ gl.depthRange(fields.near, fields.far);
+ break;
+ default:
+ testFailed("unknown state: " + state)
+ }
+ }
+
+ gl.clearColor(0, 0, 0, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ var model = test.model || "square";
+ var fn = MODEL_FUNCS[model];
+ if (!fn) {
+ testFailed("unknown model type: " + model)
+ } else {
+ log("draw as: " + model)
+ fn(attribs, gl.canvas.width, gl.canvas.height);
+ }
+
+ var pixels = new Uint8Array(gl.canvas.width * gl.canvas.height * 4);
+ gl.readPixels(0, 0, gl.canvas.width, gl.canvas.height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
+ return {
+ width: gl.canvas.width,
+ height: gl.canvas.height,
+ pixels: pixels,
+ img: wtu.makeImageFromCanvas(gl.canvas)
+ };
+}
+
+function runProgram(programInfo, test, label, callback) {
+ var shaders = [];
+ var source = [];
+ var count = 0;
+
+ function loadShader(path, type, index) {
+ wtu.loadTextFileAsync(path, function(success, text) {
+ addShader(success, text, type, path, index);
+ });
+ }
+
+ function addShader(success, text, type, path, index) {
+ ++count;
+ if (!success) {
+ testFailed("could not load: " + path);
+ } else {
+ var shader = wtu.loadShader(gl, text, type);
+ shaders.push(shader);
+ source[index] = text;
+ }
+ if (count == 2) {
+ var result;
+ if (shaders.length == 2) {
+ debug("");
+ if (!quietMode()) {
+ var consoleDiv = document.getElementById("console");
+ wtu.addShaderSources(
+ gl, consoleDiv, label + " vertex shader", shaders[0], source[0],
+ programInfo.vertexShader);
+ wtu.addShaderSources(
+ gl, consoleDiv, label + " fragment shader", shaders[1], source[1],
+ programInfo.fragmentShader);
+ }
+ var program = wtu.createProgram(gl, shaders[0], shaders[1]);
+ result = drawWithProgram(program, programInfo, test);
+ }
+ callback(result);
+ }
+ }
+
+ loadShader(programInfo.vertexShader, gl.VERTEX_SHADER, 0);
+ loadShader(programInfo.fragmentShader, gl.FRAGMENT_SHADER, 1);
+}
+
+function compareResults(expected, actual) {
+ var width = expected.width;
+ var height = expected.height;
+ var canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ var ctx = canvas.getContext("2d");
+ var imgData = ctx.getImageData(0, 0, width, height);
+ var tolerance = 0;
+
+ var expData = expected.pixels;
+ var actData = actual.pixels;
+
+ var same = compareImages(expData, actData, width, height, imgData.data);
+
+ var console = document.getElementById("console");
+ var diffImg = null;
+ if (!same) {
+ ctx.putImageData(imgData, 0, 0);
+ diffImg = wtu.makeImageFromCanvas(canvas);
+ }
+
+ if (!quietMode()) {
+ var div = document.createElement("div");
+ div.className = "testimages";
+ wtu.insertImage(div, "reference", expected.img);
+ wtu.insertImage(div, "test", actual.img);
+ if (diffImg) {
+ wtu.insertImage(div, "diff", diffImg);
+ }
+ div.appendChild(document.createElement('br'));
+
+ console.appendChild(div);
+ }
+
+ if (!same) {
+ testFailed("images are different");
+ } else {
+ testPassed("images are the same");
+ }
+
+ if (!quietMode())
+ console.appendChild(document.createElement('hr'));
+}
+
+function runCompareTest(test, callback) {
+ debug("");
+ debug("test: " + test.name);
+ var results = [];
+ var count = 0;
+
+ function storeResults(index) {
+ return function(result) {
+ results[index] = result;
+ ++count;
+ if (count == 2) {
+ compareResults(results[0], results[1]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ callback();
+ }
+ }
+ }
+
+ runProgram(test.referenceProgram, test, "reference", storeResults(0));
+ runProgram(test.testProgram, test, "test", storeResults(1));
+}
+
+function runBuildTest(test, callback) {
+ debug("");
+ debug("test: " + test.name);
+
+ var shaders = [null, null];
+ var source = ["",""];
+ var success = [undefined, undefined];
+ var count = 0;
+
+ function loadShader(path, type, index) {
+ if (path == "empty") {
+ shaders[index] = gl.createShader();
+ success[index] = true;
+ source[index] = "/* empty */";
+ attachAndLink();
+ } else {
+ wtu.loadTextFileAsync(path, function(loadSuccess, text) {
+ if (!loadSuccess) {
+ success[index] = false;
+ source[index] = "/* could not load */";
+ testFailed("could not load:" + path);
+ } else {
+ source[index] = text;
+ shaders[index] = wtu.loadShader(gl, text, type, function(index) {
+ return function(msg) {
+ success[index] = false
+ }
+ }(index));
+ if (success[index] === undefined) {
+ success[index] = true;
+ }
+ }
+ attachAndLink();
+ });
+ }
+ }
+
+ function attachAndLink() {
+ ++count;
+ if (count == 2) {
+ if (!quietMode()) {
+ debug("");
+ var c = document.getElementById("console");
+ wtu.addShaderSource(
+ c, "vertex shader", source[0], test.testProgram.vertexShader);
+ debug("compile: " + (success[0] ? "success" : "fail"));
+ wtu.addShaderSource(
+ c, "fragment shader", source[1], test.testProgram.fragmentShader);
+ debug("compile: " + (success[1] ? "success" : "fail"));
+ }
+ compileSuccess = (success[0] && success[1]);
+ if (!test.compstat) {
+ if (compileSuccess) {
+ testFailed("expected compile failure but was successful");
+ } else {
+ testPassed("expected compile failure and it failed");
+ }
+ } else {
+ if (compileSuccess) {
+ testPassed("expected compile success and it was successful");
+ } else {
+ testFailed("expected compile success but it failed");
+ }
+ var linkSuccess = true;
+ var program = wtu.createProgram(gl, shaders[0], shaders[1], function() {
+ linkSuccess = false;
+ });
+ if (linkSuccess !== test.linkstat) {
+ testFailed("expected link to " + (test.linkstat ? "succeed" : "fail"));
+ } else {
+ testPassed("shaders compiled and linked as expected.");
+ }
+ }
+ callback();
+ }
+ }
+
+ loadShader(test.testProgram.vertexShader, gl.VERTEX_SHADER, 0);
+ loadShader(test.testProgram.fragmentShader, gl.FRAGMENT_SHADER, 1);
+}
+
+var testPatterns = {
+ compare: runCompareTest,
+ build: runBuildTest,
+
+ dummy: null // just here to mark the end
+};
+
+function LogGLCall(functionName, args) {
+ console.log("gl." + functionName + "(" +
+ WebGLDebugUtils.glFunctionArgsToString(functionName, args) + ")");
+}
+
+// Runs the tests async since they will load shaders.
+function run(obj) {
+ description();
+
+ var canvas = document.getElementById("example");
+ gl = wtu.create3DContext(canvas);
+ if (window.WebGLDebugUtils) {
+ gl = WebGLDebugUtils.makeDebugContext(gl, undefined, LogGLCall);
+ }
+ if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+ return;
+ }
+
+ if (gl.canvas.width != 500 || gl.canvas.height != 500) {
+ testFailed("canvas must be 500x500 pixels: Several shaders are hard coded to this size.");
+ }
+
+ var tests = obj.tests;
+ var ndx = 0;
+
+ function runNextTest() {
+ if (ndx < tests.length) {
+ var test = tests[ndx++];
+ var fn = testPatterns[test.pattern];
+ if (!fn) {
+ testFailed("test pattern: " + test.pattern + " not supoprted")
+ runNextTest();
+ } else {
+ fn(test, runNextTest);
+ }
+ } else {
+ finishTest();
+ }
+ }
+ runNextTest();
+}
+
+return {
+ run: run,
+};
+}());
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py
new file mode 100644
index 0000000000..49d9f874d9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py
@@ -0,0 +1,568 @@
+#! /usr/bin/env python2
+
+"""generates tests from OpenGL ES 2.0 .run/.test files."""
+
+import os
+import os.path
+import sys
+import re
+import json
+import shutil
+from optparse import OptionParser
+from xml.dom.minidom import parse
+
+if sys.version < '2.6':
+ print 'Wrong Python Version !!!: Need >= 2.6'
+ sys.exit(1)
+
+# each shader test generates up to 3 512x512 images.
+# a 512x512 image takes 1meg of memory so set this
+# number apporpriate for the platform with
+# the smallest memory issue. At 8 that means
+# at least 24 meg is needed to run the test.
+MAX_TESTS_PER_SET = 8
+
+VERBOSE = False
+
+FILTERS = [
+ re.compile("GL/"),
+]
+
+LICENSE = """
+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.
+""".strip()
+
+COMMENT_RE = re.compile("/\*\n\*\*\s+Copyright.*?\*/",
+ re.IGNORECASE | re.DOTALL)
+REMOVE_COPYRIGHT_RE = re.compile("\/\/\s+Copyright.*?\n",
+ re.IGNORECASE | re.DOTALL)
+MATRIX_RE = re.compile("Matrix(\\d)")
+
+VALID_UNIFORM_TYPES = [
+ "uniform1f",
+ "uniform1fv",
+ "uniform1fv",
+ "uniform1i",
+ "uniform1iv",
+ "uniform1iv",
+ "uniform2f",
+ "uniform2fv",
+ "uniform2fv",
+ "uniform2i",
+ "uniform2iv",
+ "uniform2iv",
+ "uniform3f",
+ "uniform3fv",
+ "uniform3fv",
+ "uniform3i",
+ "uniform3iv",
+ "uniform3iv",
+ "uniform4f",
+ "uniform4fv",
+ "uniform4fv",
+ "uniform4i",
+ "uniform4iv",
+ "uniform4ivy",
+ "uniformMatrix2fv",
+ "uniformMatrix2fv",
+ "uniformMatrix3fv",
+ "uniformMatrix3fv",
+ "uniformMatrix4fv",
+ "uniformMatrix4fv",
+]
+
+SUBSTITUTIONS = [
+ ("uniformmat3fv", "uniformMatrix3fv"),
+ ("uniformmat4fv", "uniformMatrix4fv"),
+]
+
+
+def Log(msg):
+ global VERBOSE
+ if VERBOSE:
+ print msg
+
+
+def TransposeMatrix(values, dim):
+ size = dim * dim
+ count = len(values) / size
+ for m in range(0, count):
+ offset = m * size
+ for i in range(0, dim):
+ for j in range(i + 1, dim):
+ t = values[offset + i * dim + j]
+ values[offset + i * dim + j] = values[offset + j * dim + i]
+ values[offset + j * dim + i] = t
+
+
+def GetValidTypeName(type_name):
+ global VALID_UNIFORM_TYPES
+ global SUBSTITUTIONS
+ for subst in SUBSTITUTIONS:
+ type_name = type_name.replace(subst[0], subst[1])
+ if not type_name in VALID_UNIFORM_TYPES:
+ print "unknown type name: ", type_name
+ raise SyntaxError
+ return type_name
+
+
+def WriteOpen(filename):
+ dirname = os.path.dirname(filename)
+ if len(dirname) > 0 and not os.path.exists(dirname):
+ os.makedirs(dirname)
+ return open(filename, "wb")
+
+
+class TxtWriter():
+ def __init__(self, filename):
+ self.filename = filename
+ self.lines = []
+
+ def Write(self, line):
+ self.lines.append(line)
+
+ def Close(self):
+ if len(self.lines) > 0:
+ Log("Writing: %s" % self.filename)
+ f = WriteOpen(self.filename)
+ f.write("# this file is auto-generated. DO NOT EDIT.\n")
+ f.write("".join(self.lines))
+ f.close()
+
+
+def ReadFileAsLines(filename):
+ f = open(filename, "r")
+ lines = f.readlines()
+ f.close()
+ return [line.strip() for line in lines]
+
+
+def ReadFile(filename):
+ f = open(filename, "r")
+ content = f.read()
+ f.close()
+ return content.replace("\r\n", "\n")
+
+
+def Chunkify(list, chunk_size):
+ """divides an array into chunks of chunk_size"""
+ return [list[i:i + chunk_size] for i in range(0, len(list), chunk_size)]
+
+
+def GetText(nodelist):
+ """Gets the text of from a list of nodes"""
+ rc = []
+ for node in nodelist:
+ if node.nodeType == node.TEXT_NODE:
+ rc.append(node.data)
+ return ''.join(rc)
+
+
+def GetElementText(node, name):
+ """Gets the text of an element"""
+ elements = node.getElementsByTagName(name)
+ if len(elements) > 0:
+ return GetText(elements[0].childNodes)
+ else:
+ return None
+
+
+def GetBoolElement(node, name):
+ text = GetElementText(node, name)
+ return text.lower() == "true"
+
+
+def GetModel(node):
+ """Gets the model"""
+ model = GetElementText(node, "model")
+ if model and len(model.strip()) == 0:
+ elements = node.getElementsByTagName("model")
+ if len(elements) > 0:
+ model = GetElementText(elements[0], "filename")
+ return model
+
+
+def RelativizePaths(base, paths, template):
+ """converts paths to relative paths"""
+ rels = []
+ for p in paths:
+ #print "---"
+ #print "base: ", os.path.abspath(base)
+ #print "path: ", os.path.abspath(p)
+ relpath = os.path.relpath(os.path.abspath(p), os.path.dirname(os.path.abspath(base))).replace("\\", "/")
+ #print "rel : ", relpath
+ rels.append(template % relpath)
+ return "\n".join(rels)
+
+
+def CopyFile(filename, src, dst):
+ s = os.path.abspath(os.path.join(os.path.dirname(src), filename))
+ d = os.path.abspath(os.path.join(os.path.dirname(dst), filename))
+ dst_dir = os.path.dirname(d)
+ if not os.path.exists(dst_dir):
+ os.makedirs(dst_dir)
+ shutil.copyfile(s, d)
+
+
+def CopyShader(filename, src, dst):
+ s = os.path.abspath(os.path.join(os.path.dirname(src), filename))
+ d = os.path.abspath(os.path.join(os.path.dirname(dst), filename))
+ text = ReadFile(s)
+ # By agreement with the Khronos OpenGL working group we are allowed
+ # to open source only the .vert and .frag files from the OpenGL ES 2.0
+ # conformance tests. All other files from the OpenGL ES 2.0 conformance
+ # tests are not included.
+ marker = "insert-copyright-here"
+ new_text = COMMENT_RE.sub(marker, text)
+ if new_text == text:
+ print "no matching license found:", s
+ raise RuntimeError
+ new_text = REMOVE_COPYRIGHT_RE.sub("", new_text)
+ glsl_license = '/*\n' + LICENSE + '\n*/'
+ new_text = new_text.replace(marker, glsl_license)
+ f = WriteOpen(d)
+ f.write(new_text)
+ f.close()
+
+
+def IsOneOf(string, regexs):
+ for regex in regexs:
+ if re.match(regex, string):
+ return True
+ return False
+
+
+def CheckForUnknownTags(valid_tags, node, depth=1):
+ """do a hacky check to make sure we're not missing something."""
+ for child in node.childNodes:
+ if child.localName and not IsOneOf(child.localName, valid_tags[0]):
+ print "unsupported tag:", child.localName
+ print "depth:", depth
+ raise SyntaxError
+ else:
+ if len(valid_tags) > 1:
+ CheckForUnknownTags(valid_tags[1:], child, depth + 1)
+
+
+def IsFileWeWant(filename):
+ for f in FILTERS:
+ if f.search(filename):
+ return True
+ return False
+
+
+class TestReader():
+ """class to read and parse tests"""
+
+ def __init__(self, basepath):
+ self.tests = []
+ self.modes = {}
+ self.patterns = {}
+ self.basepath = basepath
+
+ def Print(self, msg):
+ if self.verbose:
+ print msg
+
+ def MakeOutPath(self, filename):
+ relpath = os.path.relpath(os.path.abspath(filename), os.path.dirname(os.path.abspath(self.basepath)))
+ return relpath
+
+ def ReadTests(self, filename):
+ """reads a .run file and parses."""
+ Log("reading %s" % filename)
+ outname = self.MakeOutPath(filename + ".txt")
+ f = TxtWriter(outname)
+ dirname = os.path.dirname(filename)
+ lines = ReadFileAsLines(filename)
+ count = 0
+ tests_data = []
+ for line in lines:
+ if len(line) > 0 and not line.startswith("#"):
+ fname = os.path.join(dirname, line)
+ if line.endswith(".run"):
+ if self.ReadTests(fname):
+ f.Write(line + ".txt\n")
+ count += 1
+ elif line.endswith(".test"):
+ tests_data.extend(self.ReadTest(fname))
+ else:
+ print "Error in %s:%d:%s" % (filename, count, line)
+ raise SyntaxError()
+ if len(tests_data):
+ global MAX_TESTS_PER_SET
+ sets = Chunkify(tests_data, MAX_TESTS_PER_SET)
+ id = 1
+ for set in sets:
+ suffix = "_%03d_to_%03d" % (id, id + len(set) - 1)
+ test_outname = self.MakeOutPath(filename + suffix + ".html")
+ if os.path.basename(test_outname).startswith("input.run"):
+ dname = os.path.dirname(test_outname)
+ folder_name = os.path.basename(dname)
+ test_outname = os.path.join(dname, folder_name + suffix + ".html")
+ self.WriteTests(filename, test_outname, {"tests":set})
+ f.Write(os.path.basename(test_outname) + "\n")
+ id += len(set)
+ count += 1
+ f.Close()
+ return count
+
+ def ReadTest(self, filename):
+ """reads a .test file and parses."""
+ Log("reading %s" % filename)
+ dom = parse(filename)
+ tests = dom.getElementsByTagName("test")
+ tests_data = []
+ outname = self.MakeOutPath(filename + ".html")
+ for test in tests:
+ if not IsFileWeWant(filename):
+ self.CopyShaders(test, filename, outname)
+ else:
+ test_data = self.ProcessTest(test, filename, outname, len(tests_data))
+ if test_data:
+ tests_data.append(test_data)
+ return tests_data
+
+ def ProcessTest(self, test, filename, outname, id):
+ """Process a test"""
+ mode = test.getAttribute("mode")
+ pattern = test.getAttribute("pattern")
+ self.modes[mode] = 1
+ self.patterns[pattern] = 1
+ Log ("%d: mode: %s pattern: %s" % (id, mode, pattern))
+ method = getattr(self, 'Process_' + pattern)
+ test_data = method(test, filename, outname)
+ if test_data:
+ test_data["pattern"] = pattern
+ return test_data
+
+ def WriteTests(self, filename, outname, tests_data):
+ Log("Writing %s" % outname)
+ template = """<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+%(license)s
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: %(title)s</title>
+%(css)s
+%(scripts)s
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run(%(tests_data)s);
+var successfullyParsed = true;
+</script>
+</html>
+"""
+ css = [
+ "../../resources/js-test-style.css",
+ "../../resources/ogles-tests.css",
+ ]
+ scripts = [
+ "../../resources/js-test-pre.js",
+ "../../resources/webgl-test-utils.js",
+ "ogles-utils.js",
+ ]
+ css_html = RelativizePaths(outname, css, '<link rel="stylesheet" href="%s" />')
+ scripts_html = RelativizePaths(outname, scripts, '<script src="%s"></script>')
+
+ html_license = '<!--\n' + LICENSE + '\n-->'
+ f = WriteOpen(outname)
+ f.write(template % {
+ "license": html_license,
+ "css": css_html,
+ "scripts": scripts_html,
+ "title": os.path.basename(outname),
+ "tests_data": json.dumps(tests_data, indent=2)
+ })
+ f.close()
+
+
+ def CopyShaders(self, test, filename, outname):
+ """For tests we don't actually support yet, at least copy the shaders"""
+ shaders = test.getElementsByTagName("shader")
+ for shader in shaders:
+ for name in ["vertshader", "fragshader"]:
+ s = GetElementText(shader, name)
+ if s and s != "empty":
+ CopyShader(s, filename, outname)
+
+ #
+ # pattern handlers.
+ #
+
+ def Process_compare(self, test, filename, outname):
+ global MATRIX_RE
+
+ valid_tags = [
+ ["shader", "model", "glstate"],
+ ["uniform", "vertshader", "fragshader", "filename", "depthrange"],
+ ["name", "count", "transpose", "uniform*", "near", "far"],
+ ]
+ CheckForUnknownTags(valid_tags, test)
+
+ # parse the test
+ shaders = test.getElementsByTagName("shader")
+ shaderInfos = []
+ for shader in shaders:
+ v = GetElementText(shader, "vertshader")
+ f = GetElementText(shader, "fragshader")
+ CopyShader(v, filename, outname)
+ CopyShader(f, filename, outname)
+ info = {
+ "vertexShader": v,
+ "fragmentShader": f,
+ }
+ shaderInfos.append(info)
+ uniformElems = shader.getElementsByTagName("uniform")
+ if len(uniformElems) > 0:
+ uniforms = {}
+ info["uniforms"] = uniforms
+ for uniformElem in uniformElems:
+ uniform = {"count": 1}
+ for child in uniformElem.childNodes:
+ if child.localName == None:
+ pass
+ elif child.localName == "name":
+ uniforms[GetText(child.childNodes)] = uniform
+ elif child.localName == "count":
+ uniform["count"] = int(GetText(child.childNodes))
+ elif child.localName == "transpose":
+ uniform["transpose"] = (GetText(child.childNodes) == "true")
+ else:
+ if "type" in uniform:
+ print "utype was:", uniform["type"], " found ", child.localName
+ raise SyntaxError
+ type_name = GetValidTypeName(child.localName)
+ uniform["type"] = type_name
+ valueText = GetText(child.childNodes).replace(",", " ")
+ uniform["value"] = [float(t) for t in valueText.split()]
+ m = MATRIX_RE.search(type_name)
+ if m:
+ # Why are these backward from the API?!?!?
+ TransposeMatrix(uniform["value"], int(m.group(1)))
+ data = {
+ "name": os.path.basename(outname),
+ "model": GetModel(test),
+ "referenceProgram": shaderInfos[1],
+ "testProgram": shaderInfos[0],
+ }
+ gl_states = test.getElementsByTagName("glstate")
+ if len(gl_states) > 0:
+ state = {}
+ data["state"] = state
+ for gl_state in gl_states:
+ for state_name in gl_state.childNodes:
+ if state_name.localName:
+ values = {}
+ for field in state_name.childNodes:
+ if field.localName:
+ values[field.localName] = GetText(field.childNodes)
+ state[state_name.localName] = values
+ return data
+
+ def Process_shaderload(self, test, filename, outname):
+ """no need for shaderload tests"""
+ self.CopyShaders(test, filename, outname)
+
+ def Process_extension(self, test, filename, outname):
+ """no need for extension tests"""
+ self.CopyShaders(test, filename, outname)
+
+ def Process_createtests(self, test, filename, outname):
+ Log("createtests Not implemented: %s" % filename)
+ self.CopyShaders(test, filename, outname)
+
+ def Process_GL2Test(self, test, filename, outname):
+ Log("GL2Test Not implemented: %s" % filename)
+ self.CopyShaders(test, filename, outname)
+
+ def Process_uniformquery(self, test, filename, outname):
+ Log("uniformquery Not implemented: %s" % filename)
+ self.CopyShaders(test, filename, outname)
+
+ def Process_egl_image_external(self, test, filename, outname):
+ """no need for egl_image_external tests"""
+ self.CopyShaders(test, filename, outname)
+
+ def Process_dismount(self, test, filename, outname):
+ Log("dismount Not implemented: %s" % filename)
+ self.CopyShaders(test, filename, outname)
+
+ def Process_build(self, test, filename, outname):
+ """don't need build tests"""
+ valid_tags = [
+ ["shader", "compstat", "linkstat"],
+ ["vertshader", "fragshader"],
+ ]
+ CheckForUnknownTags(valid_tags, test)
+
+ shader = test.getElementsByTagName("shader")
+ if not shader:
+ return None
+ vs = GetElementText(shader[0], "vertshader")
+ fs = GetElementText(shader[0], "fragshader")
+ if vs and vs != "empty":
+ CopyShader(vs, filename, outname)
+ if fs and fs != "empty":
+ CopyShader(fs, filename, outname)
+ data = {
+ "name": os.path.basename(outname),
+ "compstat": bool(GetBoolElement(test, "compstat")),
+ "linkstat": bool(GetBoolElement(test, "linkstat")),
+ "testProgram": {
+ "vertexShader": vs,
+ "fragmentShader": fs,
+ },
+ }
+ attach = test.getElementsByTagName("attach")
+ if len(attach) > 0:
+ data["attachError"] = GetElementText(attach[0], "attacherror")
+ return data
+
+ def Process_coverage(self, test, filename, outname):
+ Log("coverage Not implemented: %s" % filename)
+ self.CopyShaders(test, filename, outname)
+
+ def Process_attributes(self, test, filename, outname):
+ Log("attributes Not implemented: %s" % filename)
+ self.CopyShaders(test, filename, outname)
+
+ def Process_fixed(self, test, filename, outname):
+ """no need for fixed function tests"""
+ self.CopyShaders(test, filename, outname)
+
+
+def main(argv):
+ """This is the main function."""
+ global VERBOSE
+
+ parser = OptionParser()
+ parser.add_option(
+ "-v", "--verbose", action="store_true",
+ help="prints more output.")
+
+ (options, args) = parser.parse_args(args=argv)
+
+ if len(args) < 1:
+ pass # fix me
+
+ os.chdir(os.path.dirname(__file__) or '.')
+
+ VERBOSE = options.verbose
+
+ filename = args[0]
+ test_reader = TestReader(filename)
+ test_reader.ReadTests(filename)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt
new file mode 100644
index 0000000000..061caa574a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/00_test_list.txt
@@ -0,0 +1,12 @@
+get-active-test.html
+gl-bind-attrib-location-test.html
+--min-version 1.0.2 gl-bind-attrib-location-long-names-test.html
+gl-get-active-attribute.html
+gl-get-active-uniform.html
+gl-getshadersource.html
+gl-shader-test.html
+invalid-UTF-16.html
+--min-version 1.0.4 program-handling.html
+--min-version 1.0.4 program-infolog.html
+program-test.html
+--min-version 1.0.2 use-program-crash-with-discard-in-fragment-shader.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html
new file mode 100644
index 0000000000..ce2b4f9b1a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/get-active-test.html
@@ -0,0 +1,119 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test of getActiveAttrib and getActiveUniform");
+
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext();
+var context2 = wtu.create3DContext();
+var program = wtu.loadStandardProgram(context);
+var program2 = wtu.loadProgramFromFile(context2,
+ "../../resources/intArrayUniformShader.vert",
+ "../../resources/noopUniformShader.frag");
+
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+shouldBe("context.getActiveUniform(program, 0).name", "'u_modelViewProjMatrix'");
+shouldBe("context.getActiveUniform(program, 0).type", "context.FLOAT_MAT4");
+shouldBe("context.getActiveUniform(program, 0).size", "1");
+shouldBeNull("context.getActiveUniform(program, 1)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+shouldBeNull("context.getActiveUniform(program, -1)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+shouldThrow("context.getActiveUniform(null, 0)");
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+
+// we don't know the order the attribs will appear.
+var info = [
+ context.getActiveAttrib(program, 0),
+ context.getActiveAttrib(program, 1)
+];
+for (var ii = 0; ii < info.length; ++ii)
+ shouldBeNonNull("info[ii]");
+
+var expected = [
+ { name: 'a_normal', type: context.FLOAT_VEC3, size: 1 },
+ { name: 'a_vertex', type: context.FLOAT_VEC4, size: 1 }
+];
+
+if (info[0].name != expected[0].name) {
+ var t = info[0];
+ info[0] = info[1];
+ info[1] = t;
+}
+
+for (var ii = 0; ii < info.length; ++ii) {
+ shouldBe("info[ii].name", "expected[ii].name");
+ shouldBe("info[ii].type", "expected[ii].type");
+ shouldBe("info[ii].size", "expected[ii].size");
+}
+
+// we don't know the order the uniforms will appear.
+var info2 = [
+ context2.getActiveUniform(program2, 0),
+ context2.getActiveUniform(program2, 1)
+];
+for (var ii = 0; ii < info2.length; ++ii)
+ shouldBeNonNull("info2[ii]");
+
+var expected2 = [
+ { name: 'ival', type: context2.INT, size: 1 },
+ { name: 'ival2[0]', type: context2.INT, size: 2 }
+];
+
+if (info2[0].name != expected2[0].name) {
+ t = info2[0];
+ info2[0] = info2[1];
+ info2[1] = t;
+}
+
+for (var ii = 0; ii < info2.length; ++ii) {
+ shouldBe("info2[ii].name", "expected2[ii].name");
+ shouldBe("info2[ii].type", "expected2[ii].type");
+ shouldBe("info2[ii].size", "expected2[ii].size");
+}
+
+shouldBeNull("context.getActiveAttrib(program, 2)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+shouldBeNull("context.getActiveAttrib(program, -1)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+shouldThrow("context.getActiveAttrib(null, 0)");
+wtu.glErrorShouldBe(context, context.NO_ERROR);
+
+wtu.glErrorShouldBe(context2, context.NO_ERROR);
+
+debug("Check trying to get attribs from different context");
+shouldBeNull("context2.getActiveAttrib(program, 0)");
+wtu.glErrorShouldBe(context2, context2.INVALID_OPERATION);
+shouldBeNull("context2.getActiveUniform(program, 0)");
+wtu.glErrorShouldBe(context2, context2.INVALID_OPERATION);
+
+debug("Check trying to get attribs from deleted program");
+context.deleteProgram(program);
+shouldBeNull("context.getActiveUniform(program, 0)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+shouldBeNull("context.getActiveAttrib(program, 0)");
+wtu.glErrorShouldBe(context, context.INVALID_VALUE);
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html
new file mode 100644
index 0000000000..90328bee45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-long-names-test.html
@@ -0,0 +1,153 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL BindAttribLocation Long Names Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas style="border: 1px solid black;" id="canvas" width="50" height="50"></canvas>
+<script id="vshader" type="text/something-not-javascript">
+attribute vec4 vPosition$(suffix);
+attribute vec4 vColor$(suffix);
+varying vec4 color;
+void main()
+{
+ gl_Position = vPosition$(suffix);
+ color = vColor$(suffix);
+}
+</script>
+<script id="fshader" type="text/something-not-javascript">
+precision mediump float;
+
+varying vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+description("This test checks using long names with bindAttribLocation work.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+shouldBeNonNull("gl");
+
+debug("");
+debug("Checking gl.bindAttribLocation with long names.");
+
+var program = gl.createProgram();
+
+var suffix = "long";
+for (var ii = 0; ii < 5; ++ii) {
+ suffix = suffix + suffix;
+}
+var replacements = {
+ suffix: suffix
+};
+
+var vsrc = wtu.replaceParams(wtu.getScript("vshader"), replacements);
+var fsrc = wtu.replaceParams(wtu.getScript("fshader"), replacements);
+
+var vs = wtu.loadShader(gl, vsrc, gl.VERTEX_SHADER);
+var fs = wtu.loadShader(gl, fsrc, gl.FRAGMENT_SHADER);
+
+var attribs = {
+ vPosition: "vPosition" + suffix,
+ vColor: "vColor" + suffix
+};
+
+gl.attachShader(program, vs);
+gl.attachShader(program, fs);
+
+var positions = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, positions);
+gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array(
+ [ 1.0, 1.0, 0.0,
+ -1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0,
+ 1.0, -1.0, 0.0]),
+ gl.STATIC_DRAW);
+
+var colors = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, colors);
+gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array(
+ [ 0,1,0,1,
+ 0,1,0,1,
+ 0,1,0,1,
+ 0,1,0,1,
+ 0,1,0,1,
+ 0,1,0,1]),
+ gl.STATIC_DRAW);
+
+function setBindLocations(colorLocation, positionLocation) {
+ gl.bindAttribLocation(program, positionLocation, attribs.vPosition);
+ gl.bindAttribLocation(program, colorLocation, attribs.vColor);
+ gl.linkProgram(program);
+ gl.useProgram(program);
+ var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0);
+ assertMsg(linked, "program linked successfully");
+
+ debug("vPosition:" + gl.getAttribLocation(program, attribs.vPosition))
+ debug("vColor :" + gl.getAttribLocation(program, attribs.vColor))
+ assertMsg(gl.getAttribLocation(program, attribs.vPosition) == positionLocation,
+ "location of vPosition should be " + positionLocation);
+ assertMsg(gl.getAttribLocation(program, attribs.vColor) == colorLocation,
+ "location of vColor should be " + colorLocation);
+
+ var ploc = gl.getAttribLocation(program, attribs.vPosition);
+ var cloc = gl.getAttribLocation(program, attribs.vColor);
+ gl.bindBuffer(gl.ARRAY_BUFFER, positions);
+ gl.enableVertexAttribArray(positionLocation);
+ gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
+ gl.bindBuffer(gl.ARRAY_BUFFER, colors);
+ gl.enableVertexAttribArray(colorLocation);
+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
+}
+
+function checkDraw(colorLocation, positionLocation, r, g, b, a) {
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [r, g, b, a], "should be green");
+
+ gl.disableVertexAttribArray(positionLocation);
+ gl.disableVertexAttribArray(colorLocation);
+}
+
+setBindLocations(2, 3);
+checkDraw(2, 3, 0, 255, 0, 255);
+
+setBindLocations(0, 3);
+gl.disableVertexAttribArray(0);
+gl.vertexAttrib4f(0, 1, 0, 0, 1);
+checkDraw(0, 3, 255, 0, 0, 255);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html
new file mode 100644
index 0000000000..6909c64491
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-bind-attrib-location-test.html
@@ -0,0 +1,139 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL BindAttribLocation Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas style="border: 1px solid black;" id="canvas" width="50" height="50"></canvas>
+<script id="vshader" type="text/something-not-javascript">
+attribute vec4 vPosition;
+attribute vec4 vColor;
+varying vec4 color;
+void main()
+{
+ gl_Position = vPosition;
+ color = vColor;
+}
+</script>
+<script id="fshader" type="text/something-not-javascript">
+precision mediump float;
+
+varying vec4 color;
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+description("This test ensures WebGL implementations don't allow names that start with 'gl_' when calling bindAttribLocation.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+shouldBeNonNull("gl");
+
+debug("");
+debug("Checking gl.bindAttribLocation.");
+
+var program = gl.createProgram();
+gl.bindAttribLocation(program, 0, "gl_foo");
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "bindAttribLocation should return INVALID_OPERATION if name starts with 'gl_'");
+gl.bindAttribLocation(program, 0, "gl_TexCoord0");
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "bindAttribLocation should return INVALID_OPERATION if name starts with 'gl_'");
+
+var vs = wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER);
+var fs = wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER);
+gl.attachShader(program, vs);
+gl.attachShader(program, fs);
+
+var positions = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, positions);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+
+var colors = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, colors);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ 0,1,0,1,
+ 0,1,0,1,
+ 0,1,0,1]), gl.STATIC_DRAW);
+
+function setBindLocations(colorLocation, positionLocation) {
+ gl.bindAttribLocation(program, positionLocation, "vPosition");
+ gl.bindAttribLocation(program, colorLocation, "vColor");
+ gl.linkProgram(program);
+ gl.useProgram(program);
+ var linked = (gl.getProgramParameter(program, gl.LINK_STATUS) != 0);
+ assertMsg(linked, "program linked successfully");
+
+ debug("vPosition:" + gl.getAttribLocation(program, "vPosition"))
+ debug("vColor :" + gl.getAttribLocation(program, "vColor"))
+ assertMsg(gl.getAttribLocation(program, "vPosition") == positionLocation,
+ "location of vPosition should be " + positionLocation);
+ assertMsg(gl.getAttribLocation(program, "vColor") == colorLocation,
+ "location of vColor should be " + colorLocation);
+
+ var ploc = gl.getAttribLocation(program, "vPosition");
+ var cloc = gl.getAttribLocation(program, "vColor");
+ gl.bindBuffer(gl.ARRAY_BUFFER, positions);
+ gl.enableVertexAttribArray(positionLocation);
+ gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false, 0, 0);
+ gl.bindBuffer(gl.ARRAY_BUFFER, colors);
+ gl.enableVertexAttribArray(colorLocation);
+ gl.vertexAttribPointer(colorLocation, 4, gl.FLOAT, false, 0, 0);
+}
+
+function checkDraw(colorLocation, positionLocation, r, g, b, a) {
+ gl.clearColor(0, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ var width = 50;
+ var height = 50;
+
+ // Test several locations
+ wtu.checkCanvasRect(gl, 0, 0, width, 1, [0, 0, 0, 255],
+ "First line should be all black");
+ wtu.checkCanvasRect(gl, 20, 15, 10, 1, [r, g, b, a],
+ "Line 15 should be red for at least 10 rgba pixels starting 20 pixels in");
+ wtu.checkCanvasRect(gl, 0, height - 1, width, 0, [0, 0, 0, 255],
+ "Last line should be all black");
+
+ gl.disableVertexAttribArray(positionLocation);
+ gl.disableVertexAttribArray(colorLocation);
+}
+
+setBindLocations(2, 3);
+checkDraw(2, 3, 0, 255, 0, 255);
+
+setBindLocations(0, 3);
+gl.disableVertexAttribArray(0);
+gl.vertexAttrib4f(0, 1, 0, 0, 1);
+checkDraw(0, 3, 255, 0, 0, 255);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html
new file mode 100644
index 0000000000..76dc422eae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-attribute.html
@@ -0,0 +1,85 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL getActiveAttrib conformance 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>
+</head>
+<body>
+<canvas id="example" width="16" height="16"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute $type attr0;
+void main()
+{
+ gl_Position = vec4(0, 0, 0, attr0$access);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(0,1,0,1);
+}
+</script>
+<script>
+"use strict";
+description("Tests getActiveAttrib for various types");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var tests = [
+{ glType: gl.FLOAT, size: 1, type: 'float', access: ''},
+{ glType: gl.FLOAT_VEC2, size: 1, type: 'vec2', access: '[1]'},
+{ glType: gl.FLOAT_VEC3, size: 1, type: 'vec3', access: '[2]'},
+{ glType: gl.FLOAT_VEC4, size: 1, type: 'vec4', access: '[3]'},
+{ glType: gl.FLOAT_MAT2, size: 1, type: 'mat2', access: '[1][1]'},
+{ glType: gl.FLOAT_MAT3, size: 1, type: 'mat3', access: '[2][2]'},
+{ glType: gl.FLOAT_MAT4, size: 1, type: 'mat4', access: '[3][3]'},
+];
+
+var source = document.getElementById('vshader').text;
+var fs = wtu.loadShaderFromScript(gl, 'fshader', gl.FRAGMENT_SHADER);
+for (var tt = 0; tt < tests.length; ++tt) {
+ var t = tests[tt];
+ var vs = wtu.loadShader(
+ gl,
+ source.replace('$type', t.type).replace('$access', t.access),
+ gl.VERTEX_SHADER);
+ var program = wtu.setupProgram(gl, [vs, fs]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from setup");
+ var numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);
+ var found = false;
+ for (var ii = 0; ii < numAttribs; ++ii) {
+ var info = gl.getActiveAttrib(program, ii);
+ if (info.name == 'attr0') {
+ found = true;
+ assertMsg(info.type == t.glType,
+ "type must be " + wtu.glEnumToString(gl, t.glType) + " was " +
+ wtu.glEnumToString(gl, info.type));
+ assertMsg(info.size == t.size,
+ "size must be " + t.size + ' was ' + info.size);
+ }
+ }
+ if (!found) {
+ testFailed("attrib 'attr0' not found");
+ }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html
new file mode 100644
index 0000000000..295b5987cc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-get-active-uniform.html
@@ -0,0 +1,136 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL getActiveUniform conformance 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>
+</head>
+<body>
+<canvas id="example" width="16" height="16"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+void main()
+{
+ gl_Position = vec4(0, 0, 0, 1);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform $type uniform0;
+void main()
+{
+ gl_FragColor = vec4(0,$access,0,1);
+}
+</script>
+<script id="fshaderA" type="x-shader/x-fragment">
+precision mediump float;
+uniform float uniform0;
+void main()
+{
+ gl_FragColor = vec4(0,uniform0,0,1);
+}
+</script>
+<script id="fshaderB" type="x-shader/x-fragment">
+precision mediump float;
+uniform float uniform0;
+uniform float uniform1;
+void main()
+{
+ gl_FragColor = vec4(0,uniform0,uniform1,1);
+}
+</script>
+<script>
+"use strict";
+description("Tests getActiveUniform for various types");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var tests = [
+ { glType: gl.FLOAT, size: 1, type: 'float', access: 'uniform0'},
+ { glType: gl.FLOAT_VEC2, size: 1, type: 'vec2', access: 'uniform0[1]'},
+ { glType: gl.FLOAT_VEC3, size: 1, type: 'vec3', access: 'uniform0[2]'},
+ { glType: gl.FLOAT_VEC4, size: 1, type: 'vec4', access: 'uniform0[3]'},
+ { glType: gl.FLOAT_MAT2, size: 1, type: 'mat2', access: 'uniform0[1][1]'},
+ { glType: gl.FLOAT_MAT3, size: 1, type: 'mat3', access: 'uniform0[2][2]'},
+ { glType: gl.FLOAT_MAT3, size: 1, type: 'mat3', access: 'uniform0[2][2]'},
+ { glType: gl.FLOAT_MAT4, size: 1, type: 'mat4', access: 'uniform0[3][3]'},
+ { glType: gl.INT, size: 1, type: 'int', access: 'float(uniform0)'},
+ { glType: gl.INT_VEC2, size: 1, type: 'ivec2', access: 'float(uniform0[1])'},
+ { glType: gl.INT_VEC3, size: 1, type: 'ivec3', access: 'float(uniform0[2])'},
+ { glType: gl.INT_VEC4, size: 1, type: 'ivec4', access: 'float(uniform0[3])'},
+ { glType: gl.BOOL, size: 1, type: 'bool', access: 'float(uniform0)'},
+ { glType: gl.BOOL_VEC2, size: 1, type: 'bvec2', access: 'float(uniform0[1])'},
+ { glType: gl.BOOL_VEC3, size: 1, type: 'bvec3', access: 'float(uniform0[2])'},
+ { glType: gl.BOOL_VEC4, size: 1, type: 'bvec4', access: 'float(uniform0[3])'},
+ { glType: gl.SAMPLER_2D, size: 1, type: 'sampler2D', access: 'texture2D(uniform0, vec2(0,0)).x'},
+ { glType: gl.SAMPLER_CUBE, size: 1, type: 'samplerCube', access: 'textureCube(uniform0, vec3(0,1,0)).x'}
+];
+
+var vs = wtu.loadShaderFromScript(gl, 'vshader', gl.VERTEX_SHADER);
+var source = document.getElementById('fshader').text;
+
+function createProgram(type, access) {
+ var fs = wtu.loadShader(
+ gl,
+ source.replace('$type', type).replace('$access', access),
+ gl.FRAGMENT_SHADER);
+ var program = wtu.setupProgram(gl, [vs, fs]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from setup");
+ return program;
+}
+
+for (var tt = 0; tt < tests.length; ++tt) {
+ var t = tests[tt];
+ var program = createProgram(t.type, t.access);
+ var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+ var found = false;
+ for (var ii = 0; ii < numUniforms; ++ii) {
+ var info = gl.getActiveUniform(program, ii);
+ if (info.name == 'uniform0') {
+ found = true;
+ assertMsg(info.type == t.glType,
+ "type must be " + wtu.glEnumToString(gl, t.glType) + " was " +
+ wtu.glEnumToString(gl, info.type));
+ assertMsg(info.size == t.size,
+ "size must be " + t.size + ' was ' + info.size);
+ }
+ }
+ if (!found) {
+ testFailed("uniform 'uniform0' not found");
+ }
+}
+
+var p1 = wtu.setupProgram(gl, [vs, 'fshaderA']);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from program A");
+var p2 = wtu.setupProgram(gl, [vs, 'fshaderB']);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors from program B");
+var l1 = gl.getUniformLocation(p1, 'uniform0');
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors getting location of uniform0 p1");
+var l2 = gl.getUniformLocation(p2, 'uniform0');
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors getting location of uniform0 p2");
+
+gl.useProgram(p2);
+gl.uniform1f(l2, 1);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "no errors setting uniform 0");
+gl.uniform1f(l1, 2);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "setting a uniform using a location from another program");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html
new file mode 100644
index 0000000000..3461537d4b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-getshadersource.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+ <title>WebGL getShaderSource conformance 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>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">abc//defNOTASCII</script>
+<script>
+"use strict";
+description("Tests that the source that goes into a shader is what comes out.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var original = document.getElementById("vshader").text;
+var shader = gl.createShader(gl.VERTEX_SHADER);
+gl.shaderSource(shader, original);
+var source = gl.getShaderSource(shader);
+shouldBe("source", "original");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html
new file mode 100644
index 0000000000..6566f77303
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/gl-shader-test.html
@@ -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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ShaderL Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<script id="vs" type="x-shader/x-fragment">
+attribute vec4 vPosition;
+varying vec2 texCoord;
+void main() {
+ gl_Position = vPosition;
+ texCoord = vPosition.xy * 0.5 + 0.5;
+}
+</script>
+<script id="fs-green" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ gl_FragData[0] = vec4(0, 1, 0, 1);
+}
+</script>
+<script id="fs-red" type="x-shader/x-fragment">
+precision mediump float;
+void main() {
+ gl_FragData[0] = vec4(1, 0, 0, 1);
+}
+</script>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("This test checks a few things about WebGL Shaders.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking shaders.");
+
+ // Create the shader object
+ var shader = gl.createShader(desktopGL['GEOMETRY_SHADER_ARB']);
+ assertMsg(shader == null,
+ "should not be able to create GEOMETRY shader");
+
+ checkDeferredCompliation()
+}
+
+function checkDeferredCompliation() {
+ var vs = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vs, document.getElementById("vs").text);
+ gl.compileShader(vs);
+ var fs = gl.createShader(gl.FRAGMENT_SHADER);
+ // Compile the green shader
+ gl.shaderSource(fs, document.getElementById("fs-green").text);
+ gl.compileShader(fs);
+ // Load the red shader source but do NOT compile it
+ gl.shaderSource(fs, document.getElementById("fs-red").text);
+ var p = gl.createProgram();
+ gl.attachShader(p, vs);
+ gl.attachShader(p, fs);
+ gl.bindAttribLocation(p, 0, "vPosition");
+ gl.linkProgram(p);
+ gl.useProgram(p);
+ wtu.setupUnitQuad(gl, 0, 1);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html
new file mode 100644
index 0000000000..238552a5e6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/invalid-UTF-16.html
@@ -0,0 +1,48 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css">
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+"use strict";
+description('This test verifies that the internal conversion from UTF16 to UTF8 is robust to invalid inputs. Any DOM entry point which converts an incoming string to UTF8 could be used for this test.');
+
+var array = [];
+array.push(String.fromCharCode(0x48)); // H
+array.push(String.fromCharCode(0x69)); // i
+array.push(String.fromCharCode(0xd87e)); // Bogus
+var string = array.join('');
+
+// In order to make this test not depend on WebGL, the following were
+// attempted:
+// - Send a string to console.log
+// - Submit a mailto: form containing a text input with the bogus
+// string
+// The first code path does not perform a utf8 conversion of the
+// incoming string unless Console::shouldPrintExceptions() returns
+// true. The second seems to sanitize the form's input before
+// converting it to a UTF8 string.
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var program = gl.createProgram();
+gl.bindAttribLocation(program, 0, string);
+testPassed("bindAttribLocation with invalid UTF-16 did not crash");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-handling.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-handling.html
new file mode 100644
index 0000000000..54138becf1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-handling.html
@@ -0,0 +1,142 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Program Handling Conformance Test</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 a_position;
+ uniform vec4 u_color;
+ varying vec4 v_color;
+ void main()
+ {
+ v_color = u_color;
+ gl_Position = a_position;
+ }
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+ precision mediump float;
+ varying vec4 v_color;
+ void main()
+ {
+ gl_FragColor = v_color;
+ }
+</script>
+<script id="fshader-not-link" type="x-shader/x-fragment">
+ precision mediump float;
+ varying vec4 foo;
+ void main()
+ {
+ gl_FragColor = foo;
+ }
+</script>
+
+<canvas id="canvas" width="16" height="16"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+function compile(gl, shader, src) {
+ var shaderSource = document.getElementById(src).text;
+ gl.shaderSource(shader, shaderSource);
+ gl.compileShader(shader);
+}
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+}
+
+function testProgramInvalidation() {
+ debug('');
+ debug('== Testing invalidation of the current program ==');
+ var vs = wtu.loadShaderFromScript(gl, "vshader");
+ var fs = wtu.loadShaderFromScript(gl, "fshader");
+ var prg = wtu.createProgram(gl, vs, fs);
+ gl.useProgram(prg);
+ const positionLoc = gl.getAttribLocation(prg, 'a_position');
+ const colorLoc = gl.getUniformLocation(prg, 'u_color');
+
+ wtu.setupUnitQuad(gl, positionLoc);
+
+ debug("Draw red with valid program");
+ gl.uniform4fv(colorLoc, [1, 0, 0, 1]);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+
+ debug("Change fragment shader to one that will not link");
+ compile(gl, fs, "fshader-not-link");
+ debug("Draw orange");
+ gl.uniform4fv(colorLoc, [1, 127/255, 0, 1]);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 127, 0, 255], "should be orange");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors before relink");
+
+ debug("Try linking");
+ gl.linkProgram(prg);
+ assertMsg(gl.getProgramParameter(prg, gl.LINK_STATUS) == false, "link should fail");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors after linkProgram");
+ debug("Attempt to draw green; because link failed, in WebGL, the draw should generate INVALID_OPERATION");
+ gl.uniform4fv(colorLoc, [0, 1, 0, 1]);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "because the current program has been invalidated, uniform* calls generate INVALID_OPERATION");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors before draw");
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "draw with invalidated program should fail");
+ wtu.checkCanvas(gl, [255, 127, 0, 255], "should still be orange");
+}
+
+function testProgramShaderRemoval() {
+ debug('');
+ debug('== Testing removal of shaders from the current program ==');
+ var vs = wtu.loadShaderFromScript(gl, "vshader");
+ var fs = wtu.loadShaderFromScript(gl, "fshader");
+ var prg = wtu.createProgram(gl, vs, fs);
+ gl.useProgram(prg);
+ const positionLoc = gl.getAttribLocation(prg, 'a_position');
+ const colorLoc = gl.getUniformLocation(prg, 'u_color');
+
+ wtu.setupUnitQuad(gl, positionLoc);
+
+ debug("Draw red with valid program");
+ gl.uniform4fv(colorLoc, [1, 0, 0, 1]);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+
+ debug("Detach and delete shaders");
+ gl.detachShader(prg, vs);
+ gl.detachShader(prg, fs);
+ gl.deleteShader(vs);
+ gl.deleteShader(fs);
+
+ debug("Draw blue to show even though shaders are gone program is still valid");
+ gl.uniform4fv(colorLoc, [0, 0, 1, 1]);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 0, 255, 255], "should be blue");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+}
+
+testProgramInvalidation();
+testProgramShaderRemoval();
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html
new file mode 100644
index 0000000000..02fa19d912
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-infolog.html
@@ -0,0 +1,62 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Program Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script id="vertexShader" language="x-shader/x-vertex">
+void main()
+{
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script id="fragmentShader" language="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+description('getProgramInfoLog should not return \\0');
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+}
+
+debug("");
+
+var program = wtu.loadProgramFromScript(gl, 'vertexShader', 'fragmentShader');
+var infolog = gl.getProgramInfoLog(program);
+if (infolog === '\0') {
+ testFailed("getProgramInfoLog should not return '\\0'");
+} else {
+ testPassed("getProgramInfoLog didn't return '\\0'");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html
new file mode 100644
index 0000000000..34ca68f1d7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/program-test.html
@@ -0,0 +1,406 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Program Compiling/Linking Conformance Test</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 a_position;
+ void main()
+ {
+ gl_Position = a_position;
+ }
+</script>
+<script id="fshader-red" type="x-shader/x-fragment">
+ void main()
+ {
+ gl_FragColor = vec4(1, 0, 0, 1);
+ }
+</script>
+<script id="fshader-green" type="x-shader/x-fragment">
+ void main()
+ {
+ gl_FragColor = vec4(0, 1, 0, 1);
+ }
+</script>
+<script id="fshader-settable" type="x-shader/x-fragment">
+ precision mediump float;
+ uniform vec4 u_color;
+ void main()
+ {
+ gl_FragColor = u_color;
+ }
+</script>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script type="application/javascript">
+var wtu = WebGLTestUtils;
+let gl;
+function go() {
+ description("Tests that program compiling/linking/using works correctly.");
+
+ debug("");
+ debug("Canvas.getContext");
+
+ gl = wtu.create3DContext("canvas");
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+
+ testPassed("context exists");
+
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ function doArraysHaveSameContents(a, b) {
+ var flags = [];
+ function hasUnusedValue(a, value) {
+ for (var ii = 0; ii < a.length; ++ii) {
+ if (a[ii] === value && !flags[ii]) {
+ flags[ii] = true;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ try {
+ if (a.length !== b.length) {
+ return false;
+ }
+ for (var ii = 0; ii < a.length; ii++) {
+ if (!hasUnusedValue(b, a[ii])) {
+ return false;
+ }
+ }
+ } catch (ex) {
+ return false;
+ }
+ return true;
+ }
+
+/////// Check compileShader() /////////////////////////////
+
+ var vs = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vs, "attribute vec4 aVertex; attribute vec4 aColor; varying vec4 vColor; void main() { vColor = aColor; gl_Position = aVertex; }");
+ gl.compileShader(vs);
+
+ assertMsg(gl.getShaderParameter(vs, gl.COMPILE_STATUS) == true,
+ "good vertex shader should compile");
+
+ // Verify that constants removed from the WebGL spec generate INVALID_ENUM errors
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors at this point");
+ assertMsg(gl.getShaderParameter(vs, desktopGL['INFO_LOG_LENGTH']) === null, "invalid call to getShaderParameter should return null");
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "INFO_LOG_LENGTH is not a valid argument to getShaderParameter in WebGL");
+ assertMsg(gl.getShaderParameter(vs, desktopGL['SHADER_SOURCE_LENGTH']) === null, "invalid call to getShaderParameter should return null");
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "SHADER_SOURCE_LENGTH is not a valid argument to getShaderParameter in WebGL");
+
+ var vs2 = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vs2, "attribute vec4 aVertex; attribute vec4 aColor; varying vec4 vColor; void main() { vColor = aColor; gl_Position = aVertex * 0.5; }");
+ gl.compileShader(vs2);
+
+ assertMsg(gl.getShaderParameter(vs2, gl.COMPILE_STATUS) == true,
+ "good vertex shader #2 should compile");
+
+ var vsBad = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vsBad, "WILL NOT COMPILE;");
+ gl.compileShader(vsBad);
+
+ // GLSL 1.0.17 section 10.27. compile shader does not have to return failure.
+ //assertMsg(gl.getShaderParameter(vsBad, gl.COMPILE_STATUS) == false,
+ // "bad vertex shader should fail to compile");
+
+ var fs = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fs, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }");
+ gl.compileShader(fs);
+
+ assertMsg(gl.getShaderParameter(fs, gl.COMPILE_STATUS) == true,
+ "good fragment shader should compile");
+
+ var fs2 = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fs2, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor * 0.5; }");
+ gl.compileShader(fs2);
+
+ assertMsg(gl.getShaderParameter(fs2, gl.COMPILE_STATUS) == true,
+ "good fragment shader #2 should compile");
+
+ var fsBad = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fsBad, "WILL NOT COMPILE;");
+ gl.compileShader(fsBad);
+
+ // GLSL 1.0.17 section 10.27. compile shader does not have to return failure.
+ //assertMsg(gl.getShaderParameter(fsBad, gl.COMPILE_STATUS) == false,
+ // "bad fragment shader should fail to compile");
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors at this point");
+
+/////// Check attachShader() /////////////////////////////
+
+ function checkAttachShader(already_attached_shaders, shader, expected_error_code, errmsg) {
+ var prog = gl.createProgram();
+ for (var i = 0; i < already_attached_shaders.length; ++i)
+ gl.attachShader(prog, already_attached_shaders[i]);
+ if(gl.getError() != gl.NO_ERROR)
+ assertMsg(false, "unexpected error in attachShader()");
+ gl.attachShader(prog, shader);
+ wtu.glErrorShouldBe(gl, expected_error_code, errmsg);
+ }
+
+ checkAttachShader([], vs, gl.NO_ERROR, "attaching a vertex shader should succeed");
+ checkAttachShader([vs], vs, gl.INVALID_OPERATION,
+ "attaching an already attached vertex shader should generate INVALID_OPERATION");
+ checkAttachShader([], fs, gl.NO_ERROR, "attaching a fragment shader should succeed");
+ checkAttachShader([fs], fs, gl.INVALID_OPERATION,
+ "attaching an already attached fragment shader should generate INVALID_OPERATION");
+ checkAttachShader([vs], vs2, gl.INVALID_OPERATION,
+ "attaching shaders of the same type to a program should generate INVALID_OPERATION");
+ checkAttachShader([fs], fs2, gl.INVALID_OPERATION,
+ "attaching shaders of the same type to a program should generate INVALID_OPERATION");
+
+/////// Check detachShader() /////////////////////////////
+
+ function checkDetachShader(already_attached_shaders, shader, expected_error_code, errmsg) {
+ var prog = gl.createProgram();
+ for (var i = 0; i < already_attached_shaders.length; ++i)
+ gl.attachShader(prog, already_attached_shaders[i]);
+ if(gl.getError() != gl.NO_ERROR)
+ assertMsg(false, "unexpected error in attachShader()");
+ gl.detachShader(prog, shader);
+ wtu.glErrorShouldBe(gl, expected_error_code, errmsg);
+ }
+
+ checkDetachShader([vs], vs, gl.NO_ERROR, "detaching a vertex shader should succeed");
+ checkDetachShader([fs], vs, gl.INVALID_OPERATION,
+ "detaching a not already attached vertex shader should generate INVALID_OPERATION");
+ checkDetachShader([fs], fs, gl.NO_ERROR, "detaching a fragment shader should succeed");
+ checkDetachShader([vs], fs, gl.INVALID_OPERATION,
+ "detaching a not already attached fragment shader should generate INVALID_OPERATION");
+
+/////// Check getAttachedShaders() /////////////////////////////
+
+ function checkGetAttachedShaders(shaders_to_attach, shaders_to_detach, expected_shaders, errmsg) {
+ prog = gl.createProgram();
+ for (var i = 0; i < shaders_to_attach.length; ++i)
+ gl.attachShader(prog, shaders_to_attach[i]);
+ if(gl.getError() != gl.NO_ERROR)
+ assertMsg(false, "unexpected error in attachShader()");
+ for (var i = 0; i < shaders_to_detach.length; ++i)
+ gl.detachShader(prog, shaders_to_detach[i]);
+ if(gl.getError() != gl.NO_ERROR)
+ assertMsg(false, "unexpected error in detachShader()");
+ assertMsg(doArraysHaveSameContents(gl.getAttachedShaders(prog), expected_shaders), errmsg);
+ shouldBe('gl.getProgramParameter(prog, gl.ATTACHED_SHADERS)', `${expected_shaders.length}`);
+ }
+ checkGetAttachedShaders([], [], [], "getAttachedShaders should return an empty list by default");
+ checkGetAttachedShaders([fs], [], [fs], "attaching a single shader should give the expected list");
+ checkGetAttachedShaders([fs, vs], [], [fs, vs],
+ "attaching some shaders should give the expected list");
+ checkGetAttachedShaders([fs], [fs], [], "attaching a shader and detaching it should leave an empty list");
+ checkGetAttachedShaders([fs, vs], [fs, vs], [],
+ "attaching some shaders and detaching them in same order should leave an empty list");
+ checkGetAttachedShaders([fs, vs], [vs, fs], [],
+ "attaching some shaders and detaching them in random order should leave an empty list");
+ checkGetAttachedShaders([fs, vs], [vs], [fs],
+ "attaching and detaching some shaders should leave the difference list");
+ checkGetAttachedShaders([fs, vs], [fs], [vs],
+ "attaching and detaching some shaders should leave the difference list");
+ checkGetAttachedShaders([fsBad], [], [fsBad],
+ "attaching a shader that failed to compile should still show it in the list");
+ checkGetAttachedShaders([fs, vsBad], [], [fs, vsBad],
+ "attaching shaders, including one that failed to compile, should still show the it in the list");
+
+/////// Check linkProgram() and useProgram /////////////////////////////
+
+ function checkLinkAndUse(shaders, deleteShaderAfterAttach, expected_status, testInvalidEnums, errmsg) {
+ var prog = gl.createProgram();
+ for (var i = 0; i < shaders.length; ++i) {
+ gl.attachShader(prog, shaders[i]);
+ if (deleteShaderAfterAttach)
+ gl.deleteShader(shaders[i]);
+ }
+ gl.bindAttribLocation(prog, 0, "aVertex");
+ gl.bindAttribLocation(prog, 1, "aColor");
+ gl.linkProgram(prog);
+ if (gl.getError() != gl.NO_ERROR)
+ assertMsg(false, "unexpected error in linkProgram()");
+ assertMsg(gl.getProgramParameter(prog, gl.LINK_STATUS) == expected_status, errmsg);
+ var infolog = gl.getProgramInfoLog(prog);
+ if (gl.getError() != gl.NO_ERROR)
+ assertMsg(false, "unexpected error in getProgramInfoLog()");
+ if (typeof(infolog) != "string")
+ assertMsg(false, "getProgramInfoLog() did not return a string");
+ if (expected_status == true && gl.getProgramParameter(prog, gl.LINK_STATUS) == false)
+ debug(infolog);
+ if (gl.getError() != gl.NO_ERROR)
+ assertMsg(false, "unexpected error in getProgramParameter()");
+
+ if (testInvalidEnums) {
+ // Verify that constants removed from the WebGL spec generate INVALID_ENUM errors
+ assertMsg(gl.getProgramParameter(prog, desktopGL['INFO_LOG_LENGTH']) === null, "invalid call to getProgramParameter should return null");
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "INFO_LOG_LENGTH is not a valid argument to getProgramParameter in WebGL");
+ assertMsg(gl.getProgramParameter(prog, desktopGL['ACTIVE_ATTRIBUTE_MAX_LENGTH']) === null, "invalid call to getProgramParameter should return null");
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "ACTIVE_ATTRIBUTE_MAX_LENGTH is not a valid argument to getProgramParameter in WebGL");
+ assertMsg(gl.getProgramParameter(prog, desktopGL['ACTIVE_UNIFORM_MAX_LENGTH']) === null, "invalid call to getProgramParameter should return null");
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "ACTIVE_UNIFORM_MAX_LENGTH is not a valid argument to getProgramParameter in WebGL");
+ }
+
+ gl.useProgram(prog);
+ if (expected_status == true)
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "using a valid program should succeed");
+ if (expected_status == false)
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "using an invalid program should generate INVALID_OPERATION");
+ return prog;
+ }
+
+ var progGood1 = checkLinkAndUse([vs, fs], false, true, true, "valid program should link");
+ var progGood2 = checkLinkAndUse([vs, fs2], false, true, false, "valid program #2 should link");
+ var progBad1 = checkLinkAndUse([vs], false, false, false, "program with no fragment shader should fail to link");
+ var progBad2 = checkLinkAndUse([fs], false, false, false, "program with no vertex shader should fail to link");
+ var progBad3 = checkLinkAndUse([vsBad, fs], false, false, false, "program with bad vertex shader should fail to link");
+ var progBad4 = checkLinkAndUse([vs, fsBad], false, false, false, "program with bad fragment shader should fail to link");
+ var progBad5 = checkLinkAndUse([vsBad, fsBad], false, false, false, "program with bad shaders should fail to link");
+
+ gl.useProgram(progGood1);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "using a valid program shouldn't generate a GL error");
+
+ var vbuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbuf);
+ gl.bufferData(gl.ARRAY_BUFFER,
+ new Float32Array([
+ 0.0, 0.0, 0.0, 1.0,
+ 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.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttrib3f(1, 1.0, 0.0, 0.0);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors at this point #2");
+
+ gl.useProgram(null);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "drawing with a null program should generate INVALID_OPERATION");
+
+ gl.useProgram(progGood1);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid program shouldn't generate a GL error");
+
+ gl.useProgram(progBad1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "using an invalid program should generate INVALID_OPERATION");
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Try to use an invalid program should not change the current rendering state");
+
+ gl.useProgram(progGood2);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid program shouldn't generate a GL error");
+ gl.detachShader(progGood2, fs2);
+ gl.attachShader(progGood2, fsBad);
+ gl.linkProgram(progGood2);
+ assertMsg(gl.getProgramParameter(progGood2, gl.LINK_STATUS) == false,
+ "linking should fail with in-use formerly good program, with new bad shader attached");
+
+ // In WebGL, an unsuccessful link immediately invalidates the previous valid program.
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "drawing with a newly-invalidated program should generate INVALID_OPERATION");
+
+ gl.useProgram(progGood1);
+ gl.drawArrays(gl.TRIANGLES, 0, 4);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid when last used program shouldn't generate a GL error");
+
+ var progGood1 = checkLinkAndUse([vs, fs], true, true, false, "delete shaders after attaching them and before linking program should not affect linkProgram");
+ gl.useProgram(progGood1);
+ gl.drawArrays(gl.TRIANGLES, 0, 4);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid when last used program shouldn't generate a GL error");
+
+/////// Check deleteProgram() and deleteShader() /////////////////////////////
+
+ gl.useProgram(progGood1);
+ gl.deleteProgram(progGood1);
+ gl.drawArrays(gl.TRIANGLES, 0, 4);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "delete the current program shouldn't change the current rendering state");
+
+ gl.linkProgram(progGood1);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "The current program shouldn't be deleted");
+
+ var fs3 = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fs3, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }");
+ gl.compileShader(fs3);
+
+ assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true,
+ "good fragment shader should compile");
+
+ gl.deleteShader(fs3);
+ gl.compileShader(fs3);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "an unattached shader should be deleted immediately");
+
+ fs3 = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fs3, "precision mediump float; varying vec4 vColor; void main() { gl_FragColor = vColor; }");
+ gl.compileShader(fs3);
+
+ assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true,
+ "good fragment shader should compile");
+
+ gl.detachShader(progGood1, fs);
+ gl.attachShader(progGood1, fs3);
+
+ gl.deleteShader(fs3);
+ gl.compileShader(fs3);
+ assertMsg(gl.getShaderParameter(fs3, gl.COMPILE_STATUS) == true,
+ "an attached shader shouldn't be deleted");
+
+ gl.useProgram(null);
+ gl.linkProgram(progGood1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "a delete-marked program should be deleted once it's no longer the current program");
+
+ gl.compileShader(fs3);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "a delete-marked shader should be deleted once all its attachments are removed");
+
+//////// Check linkProgram() with relinked program //////////
+ var vs = wtu.loadShaderFromScript(gl, "vshader");
+ var fs = wtu.loadShaderFromScript(gl, "fshader-red");
+ var prg = wtu.createProgram(gl, vs, fs);
+ gl.useProgram(prg);
+ var posLoc = gl.getAttribLocation(prg, "a_position");
+ wtu.setupUnitQuad(gl, posLoc);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+ gl.shaderSource(fs, wtu.getScript("fshader-green"));
+ gl.compileShader(fs);
+ gl.linkProgram(prg);
+ // Program should be new program at this point without calling useProgram
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ var prg = wtu.setupProgram(gl, ["vshader", "fshader-settable"], ["a_position"]);
+ var colorLoc = gl.getUniformLocation(prg, "u_color");
+ gl.uniform4f(colorLoc, 1, 0, 0, 1);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+ gl.linkProgram(prg);
+ // Program's uniforms should be cleared at this point without calling useProgram
+ wtu.clearAndDrawUnitQuad(gl, [0, 255, 0, 255]);
+ wtu.checkCanvas(gl, [0, 0, 0, 0], "should be tranparent black");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+}
+
+debug("");
+go();
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html b/dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html
new file mode 100644
index 0000000000..27dac9a9ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/programs/use-program-crash-with-discard-in-fragment-shader.html
@@ -0,0 +1,77 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Program Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script id="vertexShader" language="x-shader/x-vertex">
+attribute vec4 ATTR0;
+void main()
+{
+ gl_Position = ATTR0;
+}
+</script>
+<script id="fragmentShader" language="x-shader/x-fragment">
+precision mediump float;
+void main()
+{
+ float _Intensity = exp2(gl_FragCoord.w);
+ if (_Intensity < 0.5) {
+ discard;
+ }
+ gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+</script>
+<script>
+"use strict";
+description('Regression test for crash in Mac OS AMD OpenGL driver related to use of discard in fragment shader.<br><br>More specifically, triggering the crash seems to require examination of gl_FragCoord.w, use of exp2, and a call to discard in the fragment shader. Thanks to Sheheryar Zakaria and Michael Braithwaite at Turbulenz for the original test case.<br><a href="https://bugs.webkit.org/show_bug.cgi?id=73932">WebKit bug 73932</a><br>');
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+}
+
+debug("");
+
+var program = wtu.loadProgramFromScript(gl, 'vertexShader', 'fragmentShader');
+if (program) {
+ testPassed("Program linked successfully");
+} else {
+ testFailed("Program failed to link");
+}
+
+// Crash occurs here on affected machines
+gl.useProgram(program);
+
+// In some browsers, such as Chrome, the above crash only causes a
+// lost context event to be dispatched, and not synchronously. To verify
+// that everything worked, clear and read back the frame buffer.
+gl.clearColor(1.0, 0.0, 0.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 0, 0, 255],
+ "Color should be red");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt
new file mode 100644
index 0000000000..8651fbd83f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/reading/00_test_list.txt
@@ -0,0 +1,3 @@
+--min-version 1.0.4 fbo-remains-unchanged-after-read-pixels.html
+read-pixels-pack-alignment.html
+read-pixels-test.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/reading/fbo-remains-unchanged-after-read-pixels.html b/dom/canvas/test/webgl-conf/checkout/conformance/reading/fbo-remains-unchanged-after-read-pixels.html
new file mode 100644
index 0000000000..00e8dcd9a0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/reading/fbo-remains-unchanged-after-read-pixels.html
@@ -0,0 +1,105 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="4" height="4"></canvas>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 a_pos;
+attribute vec4 a_color;
+varying vec4 v_color;
+
+void main()
+{
+ v_color = a_color;
+ gl_Position = vec4(a_pos.xyz, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+varying vec4 v_color;
+
+void main()
+{
+ gl_FragColor = v_color;
+}
+</script>
+
+<script>
+"use strict";
+
+description("when antialias is enabled, verify default fbo pixels would not be changed between two readPixels without drawing operations");
+var wtu = WebGLTestUtils;
+var N = 4;
+
+var vertices = new Float32Array([
+ 1.0, 1.0, 0.0,
+ -1.0, -1.0, 0.0]);
+var colors = new Uint8Array([
+ 255, 0, 0, 255,
+ 255, 0, 0, 255]);
+
+var canvas = document.getElementById('canvas');
+var gl = wtu.create3DContext(canvas, {antialias: true});
+
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a_pos", "a_color"]);
+ gl.clearColor(0, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var colorOffset = vertices.byteLength;
+ var vbo = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, colorOffset + colors.byteLength, gl.STATIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices);
+ gl.bufferSubData(gl.ARRAY_BUFFER, colorOffset, colors);
+
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, colorOffset);
+ gl.enableVertexAttribArray(1);
+ gl.drawArrays(gl.LINES, 0, vertices.length / 3);
+
+ var result_1 = new Uint8Array(N * N * 4);
+ var result_2 = new Uint8Array(N * N * 4);
+ gl.readPixels(0, 0, N, N, gl.RGBA, gl.UNSIGNED_BYTE, result_1);
+ gl.readPixels(0, 0, N, N, gl.RGBA, gl.UNSIGNED_BYTE, result_2);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var tolerance = 0;
+ var diff = new Uint8Array(N * N * 4);
+ var failed = wtu.comparePixels(result_1, result_2, tolerance, diff);
+
+ if (failed) {
+ testFailed("default fbo pixels had be changed between two readPixels without drawing operations");
+ } else {
+ testPassed("default fbo pixels had not be changed between two readPixels without drawing operations.");
+ }
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, null);
+ gl.deleteBuffer(vbo);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html
new file mode 100644
index 0000000000..3090284b05
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-pack-alignment.html
@@ -0,0 +1,251 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 pos;
+attribute vec4 colorIn;
+varying vec4 color;
+
+void main()
+{
+ color = colorIn;
+ gl_Position = vec4(pos.xyz, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<canvas id="example2" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+// The below declarations need to be global for "shouldBe" to see them
+var wtu = WebGLTestUtils;
+var gl = null;
+var array = null;
+var pixel = [ 0, 0, 0, 0 ];
+var expectedColor = [ 0, 0, 0, 0 ];
+
+function calculatePixelBytes(format, type)
+{
+ var size = 0;
+ switch (format) {
+ case gl.ALPHA:
+ size = 1;
+ break;
+ case gl.RGB:
+ size = 3;
+ break;
+ case gl.RGBA:
+ size = 4;
+ break;
+ default:
+ return -1;
+ }
+ switch (type) {
+ case gl.UNSIGNED_BYTE:
+ break;
+ case gl.UNSIGNED_SHORT_5_6_5:
+ if (format != gl.RGB)
+ return -1;
+ size = 2;
+ break;
+ case gl.UNSIGNED_SHORT_4_4_4_4:
+ case gl.UNSIGNED_SHORT_5_5_5_1:
+ if (format != gl.RGBA)
+ return -1;
+ size = 2;
+ break;
+ default:
+ return -1;
+ }
+ return size;
+}
+
+function calculatePaddingBytes(bytesPerPixel, packAlignment, width)
+{
+ var padding = 0;
+ switch (packAlignment) {
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ padding = (bytesPerPixel * width) % packAlignment;
+ if (padding > 0)
+ padding = packAlignment - padding;
+ break;
+ default:
+ return -1;
+ }
+ return padding;
+}
+
+function packColor(format, type, r, g, b, a)
+{
+ // FIXME: not sure if the color packing is correct for UNSIGNED_SHORT_*.
+ var color = [ 0, 0, 0, 0 ];
+ switch (type) {
+ case gl.UNSIGNED_BYTE:
+ switch (format) {
+ case gl.ALPHA:
+ color[0] = a;
+ break;
+ case gl.RGB:
+ color[0] = r;
+ color[1] = g;
+ color[2] = b;
+ break;
+ case gl.RGBA:
+ color[0] = r;
+ color[1] = g;
+ color[2] = b;
+ color[3] = a;
+ break;
+ default:
+ return null;
+ }
+ break;
+ case gl.UNSIGNED_SHORT_5_6_5:
+ if (format != gl.RGB)
+ return null;
+ r >>= 3;
+ g >>= 2;
+ b >>= 3;
+ color[0] = (r << 11) + (g << 5) + b;
+ break;
+ case gl.UNSIGNED_SHORT_4_4_4_4:
+ if (format != gl.RGBA)
+ return null;
+ r >>= 4;
+ g >>= 4;
+ b >>= 4;
+ a >>= 4;
+ color[0] = (r << 12) + (g << 8) + (b << 4) + a;
+ break;
+ case gl.UNSIGNED_SHORT_5_5_5_1:
+ if (format != gl.RGBA)
+ return null;
+ r >>= 3;
+ g >>= 3;
+ b >>= 3;
+ a >>= 7;
+ color[0] = (r << 11) + (g << 6) + (b << 1) + a;
+ break;
+ Default:
+ return null;
+ }
+ return color;
+}
+
+function runTestIteration(format, type, packAlignment, width, height)
+{
+ debug("Testing PACK_ALIGNMENT = " + packAlignment + ", width = " + width + ", height = " + height);
+ gl.clearColor(1, 0.4, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.pixelStorei(gl.PACK_ALIGNMENT, packAlignment);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ var bytesPerPixel = calculatePixelBytes(format, type);
+ var padding = calculatePaddingBytes(bytesPerPixel, packAlignment, width);
+ var size = bytesPerPixel * width * height + padding * (height - 1);
+ if (type != gl.UNSIGNED_BYTE) {
+ throw "test error: only UNSIGNED_BYTE is valid to ReadPixels";
+ }
+ if (size < 0)
+ size = 0;
+ array = new Uint8Array(size);
+ gl.readPixels(0, 0, width, height, format, type, array);
+ if (width < 0 || height < 0) {
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE);
+ return;
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ if (!array.length)
+ return;
+
+ // Check the last pixel of the last row.
+ var bytesPerRow = width * bytesPerPixel + padding;
+ var pos = bytesPerRow * (height - 1) + (width - 1) * bytesPerPixel;
+ var numComponents = bytesPerPixel;
+ for (var i = 0; i < numComponents; ++i)
+ pixel[i] = array[pos + i];
+ for (var i = numComponents; i < 4; ++i)
+ pixel[i] = 0;
+ expectedColor = packColor(format, type, 255, 102, 0, 255);
+ shouldBeNonNull("expectedColor");
+ shouldBe("pixel", "expectedColor");
+}
+
+description('Verify readPixels() works fine with various PACK_ALIGNMENT values.');
+
+
+debug("<h1>antialias = false</h1>");
+shouldBeNonNull("gl = wtu.create3DContext('example', {antialias: false})")
+var formats = [ gl.RGBA ];
+var formatNames = [ "RGBA" ];
+runAllIterations();
+debug("<h1>antialias = true</h1>");
+shouldBeNonNull("gl = wtu.create3DContext('example2', {antialias: true})")
+runAllIterations();
+
+function runAllIterations() {
+ shouldBeNonNull("program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos', 'colorIn'])");
+
+ for (var i = 0; i < formats.length; ++i) {
+ var format = formats[i];
+
+ debug("Testing format = " + formatNames[i] + " and type = UNSIGNED_BYTE");
+ runTestIteration(format, gl.UNSIGNED_BYTE, 1, 1, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 2, 1, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 4, 1, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 1, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 4, 2, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 2, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 4, 3, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 3, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 4, 4, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 4, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 5, 1);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 4, 5, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 5, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 6, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 7, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 8, 2);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 1, 0, 0);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 2, 0, 0);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 4, 0, 0);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, 0, 0);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 1, -1, 1);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 2, 1, -1);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 4, 0, -1);
+ runTestIteration(format, gl.UNSIGNED_BYTE, 8, -1, -1);
+ }
+}
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html
new file mode 100644
index 0000000000..078b436427
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/reading/read-pixels-test.html
@@ -0,0 +1,428 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ReadPixels conformance test.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="200" height="200" style="width: 20px; height: 20px"></canvas>
+<canvas id="example2" width="200" height="200" style="width: 20px; height: 20px"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Checks that ReadPixels works as expected.");
+
+var wtu = WebGLTestUtils;
+let gl;
+
+debug("<h1>antialias = false</h1>")
+runTest(document.getElementById("example"), false);
+debug("<h1>antialias = true</h1>")
+runTest(document.getElementById("example2"), true);
+finishTest();
+
+var actual;
+var expected;
+
+function runTest(canvas, antialias) {
+ gl = wtu.create3DContext(canvas, {antialias: antialias});
+ var contextVersion = wtu.getDefault3DContextVersion();
+
+ var width = 2;
+ var height = 2;
+ var continueTestFunc = continueTestPart1;
+
+ gl.clearColor(1, 1, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Resize the canvas to 2x2. This is an attempt to get stuff in the backbuffer.
+ // that shouldn't be there.
+ canvas.addEventListener("webglcontextlost", function(e) { e.preventDefault(); }, false);
+ canvas.addEventListener("webglcontextrestored", continueTestAfterContextRestored, false);
+ canvas.width = width;
+ canvas.height = height;
+ if (gl.getError() != gl.CONTEXT_LOST_WEBGL) {
+ continueTestPart1();
+ }
+
+ function continueTestAfterContextRestored() {
+ window.gl = wtu.create3DContext(canvas);
+ var func = continueTestFunc;
+ window.continueTestFunc = function() { testFailed("should not be here"); };
+ func();
+ }
+
+ function continueTestPart1() {
+ gl.clearColor(0.2, 0.6, 0.4, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var innerColor = [51, 153, 102, 255]; // (0.2, 0.6, 0.4, 1)
+ var outerColor = [19, 72, 0, 198]; // Random color other than [0, 0, 0, 0]
+
+ var tests = [
+ { msg: 'in range', checkColor: innerColor, x: 0, y: 0,
+ oneColor: innerColor, oneX: 0, oneY: 0},
+ { msg: 'off top left', checkColor: outerColor, x: -1, y: -1,
+ oneColor: innerColor, oneX: 1, oneY: 1},
+ { msg: 'off bottom right', checkColor: outerColor, x: 1, y: 1,
+ oneColor: innerColor, oneX: 0, oneY: 0},
+ { msg: 'completely off top ', checkColor: outerColor, x: 0, y: -2,
+ oneColor: outerColor, oneX: 0, oneY: 0},
+ { msg: 'completely off bottom', checkColor: outerColor, x: 0, y: 2,
+ oneColor: outerColor, oneX: 0, oneY: 0},
+ { msg: 'completely off left', checkColor: outerColor, x: -2, y: 0,
+ oneColor: outerColor, oneX: 0, oneY: 0},
+ { msg: 'completeley off right', checkColor: outerColor, x: 2, y: 0,
+ oneColor: outerColor, oneX: 0, oneY: 0}
+ ];
+
+ for (var tt = 0; tt < tests.length; ++tt) {
+ var test = tests[tt];
+ debug("");
+ debug("checking: " + test.msg);
+ checkBuffer(test.checkColor, test.x, test.y,
+ test.oneColor, test.oneX, test.oneY);
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no GL errors");
+
+ function checkBuffer(checkColor, x, y, oneColor, oneX, oneY) {
+ var buf = new Uint8Array(width * height * 4);
+ // Initialize buf.
+ for (var ii = 0; ii < width * height; ++ii) {
+ buf[ii * 4] = outerColor[0];
+ buf[ii * 4 + 1] = outerColor[1];
+ buf[ii * 4 + 2] = outerColor[2];
+ buf[ii * 4 + 3] = outerColor[3];
+ }
+ gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ for (var yy = 0; yy < height; ++yy) {
+ for (var xx = 0; xx < width; ++xx) {
+ var offset = (yy * width + xx) * 4;
+ var expectedColors = (oneX == xx && oneY == yy) ? oneColor : checkColor;
+ var mismatch = false;
+ for (var cc = 0; cc < 4; ++cc) {
+ var expectedColor = expectedColors[cc];
+ var color = buf[offset + cc];
+ var diff = Math.abs(expectedColor - color);
+ if (diff >= 3) {
+ mismatch = true;
+ break;
+ }
+ }
+ assertMsg(!mismatch,
+ "color pixel at " + xx + ", " + yy + " should be about " + expectedColors +
+ ", was = " + [buf[offset], buf[offset + 1], buf[offset + 2], buf[offset + 3]]);
+ }
+ }
+ }
+
+ continueTestPart2();
+ }
+
+ function continueTestPart2() {
+ let neverValidFormats = [gl.DEPTH_COMPONENT, gl.DEPTH_STENCIL, desktopGL.R8, gl.RGBA4];
+ let maybeValidFormats = [gl.LUMINANCE, gl.LUMINANCE_ALPHA];
+ if (contextVersion < 2) {
+ // They are valid in WebGL 2 or higher
+ maybeValidFormats = maybeValidFormats.concat([desktopGL.RED, desktopGL.RG_INTEGER, desktopGL.RGBA_INTEGER]);
+ }
+
+ let neverValidTypeInfo = [
+ {type: desktopGL.UNSIGNED_INT_24_8, dest: new Uint32Array(4)}
+ ];
+ let maybeValidTypeInfo = [];
+ if (contextVersion < 2) {
+ // They are valid in WebGL 2 or Higher
+ maybeValidTypeInfo = maybeValidTypeInfo.concat([
+ {type: gl.UNSIGNED_SHORT, dest: new Uint16Array(4)},
+ {type: gl.SHORT, dest: new Int16Array(4)},
+ {type: gl.BYTE, dest: new Int8Array(4)},
+ {type: gl.UNSIGNED_INT, dest: new Uint32Array(4)},
+ {type: desktopGL.UNSIGNED_INT_2_10_10_10_REV, dest: new Uint32Array(4)}
+ ]);
+ }
+
+ debug("");
+ debug("check non-default format or type");
+ for (let format of neverValidFormats) {
+ var buf = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, format, gl.UNSIGNED_BYTE, buf);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Should not be able to read as " + wtu.glEnumToString(gl, format));
+ }
+ for (let format of maybeValidFormats) {
+ var buf = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, format, gl.UNSIGNED_BYTE, buf);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_ENUM, gl.INVALID_OPERATION], "Should not be able to read as " + wtu.glEnumToString(gl, format));
+ }
+
+ for (let info of neverValidTypeInfo) {
+ var type = info.type;
+ var dest = info.dest;
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, type, dest);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Should not be able to read as " + wtu.glEnumToString(gl, type));
+ }
+ for (let info of maybeValidTypeInfo) {
+ var type = info.type;
+ var dest = info.dest;
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, type, dest);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_ENUM, gl.INVALID_OPERATION], "Should not be able to read as " + wtu.glEnumToString(gl, type));
+ }
+
+
+ // -
+
+ const combinations = [
+ {
+ format: gl.RGB,
+ type: gl.UNSIGNED_SHORT_5_6_5,
+ dest: new Uint8Array(3),
+ },
+ {
+ format: gl.RGBA,
+ type: gl.UNSIGNED_SHORT_5_5_5_1,
+ dest: new Uint16Array(1),
+ },
+ {
+ format: gl.RGBA,
+ type: gl.UNSIGNED_SHORT_4_4_4_4,
+ dest: new Uint16Array(1),
+ },
+ ];
+
+ const FORMATS = [
+ {
+ format: gl.RGBA,
+ channels: 4,
+ }, {
+ format: gl.RGB,
+ channels: 3,
+ }, {
+ format: gl.LUMINANCE_ALPHA,
+ channels: 2,
+ }, {
+ format: gl.ALPHA,
+ channels: 1,
+ }, {
+ format: gl.LUMINANCE,
+ channels: 3,
+ },
+ ];
+ if (contextVersion >= 2) {
+ FORMATS.push(
+ {
+ format: gl.RED,
+ channels: 1,
+ }, {
+ format: gl.RG,
+ channels: 1,
+ }, {
+ format: gl.RGBA_INTEGER,
+ channels: 4,
+ }, {
+ format: gl.RGB_INTEGER,
+ channels: 3,
+ }, {
+ format: gl.RG_INTEGER,
+ channels: 2,
+ }, {
+ format: gl.RED_INTEGER,
+ channels: 1,
+ }
+ );
+ }
+
+ // -
+
+ const TYPES = [
+ {
+ type: gl.UNSIGNED_BYTE,
+ ctor: Uint8Array,
+ }, {
+ type: gl.BYTE,
+ ctor: Int8Array,
+ }, {
+ type: gl.UNSIGNED_SHORT,
+ ctor: Uint16Array,
+ }, {
+ type: gl.SHORT,
+ ctor: Int16Array,
+ }, {
+ type: gl.UNSIGNED_INT,
+ ctor: Uint32Array,
+ }, {
+ type: gl.INT,
+ ctor: Int32Array,
+ }, {
+ type: gl.FLOAT,
+ ctor: Float32Array,
+ }
+ ];
+
+ if (contextVersion >= 2) {
+ TYPES.push(
+ {
+ type: gl.HALF_FLOAT,
+ ctor: Uint16Array,
+ }
+ );
+ }
+
+ const ext = gl.getExtension('OES_texture_half_float');
+ if (ext) {
+ TYPES.push(
+ {
+ type: ext.HALF_FLOAT_OES,
+ ctor: Uint16Array,
+ }
+ );
+ }
+
+ for (const t of TYPES) {
+ for (const f of FORMATS) {
+ const desc = Object.assign({}, f, t);
+ desc.dest = new desc.ctor(desc.channels);
+ combinations.push(desc);
+ }
+ }
+
+ // -
+
+ debug("");
+ debug("check invalid combinations of format/type");
+
+ var implFormat = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_FORMAT);
+ var implType = gl.getParameter(gl.IMPLEMENTATION_COLOR_READ_TYPE);
+ debug("IMPLEMENTATION_COLOR_READ_FORMAT: " + wtu.glEnumToString(gl, implFormat));
+ debug("IMPLEMENTATION_COLOR_READ_TYPE: " + wtu.glEnumToString(gl, implType));
+
+ for (var tt = 0; tt < combinations.length; ++ tt) {
+ var info = combinations[tt];
+ var format = info.format;
+ var type = info.type;
+ var dest = info.dest;
+ gl.readPixels(0, 0, 1, 1, format, type, dest);
+ // Only two format/type parameter pairs are accepted. GL_RGBA/GL_UNSIGNED_BYTE is always
+ // accepted on default readbuffer. The other acceptable pair can be discovered by querying
+ // GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE.
+ if ((format == gl.RGBA && type == gl.UNSIGNED_BYTE) || (format == implFormat && type == implType)) {
+ wtu.glErrorShouldBe(
+ gl, gl.NO_ERROR,
+ "Should be able to read as " + wtu.glEnumToString(gl, format) +
+ " / " + wtu.glEnumToString(gl, type));
+ } else {
+ wtu.glErrorShouldBe(
+ gl, [gl.INVALID_OPERATION, gl.INVALID_ENUM],
+ "Should not be able to read as " + wtu.glEnumToString(gl, format) +
+ " / " + wtu.glEnumToString(gl, type));
+ }
+ }
+
+ debug("");
+ debug("check reading with lots of drawing");
+ continueTestFunc = continueTestPart3;
+ width = 1024;
+ height = 1024;
+ canvas.width = width;
+ canvas.height = height;
+ if (gl.getError() != gl.CONTEXT_LOST_WEBGL) {
+ continueTestPart3();
+ }
+ }
+
+ function continueTestPart3() {
+ gl.viewport(0, 0, 1024, 1024);
+ var program = wtu.setupTexturedQuad(gl);
+ var loc = gl.getUniformLocation(program, "tex");
+ gl.disable(gl.BLEND);
+ gl.disable(gl.DEPTH_TEST);
+ var colors = [[255, 0, 0, 255], [0, 255, 0, 255], [0, 0, 255, 255]];
+ var textures = [];
+ var results = [];
+ for (var ii = 0; ii < colors.length; ++ii) {
+ gl.activeTexture(gl.TEXTURE0 + ii);
+ var tex = gl.createTexture();
+ wtu.fillTexture(gl, tex, 1, 1, colors[ii]);
+ textures.push(tex);
+ }
+ for (var ii = 0; ii < colors.length; ++ii) {
+ for (var jj = 0; jj < 300 + ii + 1; ++jj) {
+ gl.uniform1i(loc, jj % 3);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+ var buf = new Uint8Array(4);
+ gl.readPixels(512, 512, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ results.push(buf);
+ for (var kk = 0; kk < 99; ++kk) {
+ gl.uniform1i(loc, (jj + kk) % 3);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+ }
+ for (var ii = 0; ii < colors.length; ++ii) {
+ var buf = results[ii];
+ var color = colors[ii];
+ actual = [buf[0], buf[1], buf[2], buf[3]];
+ expected = [color[0], color[1], color[2], color[3]];
+ shouldBe("actual", "expected");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no GL errors");
+
+ debug("");
+ debug("check readback into Uint8ClampedArray");
+ continueTestFunc = continueTestPart4;
+ const kSize = 32;
+ canvas.width = kSize;
+ canvas.height = kSize;
+ if (gl.getError() != gl.CONTEXT_LOST_WEBGL) {
+ continueTestPart4();
+ }
+ }
+
+ function continueTestPart4() {
+ const kSize = 32;
+ gl.viewport(0, 0, kSize, kSize);
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var buf = new Uint8ClampedArray(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no GL errors reading back into a Uint8ClampedArray");
+ if (buf[0] == 0 && buf[1] == 255 && buf[2] == 0 && buf[3] == 255) {
+ testPassed("Readback into Uint8ClampedArray worked successfully");
+ } else {
+ assertMsg(false,
+ "color pixel at 0, 0 should be [0, 255, 0, 255], was " +
+ [buf[0], buf[1], buf[2], buf[3]]);
+ }
+
+ const validDatas = [
+ `new Uint8Array(4)`,
+ `new Uint8Array(new ArrayBuffer(4))`,
+ `new Uint8ClampedArray(4)`,
+ `new Uint8ClampedArray(new ArrayBuffer(4))`,
+ ];
+ if (window.SharedArrayBuffer) {
+ validDatas.push(
+ `new Uint8Array(new SharedArrayBuffer(4))`,
+ `new Uint8ClampedArray(new SharedArrayBuffer(4))`
+ );
+ }
+ for (const x of validDatas) {
+ shouldNotThrow(`gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, ${x});`);
+ }
+ }
+}
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt
new file mode 100644
index 0000000000..af2c30e473
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/00_test_list.txt
@@ -0,0 +1,8 @@
+--min-version 1.0.3 feedback-loop.html
+--max-version 1.9.9 framebuffer-object-attachment.html
+--min-version 1.0.2 framebuffer-state-restoration.html
+--max-version 1.9.9 framebuffer-test.html
+renderbuffer-initialization.html
+--min-version 1.0.4 depth-renderbuffer-initialization.html
+--min-version 1.0.4 stencil-renderbuffer-initialization.html
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/depth-renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/depth-renderbuffer-initialization.html
new file mode 100644
index 0000000000..ce3e4b89aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/depth-renderbuffer-initialization.html
@@ -0,0 +1,132 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="testbed" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description('Verify depth renderbuffers are initialized to 1.0 before being read in WebGL');
+
+var gl = wtu.create3DContext("testbed");
+
+if (!gl) {
+ testFailed('canvas.getContext() failed');
+} else {
+ // Set the clear color to green. It should never show up.
+ gl.clearColor(0, 1, 0, 1);
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.STENCIL_TEST);
+
+ let c = gl.canvas;
+ for (let i = 0; i < 2; ++i) {
+ runTest(gl, {alloc1: {w: c.width, h: c.height}, alloc2: null});
+ runTest(gl, {alloc1: null, alloc2: {w: c.width, h: c.height}});
+ // Tests for initially allocating at the wrong size.
+ runTest(gl, {alloc1: {w: 5, h: 5}, alloc2: {w: c.width, h: c.height}});
+ }
+
+ // Testing buffer clearing won't change the clear values.
+ var clearColor = gl.getParameter(gl.COLOR_CLEAR_VALUE);
+ shouldBe("clearColor", "[0, 1, 0, 1]");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no errors');
+}
+
+function runTest(gl, params) {
+ debug("Test for depth buffer: " + JSON.stringify(params));
+ let final = params.alloc2 ? params.alloc2 : params.alloc1;
+ gl.viewport(0, 0, final.w, final.h);
+ wtu.checkCanvasRect(gl, 0, 0, final.w, final.h,
+ [0, 0, 0, 0],
+ "internal buffers have been initialized to 0");
+
+ gl.disable(gl.DEPTH_TEST);
+
+ // fill the back buffer so we know that reading below happens from
+ // the renderbuffer.
+ gl.clearDepth(0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ // Set up (color+depth) test buffer.
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ var buffer = gl.createRenderbuffer();
+ var depthBuffer = gl.createRenderbuffer();
+
+ if (params.alloc1) {
+ gl.bindRenderbuffer(gl.RENDERBUFFER, buffer);
+ allocStorage(gl.RGBA4, params.alloc1.w, params.alloc1.h);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+ allocStorage(gl.DEPTH_COMPONENT16, params.alloc1.w, params.alloc1.h);
+ }
+ gl.bindRenderbuffer(gl.RENDERBUFFER, buffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, buffer);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer);
+ if (params.alloc2) {
+ if (params.alloc1) {
+ // Clear the FBO in order to make sure framebufferRenderbuffer is
+ // committed.
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Skip: framebuffer is allowed to be incomplete.");
+ return;
+ }
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ }
+ gl.bindRenderbuffer(gl.RENDERBUFFER, buffer);
+ allocStorage(gl.RGBA4, params.alloc2.w, params.alloc2.h);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+ allocStorage(gl.DEPTH_COMPONENT16, params.alloc2.w, params.alloc2.h);
+ }
+
+ function allocStorage(format, width, height) {
+ gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "should be no error after renderbufferStorage.");
+ }
+
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Skip: framebuffer is allowed to be incomplete.");
+ return;
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no errors');
+
+ // fbo depth should now be the default value of 1.0.
+
+ // Draw a blue quad (at clip z = 0.0, so depth = 0.5) (should pass the depth test: 0.5 < 1.0)
+ gl.depthFunc(gl.LESS);
+ gl.enable(gl.DEPTH_TEST);
+ wtu.setupColorQuad(gl);
+ wtu.setFloatDrawColor(gl, [0, 0, 1, 1]);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 0, 0, final.w, final.h,
+ [0, 0, 255, 255]);
+
+ gl.deleteFramebuffer(fbo);
+ gl.deleteRenderbuffer(buffer);
+
+ gl.canvas.width += 1;
+ gl.canvas.height += 1;
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no errors');
+ debug('');
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html
new file mode 100644
index 0000000000..e86db74857
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/feedback-loop.html
@@ -0,0 +1,104 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>WebGL Rendering Feedback Loop</title>
+ <link rel="stylesheet" href="../../resources/js-test-style.css"/>
+ <script src="../../js/js-test-pre.js"></script>
+ <script src="../../js/webgl-test-utils.js"> </script>
+ </head>
+ <body>
+ <canvas id="example" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+ <div id="description"></div>
+ <div id="console"></div>
+
+ <script id="vs" type="text/something-not-javascript">
+ attribute vec4 a_position;
+ attribute vec2 a_texCoord;
+ varying vec2 v_texCoord;
+ void main() {
+ gl_Position = a_position;
+ v_texCoord = a_texCoord;
+ }
+ </script>
+ <script id="fs" type="text/something-not-javascript">
+ precision mediump float;
+ varying vec2 v_texCoord;
+ uniform sampler2D u_texture;
+ void main() {
+ // Shader swizzles color channels so we can tell if the draw succeeded.
+ gl_FragColor = texture2D(u_texture, v_texCoord).gbra;
+ }
+ </script>
+ <script>
+ "use strict";
+ description("Checks that rendering feedback loops fail correctly.");
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array([255, 0, 0, 255]));
+ 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);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after creating texture");
+
+ var framebuffer = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+
+ assertMsg(gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE,
+ "framebuffer should be FRAMEBUFFER_COMPLETE.");
+
+ var program = wtu.setupProgram(gl, ["vs", "fs"], ["a_position", "a_texCoord"]);
+ gl.uniform1i(gl.getUniformLocation(program, "u_texture"), 0);
+ gl.disable(gl.BLEND);
+ gl.disable(gl.DEPTH_TEST);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after initWebGL");
+
+ // Drawing with a texture that is also bound to the current framebuffer should fail
+ var bufferObjects = wtu.setupUnitQuad(gl, 0, 1);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "after draw with invalid feedback loop");
+
+ // Ensure that the texture contents did not change after the previous render
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after drawing");
+ wtu.checkCanvas(gl, [0, 0, 255, 255], "Should be blue.");
+
+ // Drawing when texture is bound to an inactive uniform should succeed
+ var texture2 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture2);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array([0, 255, 0, 255]));
+ 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.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ wtu.drawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after draw where framebuffer texture is bound to inactive texture unit");
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "Should be red.");
+
+ var successfullyParsed = true;
+ </script>
+
+ <script src="../../js/js-test-post.js"></script>
+
+ </body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html
new file mode 100644
index 0000000000..b15e1386c7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-object-attachment.html
@@ -0,0 +1,678 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl;
+var fbo;
+var depthBuffer;
+var stencilBuffer;
+var depthStencilBuffer;
+var colorBuffer;
+var width;
+var height;
+
+var ALLOW_COMPLETE = 0x01;
+var ALLOW_UNSUPPORTED = 0x02;
+var ALLOW_INCOMPLETE_ATTACHMENT = 0x04;
+
+function checkFramebufferForAllowedStatuses(allowedStatuses)
+{
+ // If the framebuffer is in an error state for multiple reasons,
+ // we can't guarantee which one will be reported.
+ var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ var statusAllowed = ((allowedStatuses & ALLOW_COMPLETE) && (status == gl.FRAMEBUFFER_COMPLETE)) ||
+ ((allowedStatuses & ALLOW_UNSUPPORTED) && (status == gl.FRAMEBUFFER_UNSUPPORTED)) ||
+ ((allowedStatuses & ALLOW_INCOMPLETE_ATTACHMENT) && (status == gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT));
+ var msg = "gl.checkFramebufferStatus(gl.FRAMEBUFFER) returned " + status;
+ if (statusAllowed)
+ testPassed(msg);
+ else
+ testFailed(msg);
+}
+
+function checkBufferBits(attachment0, attachment1)
+{
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE)
+ return;
+
+ var haveDepthBuffer = attachment0 == gl.DEPTH_ATTACHMENT ||
+ attachment0 == gl.DEPTH_STENCIL_ATTACHMENT ||
+ attachment1 == gl.DEPTH_ATTACHMENT ||
+ attachment1 == gl.DEPTH_STENCIL_ATTACHMENT;
+ var haveStencilBuffer = attachment0 == gl.STENCIL_ATTACHMENT ||
+ attachment0 == gl.DEPTH_STENCIL_ATTACHMENT ||
+ attachment1 == gl.STENCIL_ATTACHMENT ||
+ attachment1 == gl.DEPTH_STENCIL_ATTACHMENT;
+
+ shouldBeTrue("gl.getParameter(gl.RED_BITS) + gl.getParameter(gl.GREEN_BITS) + gl.getParameter(gl.BLUE_BITS) + gl.getParameter(gl.ALPHA_BITS) >= 16");
+
+ if (haveDepthBuffer)
+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) >= 16");
+ else
+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) == 0");
+
+ if (haveStencilBuffer)
+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) >= 8");
+ else
+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) == 0");
+}
+
+function testAttachment(attachment, buffer, allowedStatuses)
+{
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, buffer);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ checkFramebufferForAllowedStatuses(allowedStatuses);
+ if ((allowedStatuses & ALLOW_COMPLETE) == 0) {
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(width * height * 4));
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION);
+ }
+ checkBufferBits(attachment);
+ gl.deleteFramebuffer(fbo);
+}
+
+function testAttachments(attachment0, buffer0, attachment1, buffer1, allowedStatuses)
+{
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment0, gl.RENDERBUFFER, buffer0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment1, gl.RENDERBUFFER, buffer1);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ checkFramebufferForAllowedStatuses(allowedStatuses);
+ checkBufferBits(attachment0, attachment1);
+ gl.deleteFramebuffer(fbo);
+}
+
+function testColorRenderbuffer(internalformat, allowedStatuses)
+{
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, internalformat, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ testAttachment(gl.COLOR_ATTACHMENT0, colorBuffer, allowedStatuses);
+}
+
+function testDepthStencilRenderbuffer(allowedStatuses)
+{
+ shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ // OpenGL itself doesn't seem to guarantee that e.g. a 2 x 0
+ // renderbuffer will report 2 for its width when queried.
+ if (!(height == 0 && width > 0))
+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH)", "width");
+ if (!(width == 0 && height > 0))
+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_HEIGHT)", "height");
+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_INTERNAL_FORMAT)", "gl.DEPTH_STENCIL");
+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_RED_SIZE)", "0");
+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_GREEN_SIZE)", "0");
+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_BLUE_SIZE)", "0");
+ shouldBe("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_ALPHA_SIZE)", "0");
+ // Avoid verifying these for zero-sized renderbuffers for the time
+ // being since it appears that even OpenGL doesn't guarantee them.
+ if (width > 0 && height > 0) {
+ shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_DEPTH_SIZE) > 0");
+ shouldBeTrue("gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_STENCIL_SIZE) > 0");
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatuses);
+ testDepthStencilDepthStencil();
+}
+
+function testDepthStencilDepthStencil()
+{
+ if (!width || !height) {
+ return;
+ }
+
+ var tests = [
+ { firstFormat: gl.DEPTH_COMPONENT16,
+ firstAttach: gl.DEPTH_ATTACHMENT,
+ secondFormat: gl.DEPTH_STENCIL,
+ secondAttach: gl.DEPTH_STENCIL_ATTACHMENT
+ },
+ { firstFormat: gl.DEPTH_STENCIL,
+ firstAttach: gl.DEPTH_STENCIL_ATTACHMENT,
+ secondFormat: gl.DEPTH_COMPONENT16,
+ secondAttach: gl.DEPTH_ATTACHMENT
+ }
+ ];
+ for (var ii = 0; ii < tests.length; ++ii) {
+ var test = tests[ii];
+ for (var jj = 0; jj < 2; ++jj) {
+ var fbo = gl.createFramebuffer();
+ var tex = gl.createTexture();
+ var firstRb = gl.createRenderbuffer();
+
+ debug("");
+ debug("test: " + wtu.glEnumToString(gl, test.firstFormat) + " vs " + wtu.glEnumToString(gl, test.secondFormat) + " with " + (jj ? "unbind" : "delete"));
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ // attach texture as color
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+
+ // attach first
+ gl.bindRenderbuffer(gl.RENDERBUFFER, firstRb);
+ gl.renderbufferStorage(gl.RENDERBUFFER, test.firstFormat, width, height);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, test.firstAttach, gl.RENDERBUFFER, firstRb);
+
+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+ gl.enable(gl.DEPTH_TEST);
+ var program = wtu.setupColorQuad(gl);
+ // Test it works
+ wtu.drawUByteColorQuad(gl, [0, 255, 0, 255]);
+ wtu.drawUByteColorQuad(gl, [255, 0, 0, 255]); // should not draw since DEPTH_FUNC == LESS
+ wtu.checkCanvasRect(gl, 0, 0, width, height, [0, 255, 0, 255], "should be green");
+
+ var secondRb = gl.createRenderbuffer();
+
+ // attach second
+ gl.bindRenderbuffer(gl.RENDERBUFFER, secondRb);
+ gl.renderbufferStorage(gl.RENDERBUFFER, test.secondFormat, width, height);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, test.secondAttach, gl.RENDERBUFFER, secondRb);
+
+ if (jj == 0) {
+ // now delete it
+ debug("test deleting second renderbuffer");
+ gl.deleteRenderbuffer(secondRb);
+ } else {
+ // unbind it
+ debug("test unbinding second renderbuffer");
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, test.secondAttach, gl.RENDERBUFFER, null);
+ }
+
+ // If the first attachment is not restored this may fail
+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ // If the first attachment is not restored this may fail.
+ gl.clear(gl.DEPTH_BUFFER_BIT);
+ wtu.drawUByteColorQuad(gl, [0, 255, 0, 255]);
+ wtu.drawUByteColorQuad(gl, [255, 0, 0, 255]); // should not draw since DEPTH_FUNC == LESS
+ wtu.checkCanvasRect(gl, 0, 0, width, height, [0, 255, 0, 255], "should be green");
+ gl.disable(gl.DEPTH_TEST);
+
+ if (jj == 1) {
+ gl.deleteRenderbuffer(secondRb);
+ }
+
+ gl.deleteRenderbuffer(secondRb);
+ gl.deleteFramebuffer(fbo);
+ }
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+}
+
+description("Test framebuffer object attachment behaviors");
+
+shouldBeNonNull("gl = wtu.create3DContext()");
+
+function testFramebufferRequiredCombinations() {
+ debug("Checking combinations of framebuffer attachments required to be valid");
+
+ // Per discussion with the OpenGL ES working group, the following framebuffer attachment
+ // combinations are required to work in all WebGL implementations:
+ // 1. COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture
+ // 2. COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture + DEPTH_ATTACHMENT = DEPTH_COMPONENT16 renderbuffer
+ // 3. COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture + DEPTH_STENCIL_ATTACHMENT = DEPTH_STENCIL renderbuffer
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ var width = 64;
+ var height = 64;
+
+ // 1. COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ 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.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ checkFramebufferForAllowedStatuses(ALLOW_COMPLETE);
+ checkBufferBits();
+
+ // 2. COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture + DEPTH_ATTACHMENT = DEPTH_COMPONENT16 renderbuffer
+ var renderbuffer = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, renderbuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, renderbuffer);
+ checkFramebufferForAllowedStatuses(ALLOW_COMPLETE);
+ checkBufferBits(gl.DEPTH_ATTACHMENT);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null);
+
+ // 3. COLOR_ATTACHMENT0 = RGBA/UNSIGNED_BYTE texture + DEPTH_STENCIL_ATTACHMENT = DEPTH_STENCIL renderbuffer
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, renderbuffer);
+ checkFramebufferForAllowedStatuses(ALLOW_COMPLETE);
+ checkBufferBits(gl.DEPTH_STENCIL_ATTACHMENT);
+
+ // Clean up
+ gl.deleteRenderbuffer(renderbuffer);
+ gl.deleteTexture(texture);
+ gl.deleteFramebuffer(fbo);
+}
+
+testFramebufferRequiredCombinations();
+
+for (width = 0; width <= 2; width += 2)
+{
+ for (height = 0; height <= 2; height += 2)
+ {
+ debug("");
+ debug("Dimensions " + width + " x " + height);
+
+ debug("Create renderbuffers");
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeNonNull("stencilBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var allowedStatusForGoodCase
+ = (width == 0 || height == 0) ? ALLOW_INCOMPLETE_ATTACHMENT : ALLOW_COMPLETE;
+
+ // some cases involving stencil seem to be implementation-dependent
+ var allowedStatusForImplDependentCase = allowedStatusForGoodCase | ALLOW_UNSUPPORTED;
+
+ debug("Attach depth using DEPTH_ATTACHMENT");
+ testAttachment(gl.DEPTH_ATTACHMENT, depthBuffer, allowedStatusForGoodCase);
+ debug("Attach depth using STENCIL_ATTACHMENT");
+ testAttachment(gl.STENCIL_ATTACHMENT, depthBuffer, ALLOW_INCOMPLETE_ATTACHMENT);
+ debug("Attach depth using DEPTH_STENCIL_ATTACHMENT");
+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthBuffer, ALLOW_INCOMPLETE_ATTACHMENT);
+ debug("Attach stencil using STENCIL_ATTACHMENT");
+ testAttachment(gl.STENCIL_ATTACHMENT, stencilBuffer, allowedStatusForImplDependentCase);
+ debug("Attach stencil using DEPTH_ATTACHMENT");
+ testAttachment(gl.DEPTH_ATTACHMENT, stencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT);
+ debug("Attach stencil using DEPTH_STENCIL_ATTACHMENT");
+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, stencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT);
+ debug("Attach depthStencil using DEPTH_STENCIL_ATTACHMENT");
+ testAttachment(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatusForGoodCase);
+ debug("Attach depthStencil using DEPTH_ATTACHMENT");
+ testAttachment(gl.DEPTH_ATTACHMENT, depthStencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT);
+ debug("Attach depthStencil using STENCIL_ATTACHMENT");
+ testAttachment(gl.STENCIL_ATTACHMENT, depthStencilBuffer, ALLOW_INCOMPLETE_ATTACHMENT);
+
+ var allowedStatusForConflictedAttachment
+ = (width == 0 || height == 0) ? ALLOW_UNSUPPORTED | ALLOW_INCOMPLETE_ATTACHMENT
+ : ALLOW_UNSUPPORTED;
+
+ debug("Attach depth, then stencil, causing conflict");
+ testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, allowedStatusForConflictedAttachment);
+ debug("Attach stencil, then depth, causing conflict");
+ testAttachments(gl.STENCIL_ATTACHMENT, stencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, allowedStatusForConflictedAttachment);
+ debug("Attach depth, then depthStencil, causing conflict");
+ testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatusForConflictedAttachment);
+ debug("Attach depthStencil, then depth, causing conflict");
+ testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.DEPTH_ATTACHMENT, depthBuffer, allowedStatusForConflictedAttachment);
+ debug("Attach stencil, then depthStencil, causing conflict");
+ testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, allowedStatusForConflictedAttachment);
+ debug("Attach depthStencil, then stencil, causing conflict");
+ testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, allowedStatusForConflictedAttachment);
+
+ debug("Attach color renderbuffer with internalformat == RGBA4");
+ testColorRenderbuffer(gl.RGBA4, allowedStatusForGoodCase);
+
+ debug("Attach color renderbuffer with internalformat == RGB5_A1");
+ testColorRenderbuffer(gl.RGB5_A1, allowedStatusForGoodCase);
+
+ debug("Attach color renderbuffer with internalformat == RGB565");
+ testColorRenderbuffer(gl.RGB565, allowedStatusForGoodCase);
+
+ debug("Create and attach depthStencil renderbuffer");
+ testDepthStencilRenderbuffer(allowedStatusForGoodCase);
+ }
+}
+
+// Determine if we can attach both color and depth or color and depth_stencil
+var depthFormat;
+var depthAttachment;
+
+function checkValidColorDepthCombination() {
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16);
+
+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+
+ return tryDepth(gl.DEPTH_COMPONENT16, gl.DEPTH_ATTACHMENT) || tryDepth(gl.DEPTH_STENCIL, gl.DEPTH_STENCIL_ATTACHMENT);
+
+ function tryDepth(try_format, try_attachment) {
+ if (depthAttachment) {
+ // If we've tried once unattach the old one.
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, null);
+ }
+ depthFormat = try_format;
+ depthAttachment = try_attachment;
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, depthBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ return gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE;
+ }
+}
+
+if (checkValidColorDepthCombination()) {
+ testFramebufferIncompleteDimensions();
+ testFramebufferIncompleteAttachment();
+ testFramebufferIncompleteMissingAttachment();
+ testUsingIncompleteFramebuffer();
+ testReadingFromMissingAttachment();
+ testBindRenderbufferBeforeFramebufferAttach();
+}
+
+function checkFramebuffer(expected) {
+ var actual = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ var msg = "gl.checkFramebufferStatus(gl.FRAMEBUFFER) should be " + wtu.glEnumToString(gl, expected) + " was " + wtu.glEnumToString(gl, actual);
+ if (expected != gl.FRAMEBUFFER_COMPLETE) {
+ msg += " or FRAMEBUFFER_UNSUPPORTED";
+ }
+ if (actual == expected ||
+ (expected != gl.FRAMEBUFFER_COMPLETE &&
+ actual == gl.FRAMBUFFER_UNSUPPORTED)) {
+ testPassed(msg);
+ } else {
+ testFailed(msg);
+ }
+}
+
+function testUsingIncompleteFramebuffer() {
+ debug("");
+ debug("Test drawing or reading from an incomplete framebuffer");
+ var program = wtu.setupTexturedQuad(gl);
+ var tex = gl.createTexture();
+ wtu.fillTexture(gl, tex, 1, 1, [0,255,0,255]);
+
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16);
+
+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, depthBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+
+ // We pick this combination because it works on desktop OpenGL but should not work on OpenGL ES 2.0
+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 32, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS);
+ debug("");
+ debug("Drawing or reading from an incomplete framebuffer should generate INVALID_FRAMEBUFFER_OPERATION");
+ testRenderingAndReading();
+
+ shouldBeNonNull("fbo2 = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo2);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
+ debug("");
+ debug("Drawing or reading from an incomplete framebuffer should generate INVALID_FRAMEBUFFER_OPERATION");
+ testRenderingAndReading();
+
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 0, 0);
+ debug("");
+ debug("Drawing or reading from an incomplete framebuffer should generate INVALID_FRAMEBUFFER_OPERATION");
+ testRenderingAndReading();
+
+ function testRenderingAndReading() {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "drawArrays with incomplete framebuffer");
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "readPixels from incomplete framebuffer");
+ // copyTexImage and copyTexSubImage can be either INVALID_FRAMEBUFFER_OPERATION because
+ // the framebuffer is invalid OR INVALID_OPERATION because in the case of no attachments
+ // the framebuffer is not of a compatible type.
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_FRAMEBUFFER_OPERATION, gl.INVALID_OPERATION], "copyTexImage2D from incomplete framebuffer");
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 1, 1, 0);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_FRAMEBUFFER_OPERATION, gl.INVALID_OPERATION], "copyTexSubImage2D from incomplete framebuffer");
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ wtu.glErrorShouldBe(gl, gl.INVALID_FRAMEBUFFER_OPERATION, "clear with incomplete framebuffer");
+ }
+}
+
+function testFramebufferIncompleteAttachment() {
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+
+ debug("");
+ debug("Wrong storage type for type of attachment be FRAMEBUFFER_INCOMPLETE_ATTACHMENT (OpenGL ES 2.0 4.4.5)");
+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
+
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+
+ debug("");
+ debug("0 size attachment should be FRAMEBUFFER_INCOMPLETE_ATTACHMENT (OpenGL ES 2.0 4.4.5)");
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 0, 0);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+}
+
+function testFramebufferIncompleteMissingAttachment() {
+ debug("");
+ debug("No attachments should be INCOMPLETE_FRAMEBUFFER_MISSING_ATTACHMENT (OpenGL ES 2.0 4.4.5)");
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
+
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+}
+
+function testFramebufferIncompleteDimensions() {
+ debug("");
+ debug("Attachments of different sizes should be FRAMEBUFFER_INCOMPLETE_DIMENSIONS (OpenGL ES 2.0 4.4.5)");
+
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16);
+
+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, depthAttachment, gl.RENDERBUFFER, depthBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+
+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 32, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS);
+ gl.renderbufferStorage(gl.RENDERBUFFER, depthFormat, 16, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 32);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, 16, 16);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ return;
+ }
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ checkFramebuffer(gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ checkFramebuffer(gl.FRAMEBUFFER_COMPLETE);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+}
+
+function testReadingFromMissingAttachment() {
+ debug("");
+ debug("Test drawing or reading from a missing framebuffer attachment");
+
+ shouldBeNonNull("fbo = gl.createFramebuffer()");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ var size = 16;
+
+ // The only scenario we can verify is an attempt to read or copy
+ // from a missing color attachment while the framebuffer is still
+ // complete.
+ shouldBeNonNull("depthBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depthBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, size, size);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "After depth renderbuffer setup");
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Unable to allocate a framebuffer with just a depth attachment; this is legal");
+ // Try just a depth/stencil renderbuffer
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, null);
+ shouldBeNonNull("depthStencilBuffer = gl.createRenderbuffer()");
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer);
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, size, size);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "After depth+stencil renderbuffer setup");
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Unable to allocate a framebuffer with just a depth+stencil attachment; this is legal");
+ return;
+ }
+ }
+
+ // The FBO has no color attachment. ReadPixels, CopyTexImage2D,
+ // and CopyTexSubImage2D should all generate INVALID_OPERATION.
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Before ReadPixels from missing attachment");
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "After ReadPixels from missing attachment");
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Before CopyTexImage2D from missing attachment");
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, size, size, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "After CopyTexImage2D from missing attachment");
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Before CopyTexSubImage2D from missing attachment");
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, size, size);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "After CopyTexSubImage2D from missing attachment");
+}
+
+// [OpenGL ES 2.0.25] Section 4.4.3 page 112
+// [OpenGL ES 3.0.2] Section 4.4.2 page 201
+// 'renderbuffer' must be either zero or the name of an existing renderbuffer object of
+// type 'renderbuffertarget', otherwise an INVALID_OPERATION error is generated.
+function testBindRenderbufferBeforeFramebufferAttach() {
+ debug("");
+ debug("Test calling framebufferRenderbuffer before bindRenderbuffer.");
+
+ let fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ let attachmentTypes = [
+ gl.COLOR_ATTACHMENT0,
+ gl.DEPTH_ATTACHMENT,
+ gl.STENCIL_ATTACHMENT,
+ gl.DEPTH_STENCIL_ATTACHMENT
+ ];
+
+ attachmentTypes.forEach(function(attachmentType) {
+ let strAttachmentType = wtu.glEnumToString(gl, attachmentType);
+ debug("");
+ debug("Testing " + strAttachmentType);
+ let rbo = gl.createRenderbuffer();
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachmentType, gl.RENDERBUFFER, rbo);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "bindRenderbuffer must be called before attachment to " + strAttachmentType);
+ shouldBe("gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, gl." + strAttachmentType + ", gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE)", "gl.NONE");
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER, attachmentType, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "Only OBJECT_TYPE can be queried when no image is attached");
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachmentType, gl.RENDERBUFFER, null);
+ gl.deleteRenderbuffer(rbo);
+ });
+
+ gl.deleteFramebuffer(fbo);
+}
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html
new file mode 100644
index 0000000000..f05a1172c2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-state-restoration.html
@@ -0,0 +1,112 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Framebuffer state restoration 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description();
+
+function test() {
+ var gl = wtu.create3DContext("example", {preserveDrawingBuffer: true});
+ if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+ return;
+ }
+ var program = wtu.setupColorQuad(gl);
+ var colorLoc = gl.getUniformLocation(program, "u_color");
+ gl.enable(gl.DEPTH_TEST);
+ gl.depthFunc(gl.LESS);
+
+ var testDrawToBackBuffer = function(label) {
+ debug("");
+ debug("drawing to backbuffer " + label);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ // Draw in green
+ gl.uniform4fv(colorLoc, [0, 1, 0, 1]);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ // Draw in red, should not draw because of depth test.
+ gl.uniform4fv(colorLoc, [1, 0, 0, 1]);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should still be green");
+ }
+
+ var testDrawToFBO = function(label ) {
+ debug("");
+ debug("drawing to framebuffer " + label);
+ // Draw in green
+ gl.uniform4fv(colorLoc, [0, 1, 0, 1]);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+ // Draw in red as there is not depth buffer.
+ gl.uniform4fv(colorLoc, [1, 0, 0, 1]);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
+ }
+
+ testDrawToBackBuffer("start");
+
+ var fbo = gl.createFramebuffer();
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 50, 50, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ 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.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ finishTest();
+ return;
+ }
+
+ wtu.checkCanvas(gl, [0, 0, 0, 0], "should be zero");
+ testDrawToFBO("start");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ testDrawToBackBuffer("after drawing to framebuffer");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ testDrawToFBO("after drawing to backbuffer");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.waitForComposite(function() {
+ testDrawToBackBuffer("after composite");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ testDrawToFBO("after drawing to backbuffer after composite");
+ wtu.waitForComposite(function() {
+ testDrawToFBO("after composite");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ testDrawToBackBuffer("after drawing to framebuffer after composite");
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+ finishTest();
+ });
+ });
+}
+test();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html
new file mode 100644
index 0000000000..6bf4878cab
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/framebuffer-test.html
@@ -0,0 +1,176 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Framebuffer 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="../../js/desktop-gl-constants.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("This tests framebuffer/renderbuffer-related functions");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking framebuffer/renderbuffer stuff.");
+
+ gl.getFramebufferAttachmentParameter(
+ gl.FRAMEBUFFER,
+ gl.COLOR_ATTACHMENT0,
+ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "calling getFramebufferAttachmentParameter on the default framebuffer should generate INVALID_OPERATION.");
+
+ assertMsg(gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE,
+ "calling checkFramebufferStatus on the default framebuffer should generate FRAMEBUFFER_COMPLETE.");
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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.texImage2D(gl.TEXTURE_2D,
+ 0, // level
+ gl.RGBA, // internalFormat
+ canvas.width, // width
+ canvas.height, // height
+ 0, // border
+ gl.RGBA, // format
+ gl.UNSIGNED_BYTE, // type
+ null); // data
+ gl.framebufferTexture2D(
+ gl.FRAMEBUFFER,
+ gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D,
+ tex,
+ 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "trying to attach a texture to default framebuffer should generate INVALID_OPERATION.");
+
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER,
+ gl.COLOR_ATTACHMENT0,
+ gl.RENDERBUFFER,
+ null);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "trying to detach default renderbuffer from default framebuffer should generate INVALID_OPERATION.");
+
+ var rb = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, canvas.width, canvas.height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "allocating renderbuffer storage of a newly created renderbuffer should succeed.");
+
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER,
+ gl.COLOR_ATTACHMENT0,
+ gl.RENDERBUFFER,
+ rb);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "trying to attach a renderbuffer to the default framebuffer should generate INVALID_OPERATION.");
+
+ var fbtex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, fbtex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ var fb = gl.createFramebuffer();
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "binding a newly created framebuffer should succeed.");
+
+ var target = desktopGL.READ_FRAMEBUFFER
+ gl.getFramebufferAttachmentParameter(
+ target,
+ gl.COLOR_ATTACHMENT0,
+ gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling getFramebufferAttachmentParameter with target = READ_FRAMEBUFFER should generate INVALID_ENUM.");
+ assertMsg(gl.checkFramebufferStatus(target) == 0,
+ "calling checkFramebufferStatus with target = READ_FRAMEBUFFER should return 0.");
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling checkFramebufferStatus with target = READ_FRAMEBUFFER should generate INVALID_ENUM.");
+ gl.bindFramebuffer(target, gl.createFramebuffer());
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling bindFramebuffer with target = READ_FRAMEBUFFER should generate INVALID_ENUM.");
+ assertMsg(fb == gl.getParameter(gl.FRAMEBUFFER_BINDING),
+ "calling bindFramebuffer with target = READ_FRAMEBUFFER should not change FRAMEBUFFER_BINDING.");
+ gl.getFramebufferAttachmentParameter(target, gl.COLOR_ATTACHMENT0, gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling getFramebufferAttachmentParameter with target = READ_FRAMEBUFFER should generate INVALID_ENUM.");
+ gl.framebufferTexture2D(target, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fbtex, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling framebufferTexImage2D with target = READ_FRAMEBUFFER should generate INVALID_ENUM.");
+ gl.framebufferRenderbuffer(target, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling framebufferRenderbuffer with target = READ_FRAMEBUFFER should generate INVALID_ENUM.");
+
+ var attachment = desktopGL.COLOR_ATTACHMENT1
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, attachment, gl.TEXTURE_2D, fbtex, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling framebufferTexImage2D with attachment = COLOR_ATTACHMENT1 should generate INVALID_ENUM.");
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment, gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling framebufferRenderbuffer with attachment = COLOR_ATTACHMENT1 should generate INVALID_ENUM.");
+
+ gl.getFramebufferAttachmentParameter(gl.FRAMEBUFFER,
+ gl.COLOR_ATTACHMENT0,
+ desktopGL.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "calling getFramebufferAttachmentParameter with pname = GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING should generate INVALID_ENUM.");
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fbtex, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "attaching a texture to a framebuffer should succeed.");
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, null, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "detaching a texture from a framebuffer should succeed.");
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, fbtex, 1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "calling framebufferTexture2D with non-zero mipmap level should generate INVALID_VALUE.");
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "attaching a renderbuffer to a framebuffer should succeed.");
+
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "detaching a renderbuffer from a framebuffer should succeed.");
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "binding default (null) framebuffer should succeed.");
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html
new file mode 100644
index 0000000000..83406552bc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/renderbuffer-initialization.html
@@ -0,0 +1,99 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="testbed" width="400" height="400" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description('Verify renderbuffers are initialized to 0 before being read in WebGL');
+
+var gl = wtu.create3DContext("testbed");
+if (!gl) {
+ testFailed('canvas.getContext() failed');
+} else {
+ // Set the clear color to green. It should never show up.
+ gl.clearColor(0, 1, 0, 1);
+
+ runTest(gl, gl.canvas.width, gl.canvas.height, 0);
+ runTest(gl, gl.canvas.width, gl.canvas.height, 1);
+ runTest(gl, gl.canvas.width, gl.canvas.height, 0);
+ runTest(gl, gl.canvas.width, gl.canvas.height, 1);
+
+ // Testing buffer clearing won't change the clear values.
+ var clearColor = gl.getParameter(gl.COLOR_CLEAR_VALUE);
+ shouldBe("clearColor", "[0, 1, 0, 1]");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no errors');
+}
+
+function runTest(gl, width, height, order)
+{
+ wtu.checkCanvasRect(gl, 0, 0, width, height, [0,0,0,0],
+ "internal buffers have been initialized to 0");
+
+ // fill the back buffer so we know that reading below happens from
+ // the renderbuffer.
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ var colorbuffer = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, colorbuffer);
+ switch (order) {
+ case 0:
+ allocStorage(width, height);
+ attachBuffer(colorbuffer);
+ break;
+ case 1:
+ attachBuffer(colorbuffer);
+ allocStorage(width, height);
+ break;
+ }
+
+ function allocStorage(width, height) {
+ gl.renderbufferStorage(gl.RENDERBUFFER, gl.RGBA4, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no error after renderbufferStorage(internalformat = RGBA4).');
+ }
+
+ function attachBuffer(colorbuffer) {
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, colorbuffer);
+ }
+
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ testFailed('Framebuffer incomplete.');
+ return;
+ }
+
+ wtu.checkCanvasRect(gl, 0, 0, width, height, [0,0,0,0],
+ "user buffers have been initialized to 0");
+
+ gl.deleteFramebuffer(fbo);
+ gl.deleteRenderbuffer(colorbuffer);
+
+ // this clear should not matter we are about to resize
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.canvas.width += 1;
+ gl.canvas.height += 1;
+
+ debug('');
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/stencil-renderbuffer-initialization.html b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/stencil-renderbuffer-initialization.html
new file mode 100644
index 0000000000..46dec1fcbf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/renderbuffers/stencil-renderbuffer-initialization.html
@@ -0,0 +1,132 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="testbed" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+description('Verify stencil renderbuffers are initialized to 0 before being read in WebGL');
+
+var gl = wtu.create3DContext("testbed");
+
+if (!gl) {
+ testFailed('canvas.getContext() failed');
+} else {
+ // Set the clear color to green. It should never show up.
+ gl.clearColor(0, 1, 0, 1);
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.STENCIL_TEST);
+
+ let c = gl.canvas;
+ for (let i = 0; i < 2; ++i) {
+ runTest(gl, {alloc1: {w: c.width, h: c.height}, alloc2: null});
+ runTest(gl, {alloc1: null, alloc2: {w: c.width, h: c.height}});
+ // Tests for initially allocating at the wrong size.
+ runTest(gl, {alloc1: {w: 5, h: 5}, alloc2: {w: c.width, h: c.height}});
+ }
+
+ // Testing buffer clearing won't change the clear values.
+ var clearColor = gl.getParameter(gl.COLOR_CLEAR_VALUE);
+ shouldBe("clearColor", "[0, 1, 0, 1]");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no errors');
+}
+
+function runTest(gl, params) {
+ debug("Test for stencil buffer: " + JSON.stringify(params));
+ let final = params.alloc2 ? params.alloc2 : params.alloc1;
+ gl.viewport(0, 0, final.w, final.h);
+ wtu.checkCanvasRect(gl, 0, 0, final.w, final.h,
+ [0, 0, 0, 0],
+ "internal buffers have been initialized to 0");
+
+ gl.disable(gl.STENCIL_TEST);
+
+ // fill the back buffer so we know that reading below happens from
+ // the renderbuffer.
+ gl.clearStencil(2);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+
+ // Set up (color+stencil) test buffer.
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ var buffer = gl.createRenderbuffer();
+ var stencilBuffer = gl.createRenderbuffer();
+
+ if (params.alloc1) {
+ gl.bindRenderbuffer(gl.RENDERBUFFER, buffer);
+ allocStorage(gl.RGBA4, params.alloc1.w, params.alloc1.h);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
+ allocStorage(gl.STENCIL_INDEX8, params.alloc1.w, params.alloc1.h);
+ }
+ gl.bindRenderbuffer(gl.RENDERBUFFER, buffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, buffer);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, stencilBuffer);
+ if (params.alloc2) {
+ if (params.alloc1) {
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Skip: framebuffer is allowed to be incomplete.");
+ return;
+ }
+ // Clear the FBO in order to make sure framebufferRenderbuffer is
+ // committed.
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.STENCIL_BUFFER_BIT);
+ }
+ gl.bindRenderbuffer(gl.RENDERBUFFER, buffer);
+ allocStorage(gl.RGBA4, params.alloc2.w, params.alloc2.h);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, stencilBuffer);
+ allocStorage(gl.STENCIL_INDEX8, params.alloc2.w, params.alloc2.h);
+ }
+
+ function allocStorage(format, width, height) {
+ gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "should be no error after renderbufferStorage.");
+ }
+
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ debug("Skip: framebuffer is allowed to be incomplete.");
+ return;
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no errors');
+
+ // fbo depth should now be the default value of 0.
+
+ // Draw a blue quad (stencil = 1) (should pass the stencil test: 1 > 0)
+ gl.stencilFunc(gl.GREATER, 1, 0xffffffff);
+ gl.enable(gl.STENCIL_TEST);
+ wtu.setupColorQuad(gl);
+ wtu.setFloatDrawColor(gl, [0, 0, 1, 1]);
+ wtu.drawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 0, 0, final.w, final.h,
+ [0, 0, 255, 255]);
+
+ gl.deleteFramebuffer(fbo);
+ gl.deleteRenderbuffer(buffer);
+
+ gl.canvas.width += 1;
+ gl.canvas.height += 1;
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, 'should be no errors');
+ debug('');
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt
new file mode 100644
index 0000000000..9cd801f558
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/00_test_list.txt
@@ -0,0 +1,44 @@
+--min-version 1.0.4 bind-framebuffer-flush-bug.html
+--min-version 1.0.4 blending.html
+--min-version 1.0.4 canvas-alpha-bug.html
+--min-version 1.0.4 clear-default-framebuffer-with-scissor-test.html
+--min-version 1.0.4 --max-version 1.9.9 clipping-wide-points.html
+--min-version 1.0.4 color-mask-preserved-during-implicit-clears.html
+--min-version 1.0.4 color-mask-should-not-affect-antialiased-framebuffer-resolution.html
+--min-version 1.0.2 culling.html
+--min-version 1.0.4 default-texture-draw-bug.html
+draw-arrays-out-of-bounds.html
+draw-elements-out-of-bounds.html
+--min-version 1.0.4 draw-webgl-to-canvas-2d-repeatedly.html
+--min-version 1.0.4 draw-with-changing-start-vertex-bug.html
+--min-version 1.0.3 framebuffer-switch.html
+--min-version 1.0.3 framebuffer-texture-switch.html
+gl-clear.html
+--min-version 1.0.3 gl-drawarrays.html
+gl-drawelements.html
+gl-scissor-test.html
+--min-version 1.0.2 gl-scissor-fbo-test.html
+--min-version 1.0.3 gl-scissor-canvas-dimensions.html
+--min-version 1.0.3 gl-viewport-test.html
+--min-version 1.0.4 line-rendering-quality.html
+--min-version 1.0.3 many-draw-calls.html
+more-than-65536-indices.html
+multisample-corruption.html
+--min-version 1.0.3 negative-one-index.html
+out-of-bounds-array-buffers.html
+out-of-bounds-index-buffers.html
+--min-version 1.0.3 point-no-attributes.html
+point-size.html
+--min-version 1.0.4 point-specific-shader-variables.html
+--min-version 1.0.3 point-with-gl-pointcoord-in-fragment-shader.html
+--min-version 1.0.3 polygon-offset.html
+--min-version 1.0.4 preservedrawingbuffer-leak.html
+--min-version 1.0.4 rendering-sampling-feedback-loop.html
+--min-version 1.0.4 scissor-rect-repeated-rendering.html
+--min-version 1.0.2 simple.html
+triangle.html
+line-loop-tri-fan.html
+--min-version 1.0.4 framebuffer-texture-clear.html
+--min-version 1.0.4 clear-after-copyTexImage2D.html
+--min-version 1.0.4 texture-switch-performance.html
+--min-version 1.0.4 rendering-stencil-large-viewport.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/bind-framebuffer-flush-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/bind-framebuffer-flush-bug.html
new file mode 100644
index 0000000000..357af132a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/bind-framebuffer-flush-bug.html
@@ -0,0 +1,146 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script>
+"use strict";
+const wtu = WebGLTestUtils;
+
+function runTest() {
+ let canvas = document.createElement('canvas');
+ document.body.appendChild(canvas);
+ const gl = wtu.create3DContext(canvas);
+ if (!gl) {
+ testFailed('could not create context');
+ return;
+ }
+ const size = 100;
+
+ debug('Setup');
+ canvas.width = size;
+ canvas.height = size;
+
+ const texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_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.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ const backbuffer = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, backbuffer);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+
+ const vertexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, 32, gl.DYNAMIC_DRAW);
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, new Float32Array([
+ 1, 1,
+ 1, -1,
+ -1, 1,
+ -1, -1,
+ ]));
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 8, 0);
+ gl.enableVertexAttribArray(0);
+
+ const blitTextureProgram = gl.createProgram();
+ const blitTextureVertex = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(blitTextureVertex, `
+ precision mediump float;
+ attribute vec2 pos;
+ varying vec2 uv;
+ void main(){
+ uv = (pos + vec2(1.0)) / 2.0;
+ gl_Position=vec4(pos*2.-1.,0.,1.);
+ }
+ `);
+ gl.compileShader(blitTextureVertex);
+ gl.attachShader(blitTextureProgram, blitTextureVertex);
+ const blitTextureFragment = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(blitTextureFragment, `
+ precision mediump float;
+ uniform sampler2D texture;
+ varying vec2 uv;
+ void main(){
+ gl_FragColor=texture2D(texture, uv);
+ }
+ `);
+ gl.compileShader(blitTextureFragment);
+ gl.attachShader(blitTextureProgram, blitTextureFragment);
+ gl.linkProgram(blitTextureProgram);
+
+ const solidColorProgram = gl.createProgram();
+ const solidColorVertex = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(solidColorVertex, `
+ precision mediump float;
+ attribute vec2 pos;
+ void main(){
+ gl_Position=vec4(pos,0.,1.);
+ }
+ `);
+ gl.compileShader(solidColorVertex);
+ gl.attachShader(solidColorProgram, solidColorVertex);
+ const solidColorFragment = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(solidColorFragment, `
+ precision mediump float;
+ void main(){
+ gl_FragColor=vec4(0.,0.,1.,1.);
+ }
+ `);
+ gl.compileShader(solidColorFragment);
+ gl.attachShader(solidColorProgram, solidColorFragment);
+ gl.bindAttribLocation(solidColorProgram, 0, "pos");
+ gl.linkProgram(solidColorProgram);
+ gl.clearColor(1, 0, 0, 1);
+
+ debug('Drawing');
+ // Draw blue rectangle to backbuffer texture
+ gl.bindFramebuffer(gl.FRAMEBUFFER, backbuffer);
+ gl.useProgram(solidColorProgram);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+
+ // Blit backbuffer texture to screen
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.useProgram(blitTextureProgram);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+
+ // Clear backbuffer texture to red
+ gl.bindFramebuffer(gl.FRAMEBUFFER, backbuffer);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Blit backbuffer texture to screen
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.useProgram(blitTextureProgram);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+
+ debug('Expected: canvas should be red');
+ debug('Buggy: canvas is blue');
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 0, 0], 'should be red');
+}
+</script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verifies workaround for bug in Intel drivers where clear and drawArrays calls are reordered across bindFramebuffer.');
+debug('Regression test for <a href="http://crbug.com/1018028">http://crbug.com/1018028</a>');
+runTest();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/blending.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/blending.html
new file mode 100644
index 0000000000..b14705cd50
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/blending.html
@@ -0,0 +1,266 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+
+<script id="eVsSrc" type="text/plain">
+void main()
+{
+ gl_PointSize = 1.0;
+ gl_Position = vec4(0, 0, 0, 1);
+}
+</script>
+
+<script id="eFsSrc" type="text/plain">
+precision mediump float;
+uniform vec4 uColor;
+
+void main()
+{
+ gl_FragColor = uColor;
+}
+</script>
+
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Blending tests');
+
+const wtu = WebGLTestUtils;
+
+function CreateContext() {
+ const gl = wtu.create3DContext();
+ gl.viewport(0, 0, 1, 1);
+
+ gl.prog = wtu.setupProgram(gl, [eVsSrc.innerHTML, eFsSrc.innerHTML]);
+ gl.prog.uColor = (() => {
+ const loc = gl.getUniformLocation(gl.prog, 'uColor');
+ return x => gl.uniform4fv(loc, x);
+ })();
+ gl.useProgram(gl.prog);
+ gl.prog.uColor([1 / 255, 2 / 255, 3 / 255, 4 / 255]);
+
+ gl.drawAndRead = type => {
+ gl.drawArrays(gl.POINTS, 0, 1);
+ let ret;
+ if (type == gl.UNSIGNED_BYTE) {
+ ret = new Uint8Array(4);
+ } else if (type == gl.FLOAT) {
+ ret = new Float32Array(4);
+ }
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, type, ret);
+ return ret;
+ };
+
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.CONSTANT_COLOR, gl.ZERO);
+
+ return gl;
+}
+
+function CreateValidFb(gl, formats) {
+ const fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+
+ for (let i in formats) {
+ i = i|0; // Otherwise i is a string. :(
+ const f = formats[i];
+ if (!f)
+ continue;
+ if (f.length == 1) {
+ const rb = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ gl.renderbufferStorage(gl.RENDERBUFFER, f[0], 1, 1);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0+i,
+ gl.RENDERBUFFER, rb);
+ continue;
+ }
+ if (f.length == 3) {
+ let internalFormat = f[0];
+ if (internalFormat === undefined) {
+ internalFormat = f[1];
+ }
+
+ const tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1,1,0, f[1],f[2], null);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0+i,
+ gl.TEXTURE_2D, tex, 0);
+ continue;
+ }
+ throw new Error('Invalid format length: ' + f);
+ }
+
+ const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ if (status != gl.FRAMEBUFFER_COMPLETE) {
+ gl.deleteFramebuffer(fb);
+ return null;
+ }
+ return fb;
+}
+
+let was, fb;
+
+const TESTS = [
+ () => {
+ debug('');
+ debug('Clamping of blendColor args:');
+
+ const gl = wtu.create3DContext();
+ if (!gl.texImage3D) { // WebGL 1.0
+ // WebGL 1.0 clamps without EXT_color_buffer_half_float or WEBGL_color_buffer_float.
+ gl.blendColor(1000, 1, 1, 1);
+ const was = gl.getParameter(gl.BLEND_COLOR);
+ expectArray(was, [1, 1, 1, 1]);
+
+ const ext = gl.getExtension('EXT_color_buffer_half_float') ||
+ gl.getExtension('WEBGL_color_buffer_float');
+ if (!ext) return;
+ }
+
+ // WebGL 2.0 or extended WebGL 1.0 may still clamp the value on store
+ // when the underlying platform does the same.
+ gl.blendColor(1000, 1, 1, 1);
+ const was = gl.getParameter(gl.BLEND_COLOR);
+ if (was[0] == 1000) {
+ expectArray(was, [1000, 1, 1, 1]);
+ } else {
+ debug("Platform does not support unclamped blend color.")
+ expectArray(was, [1, 1, 1, 1]);
+ }
+ },
+ () => {
+ debug('');
+ debug('Blending for RGBA8:');
+
+ const gl = CreateContext();
+ fb = CreateValidFb(gl, [[gl.RGBA8, gl.RGBA, gl.UNSIGNED_BYTE]]);
+ shouldBeNonNull('fb');
+
+ // Regardless of the context version and enabled extensions,
+ // the value will be clamped at draw time,
+ gl.blendColor(10, 1, 1, 1);
+ const was = gl.drawAndRead(gl.UNSIGNED_BYTE);
+ expectArray(was, [1, 2, 3, 4]);
+
+ if (gl.getExtension('EXT_color_buffer_half_float') ||
+ gl.getExtension('WEBGL_color_buffer_float') ||
+ gl.getExtension('EXT_color_buffer_float'))
+ {
+ debug('Enable floating-point color buffers and retest');
+ gl.blendColor(1000, 1, 1, 1);
+ const was = gl.drawAndRead(gl.UNSIGNED_BYTE);
+ expectArray(was, [1, 2, 3, 4]);
+ }
+ },
+ () => {
+ debug('');
+ debug('Blending for RGBA16F:');
+
+ const gl = CreateContext();
+
+ // Set the value before enabling the extension.
+ // It must be clamped only on WebGL 1.0 contexts.
+ gl.blendColor(10, 1, 1, 1);
+ if (!gl.getExtension('EXT_color_buffer_half_float')) {
+ testPassed('Missing ext EXT_color_buffer_half_float is optional, skipping.');
+ return;
+ }
+ if (!gl.texImage3D) { // WebGL 1.0
+ const ext = gl.getExtension('OES_texture_half_float');
+ gl.HALF_FLOAT = ext.HALF_FLOAT_OES; // These aren't the same value, but this'll work.
+ }
+
+ fb = CreateValidFb(gl, [[gl.RGBA16F, gl.RGBA, gl.HALF_FLOAT]]);
+ shouldBeNonNull('fb');
+ gl.prog.uColor([1, 2, 3, 4]);
+
+ let was = gl.drawAndRead(gl.FLOAT);
+ if (!gl.texImage3D) { // WebGL 1.0
+ expectArray(was, [1, 2, 3, 4]);
+ } else {
+ // Some WebGL 2.0 implementations may clamp the blend color anyway.
+ const r = gl.getParameter(gl.BLEND_COLOR)[0];
+ expectArray(was, [r, 2, 3, 4]);
+ }
+
+ // Re-set the value after the extension was enabled.
+ gl.blendColor(100, 1, 1, 1);
+ const r = gl.getParameter(gl.BLEND_COLOR)[0];
+ was = gl.drawAndRead(gl.FLOAT);
+ expectArray(was, [r, 2, 3, 4]);
+ },
+ () => {
+ debug('');
+ debug('Blending for RGBA32F:');
+
+ const gl = CreateContext();
+
+ // Set the value before enabling the extension.
+ // It must be clamped only on WebGL 1.0 contexts.
+ gl.blendColor(10, 1, 1, 1);
+ if (gl.texImage3D) { // WebGL 2.0
+ if (!gl.getExtension('EXT_color_buffer_float')) {
+ testPassed('Missing ext EXT_color_buffer_float is optional, skipping.');
+ return;
+ }
+ } else {
+ if (!gl.getExtension('WEBGL_color_buffer_float')) {
+ testPassed('Missing ext WEBGL_color_buffer_float is optional, skipping.');
+ return;
+ }
+ gl.getExtension('OES_texture_float');
+ }
+ fb = CreateValidFb(gl, [[gl.RGBA32F, gl.RGBA, gl.FLOAT]]);
+ shouldBeNonNull('fb');
+ gl.prog.uColor([1, 2, 3, 4]);
+
+ let was = gl.drawAndRead(gl.FLOAT);
+ if (!gl.texImage3D) { // WebGL 1.0
+ expectArray(was, [1, 2, 3, 4]);
+ } else {
+ // Some WebGL 2.0 implementations may clamp the blend color anyway.
+ const r = gl.getParameter(gl.BLEND_COLOR)[0];
+ expectArray(was, [r, 2, 3, 4]);
+ }
+
+ // Re-set the value after the extension was enabled.
+ gl.blendColor(100, 1, 1, 1);
+ const r = gl.getParameter(gl.BLEND_COLOR)[0];
+ was = gl.drawAndRead(gl.FLOAT);
+
+ if (!gl.getExtension('EXT_float_blend')) {
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, 'Should not be able to blend 32F formats.');
+ return;
+ }
+ wtu.glErrorShouldBe(gl, 0, 'Should be able to blend 32F formats.');
+ expectArray(was, [r, 2, 3, 4]);
+ },
+];
+
+async function Test() {
+ for (const fn of TESTS) {
+ await wtu.dispatchPromise(fn);
+ }
+ wtu.destroyAllContexts();
+ finishTest();
+}
+
+Test();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/canvas-alpha-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/canvas-alpha-bug.html
new file mode 100644
index 0000000000..f6225ffae2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/canvas-alpha-bug.html
@@ -0,0 +1,116 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Alpha blending bug on WebGL canvas</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec2 a_position;
+varying vec2 v_uv;
+void main()
+{
+ v_uv = a_position.xy * vec2(0.5, 0.5) + vec2(0.5, 0.5);
+ gl_Position = vec4(a_position.xy, 0.0, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec2 v_uv;
+uniform sampler2D u_texture;
+uniform vec4 u_color;
+void main()
+{
+ vec4 tex = texture2D(u_texture, v_uv);
+ gl_FragColor = tex * u_color;
+}
+</script>
+
+<script>
+"use strict";
+// This test exposes an Intel driver issue on macOS.
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+
+var program;
+var offscreen_tex;
+var fbo;
+
+function init()
+{
+ // Init program
+ program = wtu.setupProgram(gl, ["vshader", "fshader"], ["a_position"]);
+
+ // Init offscreen render targets and specify the format of offscreen texture to be RGB.
+ offscreen_tex = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, offscreen_tex);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, canvas.width, canvas.height, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, offscreen_tex, 0);
+
+ // Init blend state
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
+}
+
+function draw_rect()
+{
+ gl.useProgram(program);
+
+ gl.bindTexture(gl.TEXTURE_2D, offscreen_tex);
+ var u_tex_loc = gl.getUniformLocation(program, 'u_texture');
+ gl.uniform1i(u_tex_loc, 0);
+
+ wtu.setupUnitQuad(gl);
+ wtu.drawFloatColorQuad(gl, [1.0, 1.0, 1.0, 1.0]);
+}
+
+function test_canvas_alpha() {
+ init();
+
+ // Clear offscreen texture to Green
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.viewport(0, 0, canvas.width, canvas.height);
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Clear default framebuffer
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.viewport(0, 0, canvas.width, canvas.height);
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Enable alpha blending and render to default framebuffer
+ gl.enable(gl.BLEND);
+ draw_rect();
+ wtu.checkCanvasRect(gl, 0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, [0, 255, 0, 255]);
+}
+
+test_canvas_alpha();
+
+description("Exposes alpha blending bug in Intel drivers on macOS - see https://crbug.com/886970");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-after-copyTexImage2D.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-after-copyTexImage2D.html
new file mode 100644
index 0000000000..576b0cc6ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-after-copyTexImage2D.html
@@ -0,0 +1,64 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL clear after copyTexImage2D with a non-pure color</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="128" height="128"> </canvas>
+<script>
+"use strict";
+// This test verifies a Intel D3D driver bug.
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas", {"antialias" : "true"});
+
+function testClearAfterCopyTexImage2DWithoutPureOneOrZero(clearColor, expectedColor)
+{
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.clearColor(0, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var width = 16;
+ var height = 16;
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, width, height, 0);
+ gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ wtu.checkCanvasRect(gl, 0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, expectedColor);
+
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.deleteTexture(texture);
+}
+
+description("Test that if clear with a color that has non-0/1 RGB components after copyTexImage2D, the final render color should be consistent with the clear color.");
+
+for(var index = 0; index < 3; index++)
+{
+ var clearColor = [0, 0, 0, 1];
+ var expectedColor = [0, 0, 0, 255];
+ clearColor[index] = 0.8;
+ expectedColor[index] = 255 * clearColor[index];
+ testClearAfterCopyTexImage2DWithoutPureOneOrZero(clearColor, expectedColor);
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-default-framebuffer-with-scissor-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-default-framebuffer-with-scissor-test.html
new file mode 100644
index 0000000000..d33555f2bb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clear-default-framebuffer-with-scissor-test.html
@@ -0,0 +1,68 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Clear with scissor bug on WebGL canvas</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas-webgl" width="20" height="20"> </canvas>
+<canvas id="canvas-2d" width="20" height="20"> </canvas>
+
+<script>
+"use strict";
+// This test exposes an issue in older Intel D3D drivers.
+var wtu = WebGLTestUtils;
+
+function test_clear_with_scissor_on_canvas()
+{
+ var canvasWebGL = document.getElementById("canvas-webgl");
+ var gl = canvasWebGL.getContext("webgl", { antialias:false });
+ const scissorRectSize = 16;
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(0, 0, scissorRectSize, scissorRectSize);
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // The issue is found in the Chromium compositor so we need another canvas element for reproduction.
+ var canvas2D = document.getElementById("canvas-2d");
+ var context2D = canvas2D.getContext('2d');
+ context2D.drawImage(canvasWebGL, 0, 0);
+ context2D.fill();
+
+ var imageData =
+ context2D.getImageData(0, canvas2D.clientHeight - scissorRectSize, scissorRectSize, scissorRectSize);
+ var data = imageData.data;
+ var expectedColor = [0, 255, 0, 255];
+ for (var pixelIndex = 0; pixelIndex < scissorRectSize * scissorRectSize; ++pixelIndex) {
+ for (var colorIndex = 0; colorIndex < 4; ++colorIndex) {
+ if (data[pixelIndex * 4 + colorIndex] !== expectedColor[colorIndex]) {
+ var y = Math.floor(pixelIndex / scissorRectSize);
+ var x = pixelIndex % scissorRectSize;
+ testFailed("The canvas color at (" + x + ", " + y + ") is not expected");
+ return;
+ }
+ }
+ }
+}
+
+test_clear_with_scissor_on_canvas();
+
+description("Exposes clearing WebGL canvas with scissor bug on Intel D3D drivers - see https://crbug.com/1206763");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html
new file mode 100644
index 0000000000..f38aa0c4d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/clipping-wide-points.html
@@ -0,0 +1,26 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<title>Clipping wide points test</title>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="testbed" width="1" height="1"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../js/tests/clipping-wide-points.js"></script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-preserved-during-implicit-clears.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-preserved-during-implicit-clears.html
new file mode 100644
index 0000000000..4aa8740cbe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-preserved-during-implicit-clears.html
@@ -0,0 +1,111 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>ColorMask Must Be Preserved During Implicit Clears</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="canvases"></div>
+<div id="console"></div>
+<script>
+"use strict";
+const wtu = WebGLTestUtils;
+const sz = 128;
+let frames;
+let gl;
+let tests = [
+ { alpha: false, antialias: false, premultipliedAlpha: false },
+ { alpha: false, antialias: false, premultipliedAlpha: true },
+ { alpha: false, antialias: true, premultipliedAlpha: false },
+ { alpha: false, antialias: true, premultipliedAlpha: true },
+];
+let currentTest;
+let testIndex = 0;
+
+function initTest() {
+ description();
+ debug('ColorMask must be preserved during implicit clears of textures.');
+ debug('Regression test for <a href="http://crbug.com/911918">http://crbug.com/911918</a>');
+
+ requestAnimationFrame(nextTest);
+}
+
+function nextTest() {
+ if (testIndex >= tests.length) {
+ finishTest();
+ return;
+ }
+
+ frames = 20;
+ let canvases = document.getElementById('canvases');
+ let canvas = document.createElement('canvas');
+ canvas.width = sz;
+ canvas.height = sz;
+ canvases.appendChild(canvas);
+ currentTest = tests[testIndex];
+ ++testIndex;
+ gl = wtu.create3DContext(canvas, currentTest);
+ requestAnimationFrame(runTest);
+}
+
+function runTest() {
+ // Create a user-defined framebuffer which has an alpha channel.
+ let fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ // Set color mask to disable alpha writes. This is important; see below.
+ gl.colorMask(true, true, true, false);
+ let tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, sz, sz, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ // Upload a sub-rectangle. In Chrome, this was lazily clearing level 0 of the
+ // texture using OpenGL, setting the driver's color mask to (true, true, true,
+ // true) in the process. Because the user's color mask was set to (true, true,
+ // true, false) above, incorrect caching code was failing to reset the
+ // driver's color mask later. On macOS, Chrome implements alpha:false WebGL
+ // contexts on top of RGBA textures whose alpha channel is cleared to 1.0 and
+ // where the color mask is set to (true, true, true, false) during all writes.
+ // This bug was allowing that texture's alpha channel to be destroyed.
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array(4));
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ // We have to issue one clear to this framebuffer to get the color mask
+ // latched into the internal caching code.
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Switch back to default framebuffer.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ // Set clear color to transparent green.
+ gl.clearColor(0, 1, 0, 0);
+ // Clear. Result should be opaque green. Was transparent green when
+ // bug was encountered.
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvasRect(gl, 0, 0, sz, sz,
+ [ 0, 255, 0, 255 ],
+ "default framebuffer should be opaque green for " + JSON.stringify(currentTest));
+
+ gl.deleteFramebuffer(fb);
+ gl.deleteTexture(tex);
+
+ --frames;
+ if (frames == 0) {
+ requestAnimationFrame(nextTest);
+ } else {
+ requestAnimationFrame(runTest);
+ }
+}
+
+requestAnimationFrame(initTest);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-should-not-affect-antialiased-framebuffer-resolution.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-should-not-affect-antialiased-framebuffer-resolution.html
new file mode 100644
index 0000000000..7bba52e9a9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/color-mask-should-not-affect-antialiased-framebuffer-resolution.html
@@ -0,0 +1,71 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ColorMask Should Not Affect Antialiased Framebuffer Resolution</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="canvas" width="8" height="8"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+const wtu = WebGLTestUtils;
+description("This test verifies that the colorMask state does not affect resolution of the antialiased framebuffer.");
+
+debug('Regression test for <a href="https://crbug.com/1257769">https://crbug.com/1257769</a> and <a href="https://bugs.webkit.org/show_bug.cgi?id=220129">https://bugs.webkit.org/show_bug.cgi?id=220129</a>');
+
+function run() {
+ const gl = wtu.create3DContext("canvas", { antialias: true, alpha: true });
+
+ if (!gl) {
+ testFailed("WebGL context does not exist");
+ finishTest();
+ return;
+ }
+
+ testPassed("WebGL context exists");
+
+ const program = wtu.setupColorQuad(gl);
+
+ // Clear the default (multisampled) framebuffer to red.
+ gl.clearColor(1, 0, 0, 1);
+ gl.colorMask(true, true, true, true);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Draw a transparent green quad.
+ gl.useProgram(program);
+ wtu.drawFloatColorQuad(gl, [ 0, 255, 0, 0 ]);
+
+ // Clear the alpha channel.
+ gl.colorMask(false, false, false, true);
+ gl.clearColor(0, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // At this point, even setting the colorMask to all-true won't
+ // work around the bug, since that state is latched inside ANGLE
+ // only during draws / clears.
+
+ wtu.checkCanvas(gl, [ 0, 255, 0, 255 ], "should be green", 1);
+ finishTest();
+}
+
+var successfullyParsed = true;
+
+requestAnimationFrame(run);
+
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html
new file mode 100644
index 0000000000..74321f5cdd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/culling.html
@@ -0,0 +1,127 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec2 pos;
+
+void main()
+{
+ gl_Position = vec4(pos, 0, 1);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 col;
+
+void main()
+{
+ gl_FragColor = col;
+}
+</script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+function draw(gl, arr, colLoc, col) {
+ var vertices = new Float32Array(arr);
+ var vertBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ gl.uniform4fv(colLoc, col);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, vertices.length / 2);
+}
+
+function clear(gl, col) {
+ gl.clearColor(col[0], col[1], col[2], col[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+}
+
+function check(gl, winding, shoulddraw) {
+ var msg = winding + ' face was ' + (shoulddraw ? '' : 'not ') + 'drawn.';
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 255, 0, 255], msg);
+}
+
+function runTest() {
+ var cwVertices = [-1, -1, -1, 1, 1, -1, 1, 1];
+ var ccwVertices = [-1, 1, -1, -1, 1, 1, 1, -1];
+ var red = [1, 0, 0, 1];
+ var green = [0, 1, 0, 1];
+ var ok;
+
+ var gl = wtu.create3DContext('testbed', { antialias: false });
+ if (!gl) {
+ testFailed('could not create context');
+ return;
+ }
+ var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos']);
+ var colLoc = gl.getUniformLocation(program, 'col');
+
+ gl.enableVertexAttribArray(0);
+
+ debug('CULL_FACE should be off by default');
+ clear(gl, red);
+ draw(gl, ccwVertices, colLoc, green);
+ check(gl, 'CCW', true);
+ clear(gl, red);
+ draw(gl, cwVertices, colLoc, green);
+ check(gl, 'CW', true);
+
+ debug('Enabling CULL_FACE');
+ gl.enable(gl.CULL_FACE);
+
+ debug('BACK and CCW should be set by default');
+ clear(gl, red);
+ draw(gl, ccwVertices, colLoc, green);
+ check(gl, 'CCW', true);
+ clear(gl, green);
+ draw(gl, cwVertices, colLoc, red);
+ check(gl, 'CW', false);
+
+ var tests = [{ cullFace : 'BACK', frontFace : 'CCW', drawCCW : true, drawCW : false},
+ { cullFace : 'BACK', frontFace : 'CW', drawCCW : false, drawCW : true},
+ { cullFace : 'FRONT', frontFace : 'CCW', drawCCW : false, drawCW : true },
+ { cullFace : 'FRONT', frontFace : 'CW', drawCCW : true, drawCW : false},
+ { cullFace : 'FRONT_AND_BACK', frontFace : 'CCW', drawCCW : false, drawCW : false},
+ { cullFace : 'FRONT_AND_BACK', frontFace : 'CW', drawCCW : false, drawCW : false}];
+
+ for (var i = 0; i < tests.length; ++i) {
+ var t = tests[i];
+ debug('Setting ' + t.cullFace + ' and ' + t.frontFace);
+ gl.cullFace(gl[t.cullFace]);
+ gl.frontFace(gl[t.frontFace]);
+ clear(gl, t.drawCCW ? red : green);
+ draw(gl, ccwVertices, colLoc, t.drawCCW ? green : red);
+ check(gl, 'CCW', t.drawCCW);
+ clear(gl, t.drawCW ? red : green);
+ draw(gl, cwVertices, colLoc, t.drawCW ? green : red);
+ check(gl, 'CW', t.drawCW);
+ }
+}
+</script>
+</head>
+<body>
+<canvas id="testbed" width="16" height="16" style="width:50px; height:50px"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verify that culling works');
+runTest();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html
new file mode 100644
index 0000000000..0d71a0aaa5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/default-texture-draw-bug.html
@@ -0,0 +1,69 @@
+<!--
+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.
+-->
+
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Default Texture Draw Bug Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+
+</head>
+<body>
+<canvas id="c"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test attempts to provoke a Chrome bug that occured when drawing with textures when one was never bound. <a href='http://crbug.com/524144'>crbug.com/524144</a>");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("c");
+var canvas = gl.canvas;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ runDrawTests();
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function runDrawTests(drawType) {
+ debug("Test that drawing with a texture when no textures have been bound gives the expected black output");
+ canvas.width = 50; canvas.height = 50;
+ gl.viewport(0, 0, canvas.width, canvas.height);
+
+ // Set up a program that will draw with a texture
+ var program = wtu.setupNoTexCoordTextureProgram(gl);
+
+ wtu.setupIndexedQuad(gl);
+ for (var i = 0 ; i < 100 && _bufferedConsoleLogs != null; ++i) {
+ // Clear to white.
+ gl.clearColor(1.0, 1.0, 1.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ // Draw without binding any textures.
+ gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0);
+
+ // Check to ensure the entire canvas is black.
+ wtu.checkCanvasRect(gl, 0.0, 0.0, canvas.width, canvas.height,
+ [0.0, 0.0, 0.0], "Draw should pass", 2);
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html
new file mode 100644
index 0000000000..6577fa0b0a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-arrays-out-of-bounds.html
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/out-of-bounds-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test of drawArrays with out-of-bounds parameters");
+
+OutOfBoundsTest.runDrawArraysTest('gl.drawArrays(gl.TRIANGLES, $(offset), $(count))',
+ WebGLTestUtils.create3DContext(), WebGLTestUtils);
+
+debug("")
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html
new file mode 100644
index 0000000000..74f7f8eaf5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-elements-out-of-bounds.html
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/out-of-bounds-test.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test of drawElements with out-of-bounds parameters");
+
+OutOfBoundsTest.runDrawElementsTest("gl.drawElements(gl.TRIANGLES, $(count), $(type), $(offset))",
+ WebGLTestUtils.create3DContext(), WebGLTestUtils);
+
+debug("");
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-webgl-to-canvas-2d-repeatedly.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-webgl-to-canvas-2d-repeatedly.html
new file mode 100644
index 0000000000..d9a83e9166
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-webgl-to-canvas-2d-repeatedly.html
@@ -0,0 +1,91 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Draw WebGL to Canvas2D Repeatedly</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas-webgl" width="256" height="256"></canvas>
+<canvas id="canvas-2d" width="256" height="256"></canvas>
+<script>
+"use strict";
+const wtu = WebGLTestUtils;
+
+const sz = 256;
+
+function drawTo2DCanvas(c2, webGLCanvas) {
+ // Always clear 2D canvas to solid green first.
+ c2.clearRect(0, 0, sz, sz);
+ c2.fillStyle = 'rgb(0,255,0)';
+ c2.fillRect(0, 0, sz, sz);
+ // Draw WebGL canvas to this canvas.
+ c2.drawImage(webGLCanvas, 0, 0);
+}
+
+function runTest() {
+ description();
+ debug('Repeatedly drawing a WebGL canvas to a 2D canvas should only draw the most recently rendered WebGL content.');
+ debug('Regression test for <a href="http://crbug.com/894021">http://crbug.com/894021</a>');
+
+ let c2 = document.getElementById('canvas-2d').getContext('2d');
+ let webGLCanvas = document.getElementById('canvas-webgl');
+ let gl = wtu.create3DContext(webGLCanvas, { alpha: true, antialias: false, premultipliedAlpha: true });
+ let tolerance = 2;
+
+ // Clear left half of WebGL canvas to red and right half to
+ // transparent black.
+ gl.disable(gl.SCISSOR_TEST);
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.scissor(0, 0, sz / 2, sz);
+ gl.enable(gl.SCISSOR_TEST);
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ // Draw to 2D canvas.
+ drawTo2DCanvas(c2, webGLCanvas);
+
+ // Clear right half of WebGL canvas to red and left half to
+ // transparent black.
+ gl.disable(gl.SCISSOR_TEST);
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.scissor(sz / 2, 0, sz / 2, sz);
+ gl.enable(gl.SCISSOR_TEST);
+ gl.clearColor(1.0, 0.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ // Draw to 2D canvas.
+ drawTo2DCanvas(c2, webGLCanvas);
+
+ // Clear WebGL canvas to transparent black.
+ gl.disable(gl.SCISSOR_TEST);
+ gl.clearColor(0.0, 0.0, 0.0, 0.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ // Draw to 2D canvas.
+ drawTo2DCanvas(c2, webGLCanvas);
+
+ // 2D canvas should be green.
+ // In the error case, the rendering results from earlier draws were
+ // being accumulated, so the 2D canvas was ultimately red.
+ wtu.checkCanvasRect(c2, 0, 0, sz, sz,
+ [ 0, 255, 0, 255 ],
+ "should be green",
+ tolerance);
+
+ finishTest();
+}
+
+requestAnimationFrame(runTest);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html
new file mode 100644
index 0000000000..8b8dc71f59
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/draw-with-changing-start-vertex-bug.html
@@ -0,0 +1,114 @@
+<!--
+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 bug would occur after the app would render several times with the
+same vertex attributes and buffers, but using a different start offset.
+One of the buffers would likely have to be DYNAMIC.
+
+See http://anglebug.com/1327 and http://crbug.com/594509
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Draw with changing start vertex 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>
+</head>
+<body>
+<canvas id="canvas" width="16" height="16"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute mediump vec4 position;
+attribute mediump vec4 test;
+attribute mediump vec4 expected;
+varying mediump vec4 color;
+void main(void)
+{
+ gl_Position = position;
+ vec4 threshold = max(abs(expected) * 0.01, 1.0 / 64.0);
+ color = vec4(lessThanEqual(abs(test - expected), threshold));
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+varying mediump vec4 color;
+void main(void)
+{
+ gl_FragColor = color;
+}
+</script>
+
+<script>
+"use strict";
+description("Test calling drawArrays with repeatedly with a different start vertex");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas1");
+var gl = wtu.create3DContext(canvas);
+
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["position", "test", "expected"]);
+
+var vertexCount = 24;
+var testData = new Float32Array(vertexCount);
+
+for (var index = 0; index < vertexCount; ++index) {
+ testData[index] = index;
+}
+
+var quadData = new Float32Array(14)
+quadData[0] = -1.0; quadData[1] = 1.0;
+quadData[2] = -1.0; quadData[3] = -1.0;
+quadData[4] = 1.0; quadData[5] = -1.0;
+quadData[6] = -1.0; quadData[7] = 1.0;
+quadData[8] = 1.0; quadData[9] = -1.0;
+quadData[10] = 1.0; quadData[11] = 1.0;
+quadData[12] = 0.0; quadData[13] = 0.0;
+
+var quadBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, quadBuffer);
+gl.bufferData(gl.ARRAY_BUFFER, quadData, gl.STATIC_DRAW);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+gl.enableVertexAttribArray(0);
+
+// Must be STATIC to trigger the bug.
+var testBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, testBuffer);
+gl.bufferData(gl.ARRAY_BUFFER, testData, gl.STATIC_DRAW);
+gl.vertexAttribPointer(1, 1, gl.FLOAT, false, 0, 0);
+gl.enableVertexAttribArray(1);
+
+// Must be DYNAMIC to trigger the bug.
+var expectedBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, expectedBuffer);
+gl.bufferData(gl.ARRAY_BUFFER, testData, gl.DYNAMIC_DRAW);
+gl.vertexAttribPointer(2, 1, gl.FLOAT, false, 0, 0);
+gl.enableVertexAttribArray(2);
+
+function check() {
+ wtu.checkCanvas(gl, [255, 255, 255, 255], "should be white");
+}
+
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+check()
+
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+check()
+
+gl.drawArrays(gl.TRIANGLES, 1, 6);
+check()
+
+debug("");
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html
new file mode 100644
index 0000000000..df2a9ef55e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-switch.html
@@ -0,0 +1,91 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL framebuffer switching conformance 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>
+</head>
+<body>
+<canvas id="canvas" width="64" height="64"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Test framebuffer switching. The test switches between two framebuffers, copying rendering results from one to the other.");
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+
+var gl = wtu.create3DContext("canvas");
+var program = wtu.setupTexturedQuad(gl);
+
+var tex1 = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+var fb1 = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fb1);
+gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex1, 0);
+
+var tex2 = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex2);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+var fb2 = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex2, 0);
+
+gl.bindTexture(gl.TEXTURE_2D, tex1);
+gl.clearColor(1.0, 1.0, 1.0, 1.0);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+var iterate = function(checkFBOs, iterations) {
+ for (var i = 0; i < iterations; ++i) {
+ debug("Clearing framebuffer 1 to white");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb1);
+ if (checkFBOs)
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ debug("Copying framebuffer 1 to framebuffer 2");
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ if (checkFBOs)
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+ // Read what is in fb2
+ wtu.checkCanvas(gl, [255,255,255,255], "Framebuffer 2 should be white");
+};
+
+debug("");
+debug("Warm-up iteration");
+iterate(true, 1);
+
+debug("");
+debug("Iterating the test a few times since at least one bug it has exposed is somewhat flaky.");
+for (var i = 0; i < 3; ++i) {
+ debug("");
+ debug("Iteration " + (i + 1));
+ iterate(false, 2);
+}
+
+debug("");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors at the end of the test.");
+
+finishTest();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-clear.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-clear.html
new file mode 100644
index 0000000000..dc5d60def8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-clear.html
@@ -0,0 +1,97 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL framebuffer clearColor with pure 0/1</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+// This test verifies a Mac Intel HD 6000/6100 driver bug. See crbug.com/710443.
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+
+function InitializeRGBAData(width, height)
+{
+ var size = 4 * width * height;
+ var data = new Uint8Array(size);
+ for (var i = 0; i < size; i++) {
+ data[i] = 128;
+ }
+ return data;
+}
+
+function testFramebufferTextureClearWithPureZeroOrOne(clearColor, expectedColor) {
+ var width = 32;
+ var height = 32;
+ var texture0 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture0);
+ // It seems that if we add texParameteri here, all cases can pass no matter
+ // you use texParameteri or not in Line 85.
+ // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ var texData = InitializeRGBAData(width, height);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, texData);
+
+ var fbo0 = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo0);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture0, 0);
+ gl.viewport(0, 0, width, height);
+ gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var texture1 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture1);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ var fbo1 = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo1);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture1, 0);
+
+ wtu.setupTexturedQuad(gl);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture0);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo1);
+ gl.viewport(0, 0, width, height);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, expectedColor);
+
+ gl.deleteTexture(texture0);
+ gl.deleteFramebuffer(fbo0);
+ gl.deleteTexture(texture1);
+ gl.deleteFramebuffer(fbo1);
+}
+
+description("Test that if clear fbo texture color with pure 0/1 and sample this texture to draw to another fbo, the final render color should be consistent with the clear color.");
+
+for(var index = 0; index < 16; index++)
+{
+ var r = (index & 8) / 8;
+ var g = (index & 4) / 4;
+ var b = (index & 2) / 2;
+ var a = index & 1;
+ var clearColor = [r, g, b, a];
+ var expectedColor = [r * 255, g * 255, b * 255, a * 255];
+ testFramebufferTextureClearWithPureZeroOrOne(clearColor, expectedColor);
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html
new file mode 100644
index 0000000000..0043bc74de
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/framebuffer-texture-switch.html
@@ -0,0 +1,87 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL framebuffer texture attachment switching conformance 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>
+</head>
+<body>
+<canvas id="canvas" width="64" height="64"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Test framebuffer texture attachment switching. The test uses one framebuffer object and switches its color attachment.");
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+
+var gl = wtu.create3DContext("canvas");
+var program = wtu.setupTexturedQuad(gl);
+
+var fb = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+
+var tex2 = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex2);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+
+var tex1 = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+
+gl.clearColor(1.0, 1.0, 1.0, 1.0);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+var iterate = function(checkFBOs, iterations) {
+ for (var i = 0; i < iterations; ++i) {
+ debug("Clearing tex1 to white");
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex1, 0);
+ if (checkFBOs)
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ debug("Copying tex1 to tex2");
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex2, 0);
+ if (checkFBOs)
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+ // Read what is in tex2
+ wtu.checkCanvas(gl, [255,255,255,255], "tex2 should be white");
+};
+
+debug("");
+debug("Warm-up iteration");
+iterate(true, 1);
+
+debug("");
+debug("Iterating the test a few times since at least one bug it has exposed is somewhat flaky.");
+for (var i = 0; i < 3; ++i) {
+ debug("");
+ debug("Iteration " + (i + 1));
+ iterate(false, 2);
+}
+
+debug("");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors at the end of the test.");
+
+finishTest();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html
new file mode 100644
index 0000000000..e9c7210e81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-clear.html
@@ -0,0 +1,67 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL clear conformance 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>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></canvas>
+<div id="description"></div><div id="console"></div>
+<script>
+"use strict";
+description("Test clear.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.checkCanvas(gl, [0,0,0,0], "should be 0,0,0,0");
+
+gl.clearColor(1,1,1,1);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvas(gl, [255,255,255,255], "should be 255,255,255,255");
+
+gl.clearColor(0,0,0,0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvas(gl, [0,0,0,0], "should be 0,0,0,0");
+
+gl.colorMask(false, false, false, true);
+gl.clearColor(1,1,1,1);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvas(gl, [0,0,0,255], "should be 0,0,0,255");
+
+var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(
+ gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array([128, 128, 128, 192]));
+
+gl.disable(gl.DEPTH_TEST);
+gl.disable(gl.BLEND);
+gl.colorMask(true, true, true, true);
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+wtu.checkCanvas(gl, [128,128,128,192], "should be 128,128,128,192");
+
+gl.colorMask(false, false, false, true);
+gl.clearColor(1,1,1,1);
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvas(gl, [128,128,128,255], "should be 128,128,128,255");
+
+// TODO: Test depth and stencil clearing.
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html
new file mode 100644
index 0000000000..7d06e99897
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawarrays.html
@@ -0,0 +1,82 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL drawArrays Test</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+
+<script>
+"use strict";
+function init()
+{
+ description(document.title);
+
+ function checkDrawArrays(mode, count, expect, msg) {
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(mode, 0, count);
+ wtu.glErrorShouldBe(gl, expect, msg);
+ }
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+
+ checkDrawArrays(gl.TRIANGLES, 3,
+ gl.INVALID_OPERATION, "gl.DrawArrays with no buffer attached to VAO should return INVALID_OPERATION");
+
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ checkDrawArrays(gl.TRIANGLES, 3,
+ gl.NO_ERROR, "can call gl.DrawArrays with gl.TRIANGLES");
+
+ checkDrawArrays(
+ desktopGL['QUAD_STRIP'], 4,
+ gl.INVALID_ENUM, "gl.DrawArrays with QUAD_STRIP should return INVALID_ENUM");
+ checkDrawArrays(
+ desktopGL['QUADS'], 4,
+ gl.INVALID_ENUM, "gl.DrawArrays with QUADS should return INVALID_ENUM");
+ checkDrawArrays(
+ desktopGL['POLYGON'], 4,
+ gl.INVALID_ENUM, "gl.DrawArrays with POLYGON should return INVALID_ENUM");
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html
new file mode 100644
index 0000000000..347d539dbc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-drawelements.html
@@ -0,0 +1,97 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL drawElements Test</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+
+<script>"use strict";
+description(document.title);
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+gl.bindBuffer(gl.ARRAY_BUFFER, gl.createBuffer());
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([ 0, 1, 2]), gl.STATIC_DRAW);
+wtu.shouldGenerateGLError(gl, gl.NO_ERROR,
+ "gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0)");
+
+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint8Array([ 0, 1, 2, 0]), gl.STATIC_DRAW);
+wtu.shouldGenerateGLError(gl, gl.NO_ERROR,
+ "gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_BYTE, 0)");
+
+wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM,
+ "gl.drawElements(desktopGL.QUAD_STRIP, 4, gl.UNSIGNED_BYTE, 0)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM,
+ "gl.drawElements(desktopGL.QUADS, 4, gl.UNSIGNED_BYTE, 0)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM,
+ "gl.drawElements(desktopGL.POLYGON, 4, gl.UNSIGNED_BYTE, 0)");
+
+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array([ 0, 1, 2]), gl.STATIC_DRAW);
+
+wtu.shouldGenerateGLError(gl,
+ wtu.getDefault3DContextVersion() > 1 ? gl.NO_ERROR : gl.INVALID_ENUM,
+ "gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_INT, 0)");
+
+wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM,
+ "gl.drawElements(gl.TRIANGLES, 3, gl.FLOAT, 0)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_ENUM,
+ "gl.drawElements(gl.TRIANGLES, 3, gl.SHORT, 0)");
+
+// Index validation
+gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array([0,1,2,2000, 40802, 5887992]), gl.STATIC_DRAW);
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION,
+ "gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 1)");
+wtu.shouldGenerateGLError(gl, gl.NO_ERROR,
+ "gl.drawElements(gl.TRIANGLES, 2, gl.UNSIGNED_SHORT, 2)");
+var indexValidationError = wtu.shouldGenerateGLError(gl, [gl.INVALID_OPERATION, gl.NO_ERROR],
+ "gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 2)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION,
+ "gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 3)");
+wtu.shouldGenerateGLError(gl, indexValidationError,
+ "gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 0)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION,
+ "gl.drawElements(gl.TRIANGLES, 7, gl.UNSIGNED_SHORT, 0)");
+wtu.shouldGenerateGLError(gl, gl.INVALID_OPERATION,
+ "gl.drawElements(gl.TRIANGLES, 6, gl.UNSIGNED_SHORT, 2)");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html
new file mode 100644
index 0000000000..6e2f2baf30
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-canvas-dimensions.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Scissor Canvas Dimensions 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>
+<style>
+canvas {
+ border: 1px solid #000;
+ width: 64px;
+ height: 64px;
+}
+</style>
+</head>
+<body>
+<canvas id="canvas1" width="16" height="16"> </canvas>
+<canvas id="canvas2" width="16" height="16"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Check that scissoring is initially disabled and that the scissor rect does not change when canvas size changes.");
+
+var wtu = WebGLTestUtils;
+
+function testInit(canvas, attribs) {
+ var gl = wtu.create3DContext(canvas, attribs);
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ debug("Testing that scissor test is initially disabled");
+ // Setting the scissor rect should have no effect on drawing.
+ gl.scissor(0, 0, 1, 1);
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height, [0, 255, 0, 255], "whole canvas should be green");
+}
+
+function testCanvasSizeChange(canvas, attribs) {
+ var gl = wtu.create3DContext(canvas, attribs);
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ debug("Testing that scissor rect dimensions do not change if the canvas is resized.");
+ canvas.width = 32;
+ canvas.height = 32;
+ gl.viewport(0, 0, 32, 32);
+ gl.enable(gl.SCISSOR_TEST);
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ wtu.checkCanvasRect(gl, 0, 0, 16, 16, [0, 255, 0, 255], "area inside scissor should be green");
+ wtu.checkCanvasRect(gl, 0, 16, 32, 16, [0, 0, 0, 0], "area outside scissor should be black");
+ wtu.checkCanvasRect(gl, 16, 0, 16, 16, [0, 0, 0, 0], "area outside scissor should be black");
+}
+
+testInit(document.getElementById("canvas1"), {antialias: false});
+debug("");
+testCanvasSizeChange(document.getElementById("canvas2"), {antialias: false});
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html
new file mode 100644
index 0000000000..9b402a8206
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-fbo-test.html
@@ -0,0 +1,121 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Scissor FBO 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>
+</head>
+<body>
+<canvas id="canvas" width="16" height="16" style="width: 40px; height: 40px;"> </canvas>
+<canvas id="canvas2" width="16" height="16" style="width: 40px; height: 40px;"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Checks the scissor does not change when switching framebuffers.");
+
+var wtu = WebGLTestUtils;
+var gl;
+
+function makeFramebuffer(width, height) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ 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);
+ var fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ return fb;
+}
+
+function checkCanvasRect(x, y, width, height, color, msg) {
+ debug("checking: " + x + ", " + y + ", " + width + ", " + height);
+ wtu.checkCanvasRect(gl, x, y, width, height, color, msg);
+}
+
+function runEntireTest(canvasName, antialias) {
+ debug("");
+ debug("== Running scissor fbo test with antialias:" + antialias + " ==");
+ debug("");
+
+ gl = wtu.create3DContext(canvasName, {antialias: antialias});
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ testPassed("context exists");
+
+ var fb8x8 = makeFramebuffer(8, 8);
+ var fb32x32 = makeFramebuffer(32, 32);
+
+ var testScissor = function(scissorX, scissorY, scissorWidth, scissorHeight, msg) {
+ debug("");
+ debug(msg);
+
+ var test = function(fb, size) {
+ debug("");
+ debug("checking size: " + size);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var scissorRight = Math.min(scissorX + scissorWidth, size);
+ var scissorTop = Math.min(scissorY + scissorHeight, size);
+ var scWidth = scissorRight - scissorX;
+ var scHeight = scissorTop - scissorY;
+ var rightWidth = Math.min(size - scissorRight, 0);
+ var topHeight = Math.max(size - scissorTop, 0);
+ checkCanvasRect(scissorX, scissorY, scWidth, scHeight, [0, 255, 0, 255], "should be green");
+ checkCanvasRect(0, 0, size, scissorY, [255, 0, 0, 255], "should be red");
+ checkCanvasRect(0, scissorTop, size, topHeight, [255, 0, 0, 255], "should be red");
+ checkCanvasRect(0, 0, scissorX, size, [255, 0, 0, 255], "should be red");
+ checkCanvasRect(scissorRight, 0, scissorX, rightWidth, [255, 0, 0, 255], "should be red");
+ };
+
+ gl.disable(gl.SCISSOR_TEST);
+ gl.clearColor(1, 0, 0, 1);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb8x8);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb32x32);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb32x32);
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(scissorX, scissorY, scissorWidth, scissorHeight);
+ test(null, 16);
+ test(fb8x8, 8);
+ test(fb32x32, 32);
+ test(null, 16);
+ };
+
+ testScissor(2, 4, 12, 10, "test scissor in middle");
+ testScissor(0, 0, 12, 10, "test scissor at 0,0");
+ testScissor(0, 0, 16, 16, "test scissor with size that matches drawingbuffer");
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+runEntireTest("canvas", false);
+runEntireTest("canvas2", true);
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html
new file mode 100644
index 0000000000..fe78e0452e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-scissor-test.html
@@ -0,0 +1,95 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Scissor 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>
+<style>
+canvas {
+ border: 1px solid #000;
+ width: 64px;
+ height: 64px;
+}
+</style>
+</head>
+<body>
+<canvas id="canvas1" width="16" height="16"> </canvas>
+<canvas id="canvas2" width="16" height="16"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Check if glScissor setting works.");
+
+var wtu = WebGLTestUtils;
+
+function test(canvas, attribs) {
+ var gl = wtu.create3DContext(canvas, attribs);
+
+ function test(func) {
+ gl.disable(gl.SCISSOR_TEST);
+ gl.clearColor(0,0,0,0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.enable(gl.SCISSOR_TEST);
+
+ var size = 16;
+ for (var ii = 0; ii < size; ++ii) {
+ // clear a portion of the WebGL drawing buffer
+ gl.scissor(ii, ii, 1, 1);
+ func();
+ }
+
+ for (var ii = 0; ii < size; ++ii) {
+ wtu.checkCanvasRect(gl, 0, ii, ii, 1, [0, 0, 0, 0], "should be black");
+ wtu.checkCanvasRect(gl, ii, ii, 1, 1, [0, 255, 0, 255], "should be green");
+ wtu.checkCanvasRect(gl, ii + 1, ii, size - ii - 1, 1, [0, 0, 0, 0], "should be black");
+ }
+ }
+
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ debug("");
+ debug("test with clear");
+ test(function() {
+ gl.clearColor(0, 1, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ });
+
+ wtu.setupColorQuad(gl);
+
+ debug("");
+ debug("test with draw");
+ test(function() {
+ wtu.drawFloatColorQuad(gl, [0, 1, 0, 1]);
+ });
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ }
+}
+
+debug("test antialias: false");
+test(document.getElementById("canvas1"), {antialias: false});
+
+debug("");
+debug("test antialias: true");
+test(document.getElementById("canvas2"), {antialias: true});
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html
new file mode 100644
index 0000000000..d56588098f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/gl-viewport-test.html
@@ -0,0 +1,112 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Viewport 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>
+<style>
+canvas {
+ border: 1px solid #000;
+}
+</style>
+</head>
+<body>
+<canvas id="canvas1" width="64" height="128"> </canvas>
+<canvas id="canvas2" width="64" height="128"> </canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+var wtu = WebGLTestUtils;
+
+function test(canvas, attribs) {
+ var gl = wtu.create3DContext(canvas, attribs);
+
+ if (!gl) {
+ testFailed("context does not exist");
+ } else {
+ testPassed("context exists");
+
+ var blue = [0, 0, 255, 255];
+ var black = [0, 0, 0, 0];
+
+ var draw = function(viewportX, viewportY, viewportWidth, viewportHeight) {
+ gl.viewport(viewportX, viewportY, viewportWidth, viewportHeight);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.drawUByteColorQuad(gl, blue);
+ };
+
+ var drawAndCheck = function(viewportX, viewportY, viewportWidth, viewportHeight) {
+ var clipSpaceToPixelSpace = function(clip, viewportOffset, viewportSize, max) {
+ var pixel = viewportSize / 2 * clip + viewportOffset + viewportSize / 2;
+ return Math.min(max, Math.max(0, pixel));
+ };
+
+ var x1 = clipSpaceToPixelSpace(-0.5, viewportX, viewportWidth, gl.canvas.width);
+ var x2 = clipSpaceToPixelSpace( 0.5, viewportX, viewportWidth, gl.canvas.width);
+ var y1 = clipSpaceToPixelSpace(-0.5, viewportY, viewportHeight, gl.canvas.height);
+ var y2 = clipSpaceToPixelSpace( 0.5, viewportY, viewportHeight, gl.canvas.height);
+ var width = x2 - x1;
+ var height = y2 - y1;
+
+ debug("checking viewport: " + viewportX + ", " + viewportY + ", " + viewportWidth + ", " + viewportHeight);
+ debug("rect: " + x1 + ", " + y1 + ", " + width + ", " + height);
+ draw(viewportX, viewportY, viewportWidth, viewportHeight);
+ wtu.checkAreaInAndOut(gl, x1, y1, width, height, blue, black);
+ };
+
+ var program = wtu.setupSimpleColorProgram(gl);
+ wtu.setupQuad(gl, {scale: 0.5});
+
+ var w = gl.canvas.width;
+ var h = gl.canvas.height;
+
+ drawAndCheck(0, 0, w, h);
+ drawAndCheck(0, 0, w/2, h/4);
+ drawAndCheck(0, 0, w/4, h/2);
+ drawAndCheck(0, 0, w*2, h*2);
+
+ drawAndCheck(-w, 0, w, h);
+ drawAndCheck(0, -h, w, h);
+ drawAndCheck(w, 0, w, h);
+ drawAndCheck(0, h, w, h);
+
+ drawAndCheck(w/4, h/2, w, h);
+ drawAndCheck(w/4, h/2, w/2, h/4);
+ drawAndCheck(w/2, h/4, w/4, h/2);
+ drawAndCheck(w/2, h/4, w, h*2);
+
+ drawAndCheck(-w, 0, w*2, h);
+ drawAndCheck(0, -h/4, w/2, h);
+ drawAndCheck(-w/4, 0, w, h/2);
+ drawAndCheck(0, -h, w*2, h*2);
+
+ debug("");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ }
+}
+
+debug("test antialias: false");
+test(document.getElementById("canvas1"), {antialias: false});
+
+debug("");
+debug("test antialias: true");
+test(document.getElementById("canvas2"), {antialias: true});
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html
new file mode 100644
index 0000000000..e024157fc9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-loop-tri-fan.html
@@ -0,0 +1,229 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec2 pos;
+
+void main()
+{
+ gl_Position = vec4(pos, 0, 1);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main()
+{
+ gl_FragColor = vec4(0, 1, 0, 1);
+}
+</script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+// Check a single 32-bit RGBA pixel.
+function checkPixel(buf, index, correct) {
+ for (var i = 0; i < 4; ++i) {
+ if (buf[index + i] != correct[i]) {
+ return false;
+ }
+ }
+ return true;
+}
+
+// Check the line loop by reading the pixels and making sure just the edge
+// pixels are green and the rest are black.
+function checkLineLoop(gl, w) {
+ var buf = new Uint8Array(w * w * 4);
+ gl.readPixels(0, 0, w, w, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ var green = [0,255,0,255];
+ var black = [0,0,0,255];
+ var isCorrect = true;
+ for (var j = 0; j < w * w * 4; j += 4) {
+ var correct = black;
+ if (j < w * 4 || j > w * (w - 1) * 4 || j % (w * 4) == 0 || j % (w * 4) == (w - 1) * 4) {
+ correct = green;
+ }
+ // ignore corner pixels
+ if ((j == 0) || (j == 4*(w-1)) || (j == 4*w*(w-1)) || (j== 4*(w*w - 1))) {
+ continue;
+ }
+ if (!checkPixel(buf, j, correct)) {
+ isCorrect = false;
+ break;
+ }
+ }
+ if (isCorrect) {
+ testPassed("Line loop was drawn correctly.");
+ } else {
+ testFailed("Line loop was drawn incorrectly.");
+ }
+}
+
+// Check the tri fan by reading the pixels and making sure they are all green.
+function checkTriFan(gl, w) {
+ var buf = new Uint8Array(w * w * 4);
+ gl.readPixels(0, 0, w, w, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ var filled = true;
+ for (var j = 0; j < w * w * 4; j += 4) {
+ if (!checkPixel(buf, j, [0,255,0,255])) {
+ filled = false;
+ break;
+ }
+ }
+ if (filled) {
+ testPassed("Triangle fan was drawn correctly.");
+ } else {
+ testFailed("Triangle fan was drawn incorrectly.");
+ }
+}
+
+function runTest() {
+ var gl = wtu.create3DContext('testbed', { antialias: false });
+ if (!gl) {
+ testFailed('could not create context');
+ return;
+ }
+ gl.clearColor(0, 0, 0, 1);
+ var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos'])
+ var w = document.getElementById('testbed').width;
+
+ gl.enableVertexAttribArray(0);
+
+ //---------- LINE_LOOP----------
+ var d = 1/w;
+ var vertices = new Float32Array([-1+d, -1+d, 1-d, -1+d, 1-d, 1-d, -1+d, 1-d]);
+ var vertBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ var indBuf = gl.createBuffer();
+ var indices = new Uint16Array([0, 1, 2, 3]);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indBuf);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ debug('Draw a square using a line loop and verify that it draws all four sides and nothing else.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.LINE_LOOP, 0, vertices.length / 2);
+ checkLineLoop(gl, w);
+
+ debug('Draw a square using an indexed line loop and verify that it draws all four sides and nothing else.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.LINE_LOOP, indices.length, gl.UNSIGNED_SHORT, 0);
+ checkLineLoop(gl, w);
+
+ vertices = new Float32Array([0, 0, 0, 0, 0, 0, -1+d, -1+d, 1-d, -1+d, 1-d, 1-d, -1+d, 1-d]);
+ vertBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ indBuf = gl.createBuffer();
+ indices = new Uint16Array([0, 1, 2, 3, 4, 5, 6]);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indBuf);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ debug('Draw a square using a line loop with a vertex buffer offset and verify that it draws all four sides and nothing else.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.LINE_LOOP, 3, vertices.length / 2 - 3);
+ checkLineLoop(gl, w);
+
+ debug('Draw a square using an indexed line loop with an index buffer offset and verify that it draws all four sides and nothing else.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.LINE_LOOP, indices.length - 3, gl.UNSIGNED_SHORT, 3 * 2);
+ checkLineLoop(gl, w);
+
+ //---------- LINE_LOOP UBYTE ----------
+ var degenVerts = new Array(252 * 2);
+ for (var j = 0; j < 252 * 2; ++j) {
+ degenVerts[j] = -1+d;
+ }
+ degenVerts = degenVerts.concat([-1+d, -1+d, 1-d, -1+d, 1-d, 1-d, -1+d, 1-d]);
+ vertices = new Float32Array(degenVerts);
+ vertBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ indBuf = gl.createBuffer();
+ var degenInd = new Array(252);
+ for (var j = 0; j < 252; ++j) {
+ degenInd[j] = j;
+ }
+ degenInd = degenInd.concat([252, 253, 254, 255]);
+ indices = new Uint16Array(degenInd);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indBuf);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ debug('Draw a square using an ubyte indexed line loop with 256 indices and verify that it draws all four sides and nothing else.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.LINE_LOOP, indices.length, gl.UNSIGNED_SHORT, 0);
+ checkLineLoop(gl, w);
+
+ //---------- TRIANGLE_FAN ----------
+ vertices = new Float32Array([0, 0, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1]);
+ vertBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ indices = new Uint16Array([0,1,2,3,4,5]);
+ indBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indBuf);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ debug('Draw a filled square using a triangle fan and verify that it fills the entire canvas.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLE_FAN, 0, vertices.length / 2);
+ checkTriFan(gl, w);
+
+ debug('Draw a filled square using an indexed triangle fan and verify that it fills the entire canvas.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.TRIANGLE_FAN, indices.length, gl.UNSIGNED_SHORT, 0);
+ checkTriFan(gl, w);
+
+ vertices = new Float32Array([1, 1, 1, 1, 1, 1, 0, 0, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1]);
+ vertBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+ indices = new Uint16Array([0,1,2,3,4,5,6,7,8]);
+ indBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indBuf);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ debug('Draw a filled square using a triangle fan with a vertex buffer offset and verify that it fills the entire canvas.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLE_FAN, 3, vertices.length / 2 - 3);
+ checkTriFan(gl, w);
+
+ debug('Draw a filled square using an indexed triangle fan with an index buffer offset and verify that it fills the entire canvas.');
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.TRIANGLE_FAN, indices.length - 3, gl.UNSIGNED_SHORT, 3 * 2);
+ checkTriFan(gl, w);
+}
+</script>
+</head>
+<body>
+<canvas id="testbed" width="10" height="10" style="width:50px; height:50px"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verify that LINE_LOOP and TRIANGLE_FAN works correctly.');
+runTest();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-rendering-quality.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-rendering-quality.html
new file mode 100644
index 0000000000..15faa02c2b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/line-rendering-quality.html
@@ -0,0 +1,27 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<title>Line rendering quality test</title>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="testbed" width="256" height="256"></canvas>
+<canvas id="testbed2" width="256" height="256"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../js/tests/line-rendering-quality.js"></script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html
new file mode 100644
index 0000000000..2c0a2232ce
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/many-draw-calls.html
@@ -0,0 +1,138 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<script id="vshader" type="x-shader/x-vertex">
+uniform mat4 transformMatrix;
+uniform vec3 positionOffset;
+attribute vec2 aPosition;
+void main() {
+ gl_Position = transformMatrix * vec4(aPosition, 0.0, 1.0) + vec4(positionOffset, 0.0);
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+void main() {
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+</script>
+<div id="description"></div>
+<canvas id="canvas" width="256" height="256"></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+enableJSTestPreVerboseLogging();
+description("Test many draw calls and uniform updates per frame");
+
+debug('Regression test for Chromium <a href="http://crbug.com/320724">Issue 320724</a> and <a href="http://crbug.com/322726">Issue 322726</a>');
+debug('');
+
+var contextWasLost = false;
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById('canvas');
+var gl = wtu.create3DContext(canvas);
+canvas.addEventListener('webglcontextlost', function(event) { contextWasLost = true; }, false);
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], [ "aPosition" ]);
+if (!program) {
+ testFailed("failed to create test program");
+}
+
+gl.useProgram(program);
+var vertexObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.enableVertexAttribArray(0);
+
+// Initialize vertices
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ -1.0, 1.0,
+ 1.0, -1.0,
+ 1.0, 1.0,
+ -1.0, 1.0,
+ -1.0, -1.0,
+ 1.0, -1.0 ]), gl.STATIC_DRAW);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+gl.clearColor(0.3, 0.3, 0.3, 1.0);
+
+// Initialize uniforms
+var transformLoc = gl.getUniformLocation(program, 'transformMatrix');
+var offsetLoc = gl.getUniformLocation(program, 'positionOffset');
+
+// This many draw calls appear to be necessary to trigger the original bug reliably.
+var tilesPerSide = 100;
+var numDrawsThisFrame = 0;
+
+var doNextDraw = function() {
+ // Sometimes, the original bug can't be caught cooperatively, and it
+ // causes the entire tab to hang irrevocably.
+ if (contextWasLost) {
+ testFailed("WebGL context was lost while running the test");
+ finishTest();
+ return;
+ }
+
+ var totalDraws = tilesPerSide * tilesPerSide;
+ if (numDrawsThisFrame >= totalDraws) {
+ testPassed("All draw calls completed successfully");
+ finishTest();
+ return;
+ }
+
+ numDrawsThisFrame += tilesPerSide;
+
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var transformMatrix = new Float32Array(16);
+ transformMatrix[15] = 1.0;
+ var scaleFactor = 1.0 / tilesPerSide;
+ transformMatrix[0] = scaleFactor;
+ transformMatrix[5] = scaleFactor;
+ transformMatrix[10] = scaleFactor;
+
+ var offset = new Float32Array(3);
+
+ var drawsDoneThisFrame = 0;
+ for (var yy = 0; yy < tilesPerSide; ++yy) {
+ for (var xx = 0; xx < tilesPerSide; ++xx) {
+ if (drawsDoneThisFrame >= numDrawsThisFrame)
+ break;
+
+ gl.uniformMatrix4fv(transformLoc, false, transformMatrix);
+
+ offset[0] = 2.0 * ((0.5 + xx) / tilesPerSide) - 1.0;
+ offset[1] = 2.0 * ((0.5 + yy) / tilesPerSide) - 1.0;
+ gl.uniform3f(offsetLoc, offset[0], offset[1], offset[2]);
+
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ ++drawsDoneThisFrame;
+ }
+
+ if (drawsDoneThisFrame >= numDrawsThisFrame)
+ break;
+ }
+
+ var iterations = numDrawsThisFrame / tilesPerSide;
+ if (iterations % 10 === 0) {
+ // Needed to avoid test timeout within the harness on some slower platforms
+ testPassed("Completed " + iterations + " iterations");
+ }
+
+ wtu.requestAnimFrame(doNextDraw);
+}
+
+wtu.requestAnimFrame(doNextDraw);
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html
new file mode 100644
index 0000000000..02a0fe594e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/more-than-65536-indices.html
@@ -0,0 +1,123 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL More than 65536 indices.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vs" type="text/something-not-javascript">
+attribute vec4 vPosition;
+attribute vec4 vColor;
+varying vec4 color;
+void main() {
+ gl_Position = vPosition;
+ gl_PointSize = 1.0;
+ color = vColor;
+}
+</script>
+<script id="fs" type="text/something-not-javascript">
+precision mediump float;
+varying vec4 color;
+void main() {
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+description("checks that rendering with more than 65536 indices works.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vs", "fs"], ["vPosition", "vColor"]);
+var bufferObjects = wtu.setupUnitQuad(gl, 0, 1);
+
+gl.bindBuffer(gl.ARRAY_BUFFER, bufferObjects[0]);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
+ -1, 1,
+ 1, 1,
+ -1, -1,
+ 1, -1,
+ -1, 1,
+ 1, 1,
+ -1, -1,
+ 1, -1]), gl.STATIC_DRAW);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+gl.bindBuffer(gl.ARRAY_BUFFER, bufferObjects[1]);
+gl.bufferData(gl.ARRAY_BUFFER, new Uint8Array([
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 255, 0, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255]), gl.STATIC_DRAW);
+gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after program setup");
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after creating texture");
+var numQuads = Math.floor(65536 / 6) + 4;
+var numPoints = numQuads * 6;
+debug("numQuads: " + numQuads);
+debug("numPoints: " + numPoints);
+var indexBuf = new ArrayBuffer(numPoints);
+var indices = new Uint8Array(indexBuf);
+var indexBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after setting up indices");
+
+var modes = [
+ {mode: 'POINTS', offsets: [0, 1, 2, 3, 2, 1], skip: 0},
+ {mode: 'LINES', offsets: [0, 1, 2, 3, 2, 1], skip: 0},
+ {mode: 'LINE_LOOP', offsets: [0, 1, 2, 3, 2, 1], skip: 1},
+ {mode: 'LINE_STRIP', offsets: [0, 1, 2, 3, 2, 1], skip: 0},
+ {mode: 'TRIANGLES', offsets: [0, 1, 2, 3, 2, 1], skip: 0},
+ {mode: 'TRIANGLE_STRIP', offsets: [0, 1, 2, 3, 2, 1], skip: 0},
+ {mode: 'TRIANGLE_FAN', offsets: [0, 1, 3, 2, 2, 1], skip: 1}
+];
+
+for (var mm = 0; mm < modes.length; ++mm) {
+ var modeInfo = modes[mm];
+ var mode = modeInfo.mode;
+ var offsets = modeInfo.offsets;
+ var skip = modeInfo.skip;
+
+ for (var ii = 0; ii < numQuads; ++ii) {
+ var offset = ii * 6;
+ var quad = (ii == 0 || ii == (numQuads - 1)) ? 4 : 0;
+ for (var jj = 0; jj < 6; ++jj) {
+ indices[offset + jj] = quad + offsets[jj];
+ }
+ }
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ debug("");
+ debug("testing: " + mode);
+ // Draw without last 6 points.
+ gl.drawElements(gl[mode], numPoints - (skip + 1) * 6, gl.UNSIGNED_BYTE, skip * 6);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "Should be red.");
+ // Draw with last 6 points.
+ gl.drawElements(gl[mode], numPoints, gl.UNSIGNED_BYTE, 0);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "Should be green.");
+}
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after drawing");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html
new file mode 100644
index 0000000000..3836949e6b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/multisample-corruption.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Multisample Renderbuffer Corruption 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="../../js/tests/iterable-test.js"> </script>
+</head>
+<body>
+<canvas id="example" width="2048" height="2048" style="width: 128px; height: 128px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+enableJSTestPreVerboseLogging();
+description(document.title);
+debug('Regression test for <a href="https://code.google.com/p/chromium/issues/detail?id=137303">Chromium bug 137303</a>');
+
+var wtu = WebGLTestUtils;
+
+var gl = wtu.create3DContext("example", {antialias: true, preserveDrawingBuffer: true});
+if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+} else {
+ var test = IterableTest.createMultisampleCorruptionTest(gl);
+ var iterations = parseInt(wtu.getUrlOptions().iterations, 10) || 25;
+ IterableTest.run(test, iterations);
+}
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html
new file mode 100644
index 0000000000..69a59940a8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/negative-one-index.html
@@ -0,0 +1,98 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>-1 Index Rendering 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(0.0,1.0,0.0,1.0);
+}
+</script>
+
+<script>
+"use strict";
+function init()
+{
+ description(document.title);
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var contextVersion = wtu.getDefault3DContextVersion();
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ var vertexData = new Float32Array(65536 * 3);
+ vertexData[0 * 3 + 0] = 0.0;
+ vertexData[0 * 3 + 1] = 0.5;
+ vertexData[0 * 3 + 2] = 0.0;
+ vertexData[1 * 3 + 0] = -0.5;
+ vertexData[1 * 3 + 1] = -0.5;
+ vertexData[1 * 3 + 2] = 0.0;
+ vertexData[65535 * 3 + 0] = 0.5;
+ vertexData[65535 * 3 + 1] = -0.5;
+ vertexData[65535 * 3 + 2] = 0.0;
+ gl.bufferData(gl.ARRAY_BUFFER, vertexData, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ var indices = new Uint16Array([0, 1, -1]);
+ var indexBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawElements(gl.TRIANGLES, 3, gl.UNSIGNED_SHORT, 0);
+
+ if (contextVersion <= 1) {
+ // This should render a green triangle in the middle of the canvas.
+ // Some implementations may incorrectly interpret the -1 index as
+ // a primitive restart and not render anything.
+
+ // Test several locations
+ // First line should be all black
+ wtu.checkCanvasRect(gl, 0, 0, 50, 1, [0, 0, 0, 0]);
+
+ // Line 15 should be green for at least 10 pixels starting from row 20
+ wtu.checkCanvasRect(gl, 20, 15, 10, 1, [0, 255, 0, 255]);
+
+ // Last line should be all black
+ wtu.checkCanvasRect(gl, 0, 49, 50, 1, [0, 0, 0, 0]);
+ } else {
+ // For WebGL 2, PRIMITIVE_RESTART_FIXED_INDEX is always enabled.
+ // Nothing should be drawn on the canvas.
+ wtu.checkCanvasRect(gl, 0, 0, 50, 50, [0, 0, 0, 0]);
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-array-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-array-buffers.html
new file mode 100644
index 0000000000..04d4d55af1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-array-buffers.html
@@ -0,0 +1,126 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>WebGL Out-of-Bounds Array Buffer Conformance Test</title>
+</head>
+<body>
+<canvas id="canvas" width="8" height="8" style="width: 100px; height: 100px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vsCheckOutOfBounds" type="x-shader/x-vertex">
+ precision mediump float;
+ attribute vec2 position;
+ attribute vec4 vecRandom;
+ varying vec4 v_color;
+
+ // Per the spec, each component can either contain existing contents
+ // of the buffer or 0.
+ bool testFloatComponent(float component) {
+ return (component == 0.2 || component == 0.0);
+ }
+ // The last component is additionally allowed to be 1.0.
+ bool testLastFloatComponent(float component) {
+ return testFloatComponent(component) || component == 1.0;
+ }
+
+ void main() {
+ if (testFloatComponent(vecRandom.x) &&
+ testFloatComponent(vecRandom.y) &&
+ testFloatComponent(vecRandom.z) &&
+ testLastFloatComponent(vecRandom.w)) {
+ v_color = vec4(0.0, 1.0, 0.0, 1.0); // green -- We're good
+ } else {
+ v_color = vec4(1.0, 0.0, 0.0, 1.0); // red -- Unexpected value
+ }
+ gl_Position = vec4(position, 0.0, 1.0);
+ }
+</script>
+<script>
+"use strict";
+description("This test verifies that out-of-bounds array buffers behave according to spec.");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+
+var numberOfQuads = 200;
+
+// Draw out-of-bounds beginning with the start offset passed in.
+// Ensure that drawArrays flags either no error or INVALID_OPERATION. In the case of INVALID_OPERATION,
+// no canvas pixels can be touched. In the case of NO_ERROR, all written values must either be the
+// zero vertex or a value in the vertex buffer. See vsCheckOutOfBounds shader.
+function drawAndVerifyOutOfBoundsArrays(gl, first, count) {
+ gl.clearColor(0.0, 0.0, 1.0, 1.0); // Start with blue to indicate no pixels touched.
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ gl.drawArrays(gl.TRIANGLES, first, count);
+ var error = gl.getError();
+ if (error === gl.INVALID_OPERATION) {
+ testPassed("drawArrays flagged INVALID_OPERATION, which is valid so long as all canvas pixels were not touched.");
+ wtu.checkCanvas(gl, [0, 0, 255, 255]);
+ } else if (error === gl.NO_ERROR) {
+ testPassed("drawArrays flagged NO_ERROR, which is valid so long as all canvas pixels are green.");
+ wtu.checkCanvas(gl, [0, 255, 0, 255]);
+ } else {
+ testFailed("Invalid error flagged by drawArrays. Should be INVALID_OPERATION or NO_ERROR");
+ }
+}
+
+// Create a vertex buffer with 200 properly formed triangle quads. These quads will cover the
+// canvas texture such that every single pixel is touched by the fragment shader.
+var glQuadBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, glQuadBuffer);
+var quadPositions = new Float32Array(numberOfQuads * /*ComponentsPerQuad*/2 * /*VerticesPerQuad*/6);
+for (var i = 0; i < quadPositions.length; i += /*ComponentsPerQuad*/2 * /*VerticesPerQuad*/6) {
+ quadPositions[i+0] = -1.0; // upper left
+ quadPositions[i+1] = 1.0;
+ quadPositions[i+2] = 1.0; // upper right
+ quadPositions[i+3] = 1.0;
+ quadPositions[i+4] = -1.0; // lower left
+ quadPositions[i+5] = -1.0;
+ quadPositions[i+6] = 1.0; // upper right
+ quadPositions[i+7] = 1.0;
+ quadPositions[i+8] = 1.0; // lower right
+ quadPositions[i+9] = -1.0;
+ quadPositions[i+10] = -1.0; // lower left
+ quadPositions[i+11] = -1.0;
+}
+gl.bufferData(gl.ARRAY_BUFFER, quadPositions, gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+
+// Create a small vertex buffer with determined-ahead-of-time "random" values (0.2). This buffer will be
+// the one read past the end.
+var glVertexBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, glVertexBuffer);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.2, 0.2, 0.2, 0.2, 0.2, 0.2]), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(1);
+gl.vertexAttribPointer(1, 4, gl.FLOAT, false, 0, 0);
+
+// Setup the verification program.
+var glProgram = wtu.setupProgram(gl, ["vsCheckOutOfBounds", wtu.simpleVertexColorFragmentShader], ["position", "vecRandom"]);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Shader and buffer setup should not generate errors");
+
+debug("Test -- Draw off the end of the vertex buffer near the beginning of the out of bounds area.");
+drawAndVerifyOutOfBoundsArrays(gl, /*first*/6, /*count*/6);
+
+debug("");
+
+debug("Test -- Draw off the end of the vertex buffer near the end of the out of bounds area.")
+drawAndVerifyOutOfBoundsArrays(gl, /*first*/(numberOfQuads - 1) * 6, /*count*/6);
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html
new file mode 100644
index 0000000000..0eb2bfebfa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/out-of-bounds-index-buffers.html
@@ -0,0 +1,136 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<title>WebGL Out-of-Bounds Index Buffer Conformance Test</title>
+</head>
+<body>
+<canvas id="canvas" width="8" height="8" style="width: 100px; height: 100px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vsCheckOutOfBounds" type="x-shader/x-vertex">
+ precision mediump float;
+ attribute vec2 position;
+ attribute vec4 vecRandom;
+ varying vec4 v_color;
+
+ // Per the spec, each component can either contain existing contents
+ // of the buffer or 0.
+ bool testFloatComponent(float component) {
+ return (component == 0.2 || component == 0.0);
+ }
+ // The last component is additionally allowed to be 1.0.
+ bool testLastFloatComponent(float component) {
+ return testFloatComponent(component) || component == 1.0;
+ }
+
+ void main() {
+ if (testFloatComponent(vecRandom.x) &&
+ testFloatComponent(vecRandom.y) &&
+ testFloatComponent(vecRandom.z) &&
+ testLastFloatComponent(vecRandom.w)) {
+ v_color = vec4(0.0, 1.0, 0.0, 1.0); // green -- We're good
+ } else {
+ v_color = vec4(1.0, 0.0, 0.0, 1.0); // red -- Unexpected value
+ }
+ gl_Position = vec4(position, 0.0, 1.0);
+ }
+</script>
+<script>
+"use strict";
+description("This test verifies that out-of-bounds index buffers behave according to spec.");
+
+// Prepare an element array buffer that indexes out-of-bounds beginning with the start index passed in.
+// Ensure that drawElements flags either no error or INVALID_OPERATION. In the case of INVALID_OPERATION,
+// no canvas pixels can be touched. In the case of NO_ERROR, all written values must either be the
+// zero vertex or a value in the vertex buffer. See vsCheckOutOfBounds shader.
+function drawAndVerifyOutOfBoundsIndex(gl, startIndex) {
+ gl.clearColor(0.0, 0.0, 1.0, 1.0); // Start with blue to indicate no pixels touched.
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ prepareElementArrayBuffer(gl, /*StartIndex*/startIndex);
+
+ gl.drawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_SHORT, /*offset*/0);
+ var error = gl.getError();
+ if (error === gl.INVALID_OPERATION) {
+ testPassed("drawElements flagged INVALID_OPERATION, which is valid so long as all canvas pixels were not touched.");
+ wtu.checkCanvas(gl, [0, 0, 255, 255]);
+ } else if (error === gl.NO_ERROR) {
+ testPassed("drawElements flagged NO_ERROR, which is valid so long as all canvas pixels are green.");
+ wtu.checkCanvas(gl, [0, 255, 0, 255]);
+ } else {
+ testFailed("Invalid error flagged by drawElements. Should be INVALID_OPERATION or NO_ERROR");
+ }
+}
+
+// Create an element array buffer with a tri-strip that starts at startIndex and make
+// it the active element array buffer.
+function prepareElementArrayBuffer(gl, startIndex) {
+ var glElementArrayBuffer = gl.createBuffer();
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, glElementArrayBuffer);
+ var quadIndices = new Uint16Array(4);
+ for (var i = 0; i < quadIndices.length; i++) {
+ quadIndices[i] = startIndex + i;
+ }
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, quadIndices, gl.STATIC_DRAW);
+}
+
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var gl = wtu.create3DContext(canvas, {antialias: false});
+
+var numberOfQuads = 200;
+
+// Create a vertex buffer with 200 properly formed tri-strip quads. These quads will cover the canvas texture
+// such that every single pixel is touched by the fragment shader.
+var glQuadBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, glQuadBuffer);
+var quadPositions = new Float32Array(numberOfQuads * /*ComponentsPerQuad*/2 * /*VerticesPerQuad*/4);
+for (var i = 0; i < quadPositions.length; i += /*ComponentsPerQuad*/2 * /*VerticesPerQuad*/4) {
+ quadPositions[i+0] = -1.0; // upper left
+ quadPositions[i+1] = 1.0;
+ quadPositions[i+2] = 1.0; // upper right
+ quadPositions[i+3] = 1.0;
+ quadPositions[i+4] = -1.0; // lower left
+ quadPositions[i+5] = -1.0;
+ quadPositions[i+6] = 1.0; // lower right
+ quadPositions[i+7] = -1.0;
+}
+gl.bufferData(gl.ARRAY_BUFFER, quadPositions, gl.STATIC_DRAW);
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+// Create a small vertex buffer with determined-ahead-of-time "random" values (0.2). This buffer will be
+// the one indexed off the end.
+var glVertexBuffer = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, glVertexBuffer);
+gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.2, 0.2, 0.2, 0.2]), gl.STATIC_DRAW);
+gl.enableVertexAttribArray(1);
+gl.vertexAttribPointer(1, 4, gl.FLOAT, false, 0, 0);
+
+// Setup the verification program.
+var glProgram = wtu.setupProgram(gl, ["vsCheckOutOfBounds", wtu.simpleVertexColorFragmentShader], ["position", "vecRandom"]);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Shader and buffer setup should not generate errors");
+
+debug("Test -- Index off the end of the vertex buffer near the beginning of the out of bounds area.");
+drawAndVerifyOutOfBoundsIndex(gl, /*StartIndex*/4);
+
+debug("");
+
+debug("Test -- Index off the end of the vertex buffer near the end of the out of bounds area.")
+drawAndVerifyOutOfBoundsIndex(gl, /*StartIndex*/numberOfQuads - 4);
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html
new file mode 100644
index 0000000000..3b67f34942
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-no-attributes.html
@@ -0,0 +1,55 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+void main()
+{
+ gl_PointSize = 1.0;
+ gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+void main()
+{
+ gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+</script>
+</head>
+<body>
+<canvas id="testbed" width="1" height="1" style="width: 100px; height: 100px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verify that drawing a point without enabling any attributes succeeds');
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('testbed');
+
+var program1 = wtu.setupProgram(gl, ['vshader', 'fshader']);
+
+debug('Draw a point with a shader that takes no attributes and verify it fills the whole canvas.');
+
+gl.drawArrays(gl.POINTS, 0, 1);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+wtu.checkCanvas(gl, [0, 255, 0, 255]);
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html
new file mode 100644
index 0000000000..d458428221
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-size.html
@@ -0,0 +1,129 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 pos;
+attribute vec4 colorIn;
+uniform float pointSize;
+varying vec4 color;
+
+void main()
+{
+ gl_PointSize = pointSize;
+ color = colorIn;
+ gl_Position = vec4(pos, 1.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 color;
+
+void main()
+{
+ gl_FragColor = color;
+}
+</script>
+</head>
+<body>
+<canvas id="testbed" width="2" height="2"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verify GL_VERTEX_PROGRAM_POINT_SIZE is enabled in WebGL');
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext('testbed', { antialias: false });
+shouldBeNonNull("gl");
+
+gl.disable(gl.BLEND);
+
+// The choice of (0.4, 0.4) ensures that the centers of the surrounding
+// pixels are not contained within the point when it is of size 1, but
+// that they definitely are when it is of size 2.
+var vertices = new Float32Array([
+ 0.4, 0.4, 0.0]);
+var colors = new Uint8Array([
+ 255, 0, 0, 255]);
+
+var colorOffset = vertices.byteLength;
+
+var buf = new Uint8Array(2 * 2 * 4);
+var index = 0;
+
+var vbo = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+gl.bufferData(gl.ARRAY_BUFFER, colorOffset + colors.byteLength, gl.STATIC_DRAW);
+gl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices);
+gl.bufferSubData(gl.ARRAY_BUFFER, colorOffset, colors);
+
+function test(program) {
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(1, 4, gl.UNSIGNED_BYTE, true, 0, colorOffset);
+ gl.enableVertexAttribArray(1);
+
+ var locPointSize = gl.getUniformLocation(program, 'pointSize');
+
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+
+ debug('Draw a point of size 1 and verify it does not touch any other pixels.');
+
+ gl.uniform1f(locPointSize, 1.0);
+ gl.drawArrays(gl.POINTS, 0, vertices.length / 3);
+
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+
+ for (var y = 0; y < 2; ++y) {
+ for (var x = 0; x < 2; ++x) {
+ var correctColor = (x == 1 && y == 1) ? [255, 0, 0] : [0, 0, 0];
+ wtu.checkCanvasRect(gl, x, y, 1, 1, correctColor);
+ }
+ }
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ debug('Draw a point of size 2 and verify it fills the appropriate region.');
+
+ var pointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE);
+ if (pointSizeRange[1] >= 2.0) {
+ gl.uniform1f(locPointSize, 2.0);
+ gl.drawArrays(gl.POINTS, 0, vertices.length / 3);
+ shouldBe('gl.getError()', 'gl.NO_ERROR');
+ wtu.checkCanvasRect(gl, 0, 0, 2, 2, [255, 0, 0]);
+ }
+}
+
+debug('');
+debug('Pass 1');
+var program1 = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos', 'colorIn']);
+shouldBe('gl.getError()', 'gl.NO_ERROR');
+test(program1);
+
+// Under some versions of ANGLE point sprite shader programs were
+// incorrectly reloaded from cache. Rebuilding the shader program and
+// repeating the test simulates the conditions that caused it to fail
+debug('');
+debug('Pass 2');
+var program2 = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos', 'colorIn']);
+shouldBe('gl.getError()', 'gl.NO_ERROR');
+test(program2);
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html
new file mode 100644
index 0000000000..71f0bcad50
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-specific-shader-variables.html
@@ -0,0 +1,166 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Point-specific shader variables 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>
+</head>
+<body>
+<canvas id="c" width="64" height="64"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="vs-assign" type="x-shader/x-vertex">
+attribute vec2 aPosition;
+
+varying vec2 vPos;
+
+void main()
+{
+ gl_Position = vec4(aPosition, 0, 1);
+ vPos = aPosition;
+
+ gl_PointSize = 1.0;
+}
+</script>
+
+<script id="vs-conditional" type="x-shader/x-vertex">
+uniform float renderingPoints; // not assigned, equal to 0.0
+attribute vec2 aPosition;
+
+varying vec2 vPos;
+
+void main()
+{
+ gl_Position = vec4(aPosition, 0, 1);
+ vPos = aPosition;
+
+ if (renderingPoints > 0.0) {
+ gl_PointSize = 1.0;
+ }
+}
+</script>
+
+<script id="fs-overwrite" type="x-shader/x-fragment">
+varying mediump vec2 vPos;
+
+void main()
+{
+ gl_FragColor = vec4(gl_PointCoord.xy, 0, 1);
+ gl_FragColor = vec4(vPos * -2.0, 0, 1);
+}
+</script>
+
+<script id="fs-unused-branch" type="x-shader/x-fragment">
+varying mediump vec2 vPos;
+uniform mediump float uDefaultsToZero;
+
+void main()
+{
+ gl_FragColor = vec4(vPos * -2.0, 0, 1);
+ if (uDefaultsToZero == 1.0) {
+ gl_FragColor = vec4(gl_PointCoord.xy, 0, 1);
+ }
+}
+</script>
+
+<script>
+"use strict";
+description(document.title);
+
+debug('This test verifies rendering with programs referencing shader variables specific to rendering of POINTS primitives.');
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("c", {depth: false});
+
+var prog_overwrite = wtu.setupProgram(gl, ["vs-assign", "fs-overwrite"], ["aPosition"]);
+var prog_branch = wtu.setupProgram(gl, ["vs-assign", "fs-unused-branch"], ["aPosition"]);
+var prog_cond_overwrite = wtu.setupProgram(gl, ["vs-conditional", "fs-overwrite"], ["aPosition"]);
+var prog_cond_branch = wtu.setupProgram(gl, ["vs-conditional", "fs-unused-branch"], ["aPosition"]);
+
+var vertData = new Float32Array([
+ -1, -1,
+ +1, -1,
+ -1, +1,
+]);
+
+var vertexObject = gl.createBuffer();
+gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+gl.bufferData(gl.ARRAY_BUFFER, vertData, gl.STATIC_DRAW);
+
+gl.enableVertexAttribArray(0);
+gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+//////////
+
+debug("");
+debug("prog-overwrite");
+
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 0]); // Bottom-left
+
+gl.useProgram(prog_overwrite);
+gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 255, 0, 255]); // Bottom-left
+wtu.checkCanvasRect(gl, 63, 63, 1, 1, [0, 0, 0, 0]); // Top-right
+
+
+//////////
+
+debug("");
+debug("prog-branch");
+
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 0]); // Bottom-left
+
+gl.useProgram(prog_branch);
+gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 255, 0, 255]); // Bottom-left
+wtu.checkCanvasRect(gl, 63, 63, 1, 1, [0, 0, 0, 0]); // Top-right
+
+//////////
+
+debug("");
+debug("prog-cond-overwrite");
+
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 0]); // Bottom-left
+
+gl.useProgram(prog_cond_overwrite);
+gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 255, 0, 255]); // Bottom-left
+wtu.checkCanvasRect(gl, 63, 63, 1, 1, [0, 0, 0, 0]); // Top-right
+
+
+//////////
+
+debug("");
+debug("prog-cond-branch");
+
+gl.clear(gl.COLOR_BUFFER_BIT);
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 0]); // Bottom-left
+
+gl.useProgram(prog_cond_branch);
+gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 255, 0, 255]); // Bottom-left
+wtu.checkCanvasRect(gl, 63, 63, 1, 1, [0, 0, 0, 0]); // Top-right
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html
new file mode 100644
index 0000000000..802d5f1172
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/point-with-gl-pointcoord-in-fragment-shader.html
@@ -0,0 +1,119 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Point with gl_PointCoord in Fragment Shader 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>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="64" height="64"> </canvas>
+<div id="console"></div>
+<script id="vs" type="x-shader/x-vertex">
+varying vec4 v_color;
+
+// The X and Y coordinates of the center of the point.
+attribute vec2 a_vertex;
+
+uniform float u_pointSize;
+
+void main(void) {
+ gl_PointSize = u_pointSize;
+ gl_Position = vec4(a_vertex, 0.0, 1.0);
+
+ // The color of the point.
+ v_color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+</script>
+<script id="fs" type="x-shader/x-fragment">
+precision mediump float;
+
+varying vec4 v_color;
+
+void main(void) {
+ // It seems as long as this mathematical expression references
+ // gl_PointCoord, the fragment's color is incorrect.
+ vec2 diff = gl_PointCoord - vec2(.5, .5);
+ if (length(diff) > 0.5)
+ discard;
+
+ // The point should be a solid color.
+ gl_FragColor = v_color;
+}
+</script>
+<script>
+"use strict";
+// Radar 13239314
+description("This is a regression test for a graphics driver bug affecting end caps on roads in MapsGL.");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var canvasWidth = canvas.width;
+var canvasHeight = canvas.height;
+var output = document.getElementById("console");
+var gl = wtu.create3DContext(canvas);
+
+function runTest() {
+ var pointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE);
+ // This test can't really run without a maximum point size of at least 2
+ if (pointSizeRange[1] < 2.0) {
+ debug("This test needs a maximum ALIASED_POINT_SIZE_RANGE of at least 2");
+ return;
+ }
+
+ var vs = wtu.loadShaderFromScript(gl, "vs", gl.VERTEX_SHADER);
+ var fs = wtu.loadShaderFromScript(gl, "fs", gl.FRAGMENT_SHADER);
+ if (!vs || !fs) {
+ testFailed("Loading shaders failed");
+ return;
+ }
+
+ var program = wtu.setupProgram(gl, [vs, fs], ['a_vertex']);
+ if (!program) {
+ testFailed("Loading program failed");
+ return;
+ }
+
+ gl.useProgram(program);
+ gl.clearColor(0, 0, 0, 1.0);
+ gl.disable(gl.DEPTH_TEST);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // uniform float u_pointSize;
+ var uni = gl.getUniformLocation(program, 'u_pointSize');
+ gl.uniform1f(uni, Math.min(20.0, pointSizeRange[1]));
+
+ // vertex
+ var buffer = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ var vertexData = new Float32Array([
+ 0, 0,
+ ]);
+ gl.bufferData(gl.ARRAY_BUFFER, vertexData, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+ gl.drawArrays(gl.POINTS, 0, 1);
+ wtu.checkCanvasRect(gl, canvasWidth / 2, canvasHeight / 2, 1, 1,
+ [0, 255, 0, 255], "Center pixel should be green", 2);
+}
+
+runTest();
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html
new file mode 100644
index 0000000000..dfc0a0cca9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/polygon-offset.html
@@ -0,0 +1,173 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 pos;
+
+void main()
+{
+ gl_Position = vec4(pos, 1);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 col;
+
+void main()
+{
+ gl_FragColor = col;
+}
+</script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+function draw(gl, arr, colLoc, col)
+{
+ var vertices = new Float32Array(arr);
+ var vertBuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertBuf);
+ gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+ gl.uniform4fv(colLoc, col);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, vertices.length / 3);
+}
+
+function clear(gl, col, z)
+{
+ gl.clearColor(col[0], col[1], col[2], col[3]);
+ gl.clearDepth(z);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+}
+
+function check(gl)
+{
+ wtu.checkCanvasRect(gl, 0, 0, 16, 16, [0, 255, 0, 255], 'result should be green');
+}
+
+function runTest()
+{
+ var flatSquare = [-1, -1, 0,
+ -1, 1, 0,
+ 1, -1, 0,
+ 1, 1, 0];
+ var slantedSquare = [-1, -1, -0.5,
+ -1, 1, -0.5,
+ 1, -1, 0.5,
+ 1, 1, 0.5];
+ var red = [1, 0, 0, 1];
+ var green = [0, 1, 0, 1];
+ var blue = [0, 0, 1, 1];
+
+ var gl = wtu.create3DContext('testbed', { antialias: false });
+ if (!gl)
+ {
+ testFailed('could not create context');
+ return;
+ }
+ var program = wtu.setupProgram(gl, ['vshader', 'fshader'], ['pos']);
+ var colLoc = gl.getUniformLocation(program, 'col');
+
+ gl.enableVertexAttribArray(0);
+
+ gl.enable(gl.DEPTH_TEST);
+ gl.depthFunc(gl.LEQUAL);
+
+ debug('Polygon offset fill should be off by default');
+ clear(gl, red, 1.0);
+ draw(gl, slantedSquare, colLoc, blue);
+ draw(gl, slantedSquare, colLoc, green);
+ check(gl);
+
+ debug('Polygon offset units should have no effect when fill is off');
+ clear(gl, red, 1.0);
+ draw(gl, slantedSquare, colLoc, blue);
+ gl.polygonOffset(0, 10);
+ draw(gl, slantedSquare, colLoc, green);
+ check(gl);
+
+ debug('Polygon offset factor should have no effect when fill is off');
+ clear(gl, red, 1.0);
+ gl.polygonOffset(0, 0);
+ draw(gl, slantedSquare, colLoc, blue);
+ gl.polygonOffset(1.0, 0);
+ draw(gl, slantedSquare, colLoc, green);
+ check(gl);
+
+ debug('Zero polygon offset units and factor should have no effect');
+ clear(gl, red, 1.0);
+ gl.enable(gl.POLYGON_OFFSET_FILL);
+ gl.polygonOffset(0, 0);
+ draw(gl, slantedSquare, colLoc, blue);
+ draw(gl, slantedSquare, colLoc, green);
+ check(gl);
+
+ // It appears to be VERY common for drivers to implement the units offset in
+ // floating-point arithmetic, which results in rount-to-nearest-even to cause
+ // an offset of 1 to sometimes not alter the order between these polygons.
+ debug('Polygon offset units of 2 should alter order of flat polygons');
+ clear(gl, red, 1.0);
+ draw(gl, flatSquare, colLoc, green);
+ gl.polygonOffset(0, 2);
+ draw(gl, flatSquare, colLoc, blue);
+ check(gl);
+
+ debug('Polygon offset factor of 0.1 should alter order of slanted polygons');
+ clear(gl, red, 1.0);
+ gl.polygonOffset(0, 0);
+ draw(gl, slantedSquare, colLoc, green);
+ gl.polygonOffset(0.1, 0);
+ draw(gl, slantedSquare, colLoc, blue);
+ check(gl);
+
+ debug('Polygon offset factor of 0.1 should not alter order of flat polygons');
+ clear(gl, red, 1.0);
+ gl.polygonOffset(0, 0);
+ draw(gl, flatSquare, colLoc, blue);
+ gl.polygonOffset(0.1, 0);
+ draw(gl, flatSquare, colLoc, green);
+ check(gl);
+
+ debug('Disabling polygon offset fill should leave order unaffected');
+ clear(gl, red, 1.0);
+ gl.polygonOffset(0.1, 1);
+ gl.disable(gl.POLYGON_OFFSET_FILL);
+ draw(gl, slantedSquare, colLoc, blue);
+ draw(gl, slantedSquare, colLoc, green);
+ check(gl);
+
+ debug('Enabling polygon offset fill should affect order again');
+ clear(gl, red, 1.0);
+ draw(gl, slantedSquare, colLoc, green);
+ gl.enable(gl.POLYGON_OFFSET_FILL);
+ draw(gl, slantedSquare, colLoc, blue);
+ check(gl);
+}
+</script>
+</head>
+<body>
+<canvas id="testbed" width="16" height="16" style="width:50px; height:50px"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verify that polygon offset works');
+runTest();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/preservedrawingbuffer-leak.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/preservedrawingbuffer-leak.html
new file mode 100644
index 0000000000..2002db1836
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/preservedrawingbuffer-leak.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL PreserveDrawingBuffer Leak 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="../../js/tests/iterable-test.js"> </script>
+</head>
+<body>
+<canvas id="example" width="4096" height="4096" style="width: 128px; height: 128px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+enableJSTestPreVerboseLogging();
+description(document.title);
+debug('Regression test for <a href="https://code.google.com/p/chromium/issues/detail?id=682482">Chromium bug 682482</a>');
+
+var wtu = WebGLTestUtils;
+
+var gl = wtu.create3DContext("example", {preserveDrawingBuffer: true});
+if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+} else {
+ var test = IterableTest.createPreserveDrawingBufferLeakTest(gl);
+ var iterations = parseInt(wtu.getUrlOptions().iterations, 10) || 50;
+ IterableTest.run(test, iterations);
+}
+
+var successfullyParsed = true;
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-sampling-feedback-loop.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-sampling-feedback-loop.html
new file mode 100644
index 0000000000..888ee99aec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-sampling-feedback-loop.html
@@ -0,0 +1,183 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Rendering and Sampling Feedback Loop Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="8" height="8"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script id="vs100" type="x-shader/x-vertex">
+attribute vec4 aPosition;
+attribute vec2 aTexCoord;
+varying vec2 texCoord;
+void main() {
+ gl_Position = aPosition;
+ texCoord = aTexCoord;
+}
+</script>
+
+<script id="fs100" type="x-shader/x-fragment">
+#extension GL_EXT_draw_buffers : require
+precision mediump float;
+uniform sampler2D tex;
+varying vec2 texCoord;
+void main() {
+ gl_FragData[0] = texture2D(tex, texCoord);
+ gl_FragData[1] = texture2D(tex, texCoord);
+}
+</script>
+
+<script id="fs100-no-ext-draw-buffers" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+varying vec2 texCoord;
+void main() {
+ gl_FragData[0] = texture2D(tex, texCoord);
+}
+</script>
+
+<script id="vs300" type="x-shader/x-vertex">#version 300 es
+in highp vec4 aPosition;
+in vec2 aTexCoord;
+out vec2 texCoord;
+void main() {
+ gl_Position = aPosition;
+ texCoord = aTexCoord;
+}
+</script>
+
+<script id="fs300" type="x-shader/x-fragment">#version 300 es
+precision mediump float;
+uniform sampler2D tex;
+in vec2 texCoord;
+out vec4 oColor;
+void main() {
+ oColor = texture(tex, texCoord);
+}
+</script>
+
+<script>
+"use strict";
+
+const wtu = WebGLTestUtils;
+description("This test verifies the functionality of rendering to the same texture where it samples from.");
+
+const gl = wtu.create3DContext("example");
+
+const width = 8;
+const height = 8;
+let tex;
+let fbo;
+let drawBuffers = null;
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ if (gl.drawBuffers) {
+ debug("Using webgl2.drawBuffers.");
+ drawBuffers = (x) => gl.drawBuffers(x);
+ } else {
+ const ext = gl.getExtension("WEBGL_draw_buffers");
+ if (ext) {
+ debug("Using WEBGL_draw_buffers.drawBuffersWEBGL.");
+ drawBuffers = (x) => ext.drawBuffersWEBGL(x);
+ }
+ }
+
+ init();
+
+ // The sampling texture is bound to COLOR_ATTACHMENT1 during resource allocation
+ allocate_resource();
+
+ rendering_sampling_feedback_loop(null);
+ if (drawBuffers) {
+ rendering_sampling_feedback_loop([gl.NONE]);
+ rendering_sampling_feedback_loop([gl.COLOR_ATTACHMENT0,
+ gl.COLOR_ATTACHMENT0+1]);
+ rendering_sampling_feedback_loop([gl.NONE,
+ gl.COLOR_ATTACHMENT0+1]);
+ }
+}
+
+function init() {
+ let shaders = ["vs100", "fs100"];
+ if (gl.texStorage2D) {
+ shaders = ["vs300", "fs300"];
+ } else if (!drawBuffers) {
+ shaders = ["vs100", "fs100-no-ext-draw-buffers"];
+ }
+ const program = wtu.setupProgram(gl, shaders, ["aPosition", "aTexCoord"], [0, 1]);
+ const positionLoc = gl.getAttribLocation(program, "aPosition");
+ const texCoordLoc = gl.getAttribLocation(program, "aTexCoord");
+ if (!program || positionLoc < 0 || texCoordLoc < 0) {
+ testFailed("Set up program failed");
+ return;
+ }
+ const texLoc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(texLoc, 0);
+ testPassed("Set up program succeeded");
+
+ wtu.setupUnitQuad(gl, 0, 1);
+ gl.viewport(0, 0, width, height);
+}
+
+function allocate_resource() {
+ tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+}
+
+function rendering_sampling_feedback_loop(draw_buffers) {
+ debug("draw_buffers: " + JSON.stringify(draw_buffers));
+
+ if (draw_buffers) {
+ drawBuffers(draw_buffers);
+ }
+
+ // Make sure framebuffer is complete before feedback loop detection
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {
+ testFailed("Framebuffer incomplete.");
+ return;
+ }
+
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "Feedback loop detection should ignore drawBuffers settings.");
+
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST);
+ // The texture will be mipmap incomplete, so feedback cannot occur nor be consistently evaluated.
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Feedback loop detection should ignore sampled incomplete textures.");
+
+ if (draw_buffers) {
+ drawBuffers([gl.COLOR_ATTACHMENT0]);
+ }
+}
+
+gl.deleteTexture(tex);
+gl.deleteFramebuffer(fbo);
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-stencil-large-viewport.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-stencil-large-viewport.html
new file mode 100644
index 0000000000..1202106c13
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/rendering-stencil-large-viewport.html
@@ -0,0 +1,92 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Rendering Stencil large viewport Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+
+<script id="vs" type="x-shader/x-vertex">
+attribute vec4 a_Position;
+void main()
+{
+ gl_Position = a_Position;
+}
+</script>
+<script id="fs" type="x-shader/x-fragment">
+precision mediump float;
+uniform vec4 u_draw_color;
+void main()
+{
+ gl_FragColor = u_draw_color;
+}
+</script>
+
+</head>
+<body>
+<canvas id="example" width="4" height="4"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+var wtu = WebGLTestUtils;
+description("This test reproduces a driver bug on Intel windows platforms http://crbug.com/782317.");
+
+var gl = wtu.create3DContext("example", {stencil: true});
+
+var program, colorLoc;
+
+// Rendering with large viewport and stencil buffer enabled will lead to
+// memory leak and driver crash on d3d11 driver on Intel platforms.
+function render_stencil() {
+ var canvas = document.getElementById("example");
+ gl.uniform4f(colorLoc, 1.0, 0.0, 0.0, 1.0);
+
+ canvas.width = 32767;
+ canvas.height = 32767;
+ gl.viewport(0, 0, 32767, 32767);
+
+ gl.enable(gl.STENCIL_TEST);
+
+ var kStencilRef = 4;
+ gl.stencilOp(gl.REPLACE, gl.REPLACE, gl.REPLACE);
+ gl.stencilFunc(gl.ALWAYS, kStencilRef, 0xFF);
+
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [255, 0, 0, 255],
+ "stencil test should be red");
+}
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ program = wtu.setupProgram(gl, ["vs", "fs"], ["a_Position"]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after program initialization");
+ shouldBe('gl.getProgramParameter(program, gl.LINK_STATUS)', 'true');
+
+ colorLoc = gl.getUniformLocation(program, "u_draw_color")
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "query uniform location");
+ shouldBeNonNull('colorLoc');
+ wtu.setupUnitQuad(gl, 0);
+
+ render_stencil();
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/scissor-rect-repeated-rendering.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/scissor-rect-repeated-rendering.html
new file mode 100644
index 0000000000..f76da1614a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/scissor-rect-repeated-rendering.html
@@ -0,0 +1,63 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Scissor Rectangle Repeated Rendering 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>
+</head>
+<body>
+<canvas id="example" width="128" height="128"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+description();
+debug('Regression test for <a href="https://code.google.com/p/chromium/issues/detail?id=778770">Chromium bug 778770</a>');
+
+var wtu = WebGLTestUtils;
+
+// These context creation attributes are significant to reproduce the bug.
+var gl = wtu.create3DContext("example", {alpha: false, antialias: false});
+
+// Draw into the upper right quadrant.
+var x = 64;
+var y = 64;
+var width = 64;
+var height = 64;
+
+var numRenders = 10;
+
+function render() {
+ gl.viewport(x, y, width, height);
+ gl.scissor(x, y, width, height);
+ gl.enable(gl.SCISSOR_TEST);
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // If anything but black is ever seen in the un-drawn region of
+ // the canvas, the test fails.
+ var black = [0, 0, 0, 255];
+ wtu.checkCanvasRect(gl, 10, 10, 10, 10, black, "should be black", 1);
+
+ if (--numRenders > 0) {
+ window.requestAnimationFrame(render);
+ } else {
+ finishTest();
+ }
+}
+
+window.requestAnimationFrame(render);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html
new file mode 100644
index 0000000000..c01d213577
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/simple.html
@@ -0,0 +1,77 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Simple Rendering 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_Position;
+void main()
+{
+ gl_Position = a_Position;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(0,1,0,1);
+}
+</script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+function init()
+{
+ description();
+
+ var gl = wtu.create3DContext("example");
+ var program = wtu.loadProgramFromScript(gl, "vshader", "fshader");
+ gl.useProgram(program);
+ var loc = gl.getAttribLocation(program, "a_Position");
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array(
+ [ 1, 1,
+ -1, 1,
+ -1, -1,
+ 1, 1,
+ -1, -1,
+ 1, -1]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(loc);
+ gl.vertexAttribPointer(loc, 2, gl.FLOAT, false, 0, 0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ wtu.checkCanvas(gl, [0,0,0,0], "should be black", 0);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0,255,0,255], "should be green", 0);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/texture-switch-performance.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/texture-switch-performance.html
new file mode 100644
index 0000000000..bdc9099a6b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/texture-switch-performance.html
@@ -0,0 +1,101 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Texture 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Ensures that switching the texture referenced by a sampler uniform performs reasonably well.");
+var wtu = WebGLTestUtils;
+var canvas = document.createElement('canvas');
+canvas.width = 32;
+canvas.height = 32;
+var gl = wtu.create3DContext(canvas);
+if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+} else {
+ var program = wtu.setupTexturedQuad(gl);
+ var tex = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ var tex2 = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+
+ var loc = gl.getUniformLocation(program, "tex");
+
+ var RUNTIME = 2000;
+ var THRESHOLD = 0.8;
+ var baseStartTime = 0;
+ var baseFrameCount = 0;
+ var testStartTime = 0;
+ var testFrameCount = 0;
+
+ baseStartTime = Date.now();
+ function drawBaseline() {
+ for (var i = 0; i < 400; ++i) {
+ gl.uniform1i(loc, 0);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ gl.uniform1i(loc, 0);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+
+ ++baseFrameCount;
+
+ if (Date.now() - baseStartTime > RUNTIME) {
+ testStartTime = Date.now();
+ requestAnimationFrame(drawTest);
+ } else {
+ requestAnimationFrame(drawBaseline);
+ }
+ }
+
+ function drawTest() {
+ for (var i = 0; i < 400; ++i) {
+ gl.uniform1i(loc, 0);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ gl.uniform1i(loc, 1);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+
+ ++testFrameCount;
+
+ if (Date.now() - testStartTime > RUNTIME) {
+ var perfString = " - achieved " + testFrameCount + " frames in " + ((Date.now() - testStartTime) / 1000.0) +
+ " seconds (" + (testFrameCount / baseFrameCount).toFixed(2) + " times baseline performance)";
+ if (testFrameCount > baseFrameCount * THRESHOLD) {
+ testPassed("Texture switching did not significantly hurt performance" + perfString);
+ } else {
+ testFailed("Texture switching significantly hurt performance" + perfString);
+ }
+ console.log(testFrameCount);
+ finishTest();
+ } else {
+ requestAnimationFrame(drawTest);
+ }
+ }
+
+ requestAnimationFrame(drawBaseline);
+}
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html
new file mode 100644
index 0000000000..98a04c9050
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/triangle.html
@@ -0,0 +1,73 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Rendering 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50">
+There is supposed to be an example drawing here, but it's not important.
+</canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+
+<script>
+"use strict";
+function init()
+{
+ description(document.title);
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ // Test several locations
+ // First line should be all black
+ wtu.checkCanvasRect(gl, 0, 0, 50, 1, [0, 0, 0, 0]);
+
+ // Line 15 should be red for at least 10 red pixels starting 20 pixels in
+ wtu.checkCanvasRect(gl, 20, 15, 10, 1, [255, 0, 0, 255]);
+
+ // Last line should be all black
+ wtu.checkCanvasRect(gl, 0, 49, 50, 1, [0, 0, 0, 0]);
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html
new file mode 100644
index 0000000000..7b014e1d66
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/rendering/vertex-texture-fetch.html
@@ -0,0 +1,91 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Vertex Texture Fetch.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vs" type="text/something-not-javascript">
+attribute vec4 a_position;
+attribute vec2 a_texCoord;
+uniform sampler2D u_texture;
+varying vec4 color;
+void main() {
+ gl_Position = a_position;
+ color = texture2D(u_texture, a_texCoord);
+}
+</script>
+<script id="fs" type="text/something-not-javascript">
+precision mediump float;
+varying vec4 color;
+void main() {
+ gl_FragColor = color;
+}
+</script>
+<script>
+"use strict";
+description("checks that vertex texture fetch, if supported, operates correctly.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+if (!gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS)) {
+ testPassed("No vertex texture image units (vertex texture fetch not supported) -- this is legal");
+} else {
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array([
+ 255, 0, 0, 255,
+ 0, 255, 0, 255,
+ 0, 0, 255, 255,
+ 255, 255, 0, 255]));
+ 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);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after creating texture");
+
+ var program = wtu.setupProgram(gl, ["vs", "fs"], ["vPosition", "vTexCoord"]);
+ gl.uniform1i(gl.getUniformLocation(program, "u_texture"), 0);
+ gl.disable(gl.BLEND);
+ gl.disable(gl.DEPTH_TEST);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after initWebGL");
+ var bufferObjects = wtu.setupUnitQuad(gl, 0);
+ gl.disableVertexAttribArray(1);
+
+ gl.vertexAttrib2f(1, 0, 0);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "Should be red.");
+
+ gl.vertexAttrib2f(1, 1, 0);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "Should be green.");
+
+ gl.vertexAttrib2f(1, 0, 1);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 0, 255, 255], "Should be blue.");
+
+ gl.vertexAttrib2f(1, 1, 1);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 255, 0, 255], "Should be yellow.");
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after drawing");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt
new file mode 100644
index 0000000000..8af8f296a1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/00_test_list.txt
@@ -0,0 +1,9 @@
+--min-version 1.0.4 fb-attach-implicit-target-assignment.html
+gl-enable-enum-test.html
+--max-version 1.9.9 gl-enum-tests.html
+gl-get-calls.html
+gl-geterror.html
+--max-version 1.9.9 gl-getstring.html
+--min-version 1.0.4 gl-initial-state.html
+--max-version 1.9.9 gl-object-get-calls.html
+--min-version 1.0.3 state-uneffected-after-compositing.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/fb-attach-implicit-target-assignment.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/fb-attach-implicit-target-assignment.html
new file mode 100644
index 0000000000..1247c1f856
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/fb-attach-implicit-target-assignment.html
@@ -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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset='utf-8'>
+<title>WebGL gl calls Conformance Tests</title>
+<link rel='stylesheet' href='../../resources/js-test-style.css'/>
+<script src='../../js/js-test-pre.js'></script>
+<script src='../../js/webgl-test-utils.js'></script>
+</head>
+<body>
+<div id='description'></div>
+<div id='console'></div>
+<canvas id='canvas' width='2' height='2'> </canvas>
+<script>
+'use strict';
+description('Test implicit target assignment during FB attachment');
+
+const wtu = WebGLTestUtils;
+const gl = wtu.create3DContext('canvas');
+let fb, rb, tex;
+
+(() => {
+ if (!gl) {
+ testFailed('context does not exist');
+ return;
+ }
+
+ fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+
+ wtu.glErrorShouldBe(gl, 0, 'No errors');
+
+ // -
+
+ debug('');
+ debug('framebufferRenderbuffer');
+
+ rb = gl.createRenderbuffer();
+ shouldBe('gl.isRenderbuffer(rb)', 'false');
+ gl.bindRenderbuffer(gl.RENDERBUFFER, rb);
+ shouldBe('gl.isRenderbuffer(rb)', 'true');
+
+ rb = gl.createRenderbuffer();
+ shouldBe('gl.isRenderbuffer(rb)', 'false');
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, rb);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, 'framebufferRenderbuffer must be preceeded by some bindRenderbuffer');
+ shouldBe('gl.isRenderbuffer(rb)', 'false');
+
+ wtu.glErrorShouldBe(gl, 0, 'No errors');
+
+ // -
+
+ debug('');
+ debug('framebufferTexture2D');
+
+ tex = gl.createTexture();
+ shouldBe('gl.isTexture(tex)', 'false');
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ shouldBe('gl.isTexture(tex)', 'true');
+
+ tex = gl.createTexture();
+ shouldBe('gl.isTexture(tex)', 'false');
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1636524 :
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, 'framebufferTexture2D must be preceeded by some bindTexture');
+ shouldBe('gl.isTexture(tex)', 'false');
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ wtu.glErrorShouldBe(gl, 0, 'No errors after bindTexture');
+
+ tex = gl.createTexture();
+ shouldBe('gl.isTexture(tex)', 'false');
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X, tex, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, 'framebufferTexture2D must be preceeded by some bindTexture');
+ shouldBe('gl.isTexture(tex)', 'false');
+
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ wtu.glErrorShouldBe(gl, 0, 'No errors after bindTexture');
+})();
+
+debug('');
+var successfullyParsed = true;
+
+</script>
+<script src='../../js/js-test-post.js'></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html
new file mode 100644
index 0000000000..89efc94209
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enable-enum-test.html
@@ -0,0 +1,171 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL gl.ENABLE enums Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("This test ensures WebGL implementations allow OpenGL ES 2.0 features to be turned on but not non OpenGL ES 2.0 features.");
+
+var wtu = WebGLTestUtils;
+
+var invalidEnums = [
+ 'ALPHA_TEST',
+ 'AUTO_NORMAL',
+ 'CLIP_PLANE0',
+ 'CLIP_PLANE1',
+ 'COLOR_LOGIC_OP',
+ 'COLOR_MATERIAL',
+ 'COLOR_SUM',
+ 'COLOR_TABLE',
+ //'CONVOLUTION_1D',
+ //'CONVOLUTION_2D',
+ 'FOG',
+ 'HISTOGRAM',
+ 'INDEX_LOGIC_OP',
+ 'LIGHT0',
+ 'LIGHT1',
+ 'LIGHTING',
+ 'LINE_SMOOTH',
+ 'LINE_STIPPLE',
+ 'MAP1_COLOR_4',
+ 'MAP1_INDEX',
+ 'MAP1_NORMAL',
+ 'MAP1_TEXTURE_COORD_1',
+ 'MAP1_TEXTURE_COORD_2',
+ 'MAP1_TEXTURE_COORD_3',
+ 'MAP1_TEXTURE_COORD_4',
+ 'MAP1_VERTEX_3',
+ 'MAP1_VERTEX_4',
+ 'MAP2_COLOR_4',
+ 'MAP2_INDEX',
+ 'MAP2_NORMAL',
+ 'MAP2_TEXTURE_COORD_1',
+ 'MAP2_TEXTURE_COORD_2',
+ 'MAP2_TEXTURE_COORD_3',
+ 'MAP2_TEXTURE_COORD_4',
+ 'MAP2_VERTEX_3',
+ 'MAP2_VERTEX_4',
+ 'MINMAX',
+ 'MULTISAMPLE',
+ 'NORMALIZE',
+ 'POINT_SMOOTH',
+ 'POINT_SPRITE',
+ 'POLYGON_OFFSET_LINE',
+ 'POLYGON_OFFSET_POINT',
+ 'POLYGON_SMOOTH',
+ 'POLYGON_STIPPLE',
+ 'POST_COLOR_MATRIX_COLOR_TABLE',
+ 'POST_CONVOLUTION_COLOR_TABLE',
+ 'RESCALE_NORMAL',
+ 'SAMPLE_ALPHA_TO_ONE',
+ //'SEPARABLE_2D',
+ 'TEXTURE_1D',
+ 'TEXTURE_2D',
+ 'TEXTURE_3D',
+ 'TEXTURE_CUBE_MAP',
+ 'TEXTURE_GEN_Q',
+ 'TEXTURE_GEN_R',
+ 'TEXTURE_GEN_S',
+ 'TEXTURE_GEN_T',
+ 'VERTEX_PROGRAM_POINT_SIZE',
+ 'VERTEX_PROGRAM_TWO_SIDE'
+];
+var validEnums = [
+ 'BLEND',
+ 'CULL_FACE',
+ 'DEPTH_TEST',
+ 'DITHER',
+ 'POLYGON_OFFSET_FILL',
+ 'SAMPLE_ALPHA_TO_COVERAGE',
+ 'SAMPLE_COVERAGE',
+ 'SCISSOR_TEST',
+ 'STENCIL_TEST'
+];
+
+var gl;
+
+function runNegativeTests() {
+ debug("");
+ debug("Running negative tests");
+
+ gl = wtu.create3DContext();
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ testPassed("context exists");
+
+ for (var ii = 0; ii < invalidEnums.length; ++ii) {
+ var name = invalidEnums[ii];
+ gl.enable(desktopGL[name]);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM,
+ "gl.enable must set INVALID_ENUM when passed GL_" + name );
+ }
+}
+
+function runPositiveTestsWithParameters(params) {
+ debug("");
+ debug("Running positive tests with parameters: " + JSON.stringify(params));
+
+ // Pass null for the canvas, to make sure we create a new context each time.
+ var newgl = wtu.create3DContext(null, params);
+ if (gl == newgl) {
+ testFailed("got an old context");
+ return;
+ }
+ gl = newgl;
+ if (!gl) {
+ testFailed("context does not exist");
+ return;
+ }
+ testPassed("context exists");
+
+ debug("Checking gl.ENABLE enums.");
+
+ for (var ii = 0; ii < validEnums.length; ++ii) {
+ var name = validEnums[ii];
+ gl.enable(gl[name]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.enable must succeed when passed gl." + name );
+ shouldBe('gl.isEnabled(gl.' + name + ')', 'true');
+ shouldBe('gl.getParameter(gl.' + name + ')', 'true');
+ gl.disable(gl[name]);
+ shouldBe('gl.isEnabled(gl.' + name + ')', 'false');
+ shouldBe('gl.getParameter(gl.' + name + ')', 'false');
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.isEnabled and gl.GetParameter must not set errors when passed GL_" + name );
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+runNegativeTests();
+runPositiveTestsWithParameters({alpha: true, antialias: true, stencil: true, depth: true});
+runPositiveTestsWithParameters({alpha: false, antialias: true, stencil: true, depth: true});
+runPositiveTestsWithParameters({alpha: true, antialias: false, stencil: true, depth: true});
+runPositiveTestsWithParameters({alpha: true, antialias: true, stencil: false, depth: true});
+runPositiveTestsWithParameters({alpha: true, antialias: true, stencil: true, depth: false});
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html
new file mode 100644
index 0000000000..9c3d244d79
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-enum-tests.html
@@ -0,0 +1,29 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL gl enums Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/test-eval.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../js/tests/gl-enum-tests.js"></script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html
new file mode 100644
index 0000000000..a1a27d8e6c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-get-calls.html
@@ -0,0 +1,198 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL gl calls Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("This test ensures basic functionality of the underlying graphics library");
+
+debug("");
+debug("Canvas.getContext");
+
+var minimumRequiredStencilMask = 0;
+var wtu = WebGLTestUtils;
+var context = wtu.create3DContext("canvas");
+if (!context)
+ testFailed("context does not exist");
+else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Context contains getError");
+ if ("getError" in context)
+ testPassed("context contains getError");
+ else
+ testFailed("context does not contains getError");
+
+ debug("");
+ debug("Check default values");
+ shouldBe('context.getParameter(context.ACTIVE_TEXTURE)', 'context.TEXTURE0');
+ shouldBe('(context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[0] <= 1) && (context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[0] > 0) && (context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)[1] >= 1)', 'true');
+ shouldBe('(context.getParameter(context.ALIASED_POINT_SIZE_RANGE)[0] <= 1) && (context.getParameter(context.ALIASED_POINT_SIZE_RANGE)[0] > 0) && (context.getParameter(context.ALIASED_POINT_SIZE_RANGE)[1] >= 1)', 'true');
+ shouldBeType('context.getParameter(context.ALIASED_LINE_WIDTH_RANGE)', 'Float32Array');
+ shouldBeType('context.getParameter(context.ALIASED_POINT_SIZE_RANGE)', 'Float32Array');
+ shouldBe('context.getParameter(context.ARRAY_BUFFER_BINDING)', 'null');
+ shouldBe('context.getParameter(context.BLEND)', 'false');
+ shouldBe('context.getParameter(context.BLEND_COLOR)', '[0, 0, 0, 0]');
+ shouldBeType('context.getParameter(context.BLEND_COLOR)', 'Float32Array');
+ shouldBe('context.getParameter(context.BLEND_DST_ALPHA)', '0');
+ shouldBe('context.getParameter(context.BLEND_DST_RGB)', '0');
+ shouldBe('context.getParameter(context.BLEND_EQUATION_ALPHA)', 'context.FUNC_ADD');
+ shouldBe('context.getParameter(context.BLEND_EQUATION_RGB)', 'context.FUNC_ADD');
+ shouldBe('context.getParameter(context.BLEND_SRC_ALPHA)', '1');
+ shouldBe('context.getParameter(context.BLEND_SRC_RGB)', '1');
+ shouldBe('context.getParameter(context.COLOR_CLEAR_VALUE)', '[0, 0, 0, 0]');
+ shouldBeType('context.getParameter(context.COLOR_CLEAR_VALUE)', 'Float32Array');
+ shouldBe('context.getParameter(context.COLOR_WRITEMASK)', '[true, true, true, true]');
+ shouldBeType('context.getParameter(context.COMPRESSED_TEXTURE_FORMATS)', 'Uint32Array');
+ shouldBe('context.getParameter(context.CULL_FACE)', 'false');
+ shouldBe('context.getParameter(context.CULL_FACE_MODE)', 'context.BACK');
+ shouldBe('context.getParameter(context.CURRENT_PROGRAM)', 'null');
+ shouldBe('context.getParameter(context.DEPTH_CLEAR_VALUE)', '1');
+ shouldBe('context.getParameter(context.DEPTH_FUNC)', 'context.LESS');
+ shouldBe('context.getParameter(context.DEPTH_RANGE)', '[0, 1]');
+ shouldBeType('context.getParameter(context.DEPTH_RANGE)', 'Float32Array');
+ shouldBe('context.getParameter(context.DEPTH_TEST)', 'false');
+ shouldBe('context.getParameter(context.DEPTH_WRITEMASK)', 'true');
+ shouldBe('context.getParameter(context.DITHER)', 'true');
+ shouldBe('context.getParameter(context.ELEMENT_ARRAY_BUFFER_BINDING)', 'null');
+ shouldBe('context.getParameter(context.FRONT_FACE)', 'context.CCW');
+ shouldBe('context.getParameter(context.GENERATE_MIPMAP_HINT)', 'context.DONT_CARE');
+ shouldBe('context.getParameter(context.LINE_WIDTH)', '1');
+ shouldBe('context.getParameter(context.PACK_ALIGNMENT)', '4');
+ shouldBe('context.getParameter(context.POLYGON_OFFSET_FACTOR)', '0');
+ shouldBe('context.getParameter(context.POLYGON_OFFSET_FILL)', 'false');
+ shouldBe('context.getParameter(context.POLYGON_OFFSET_UNITS)', '0');
+ shouldBe('context.getParameter(context.RENDERBUFFER_BINDING)', 'null');
+ shouldBe('context.getParameter(context.SAMPLE_COVERAGE_INVERT)', 'false');
+ shouldBe('context.getParameter(context.SAMPLE_COVERAGE_VALUE)', '1');
+ shouldBe('context.getParameter(context.SCISSOR_BOX)[0]', '0');
+ shouldBe('context.getParameter(context.SCISSOR_BOX)[1]', '0');
+ shouldBe('context.getParameter(context.SCISSOR_BOX)[2]', 'context.getParameter(context.VIEWPORT)[2]');
+ shouldBe('context.getParameter(context.SCISSOR_BOX)[3]', 'context.getParameter(context.VIEWPORT)[3]');
+ shouldBeType('context.getParameter(context.SCISSOR_BOX)', Int32Array);
+ shouldBe('context.getParameter(context.SCISSOR_TEST)', 'false');
+ shouldBe('context.getParameter(context.STENCIL_BACK_FAIL)', 'context.KEEP');
+ shouldBe('context.getParameter(context.STENCIL_BACK_FUNC)', 'context.ALWAYS');
+ shouldBe('context.getParameter(context.STENCIL_BACK_PASS_DEPTH_FAIL)', 'context.KEEP');
+ shouldBe('context.getParameter(context.STENCIL_BACK_PASS_DEPTH_PASS)', 'context.KEEP');
+ shouldBe('context.getParameter(context.STENCIL_BACK_REF)', '0');
+
+ // WebGL 1.0.2 - 5.14.3 types / ES 2.0.25 - 6.2 State tables - 6.18 page 152
+ shouldBeType('context.getParameter(context.SUBPIXEL_BITS)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.SUBPIXEL_BITS)', '4');
+
+ shouldBeType('context.getParameter(context.SAMPLE_BUFFERS)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.SAMPLE_BUFFERS)', '0');
+
+ shouldBeType('context.getParameter(context.SAMPLES)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.SAMPLES)', '0');
+
+ shouldBeType('context.getParameter(context.DEPTH_BITS)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.DEPTH_BITS)', '0');
+ shouldBeType('context.getParameter(context.RED_BITS)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.RED_BITS)', '0');
+ shouldBeType('context.getParameter(context.GREEN_BITS)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.GREEN_BITS)', '0');
+ shouldBeType('context.getParameter(context.BLUE_BITS)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.BLUE_BITS)', '0');
+ shouldBeType('context.getParameter(context.ALPHA_BITS)', 'Number');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.ALPHA_BITS)', '0');
+ shouldBeType('context.getParameter(context.STENCIL_BITS)', 'Number');
+
+ var stencilBits = context.getParameter(context.STENCIL_BITS);
+ minimumRequiredStencilMask = (1 << stencilBits) - 1;
+
+ shouldBe('context.getParameter(context.STENCIL_BACK_VALUE_MASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');
+ shouldBe('context.getParameter(context.STENCIL_BACK_WRITEMASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');
+
+ // If EXT_packed_depth_stencil is supported, STENCIL_BITS > 0; otherwise, STENCIL_BITS == 0.
+ shouldBe('context.getParameter(context.STENCIL_BITS) >= 0', 'true');
+ shouldBe('context.getParameter(context.STENCIL_CLEAR_VALUE)', '0');
+ shouldBe('context.getParameter(context.STENCIL_FAIL)', 'context.KEEP');
+ shouldBe('context.getParameter(context.STENCIL_FUNC)', 'context.ALWAYS');
+ shouldBe('context.getParameter(context.STENCIL_PASS_DEPTH_FAIL)', 'context.KEEP');
+ shouldBe('context.getParameter(context.STENCIL_PASS_DEPTH_PASS)', 'context.KEEP');
+ shouldBe('context.getParameter(context.STENCIL_REF)', '0');
+ shouldBe('context.getParameter(context.STENCIL_TEST)', 'false');
+
+ shouldBe('context.getParameter(context.STENCIL_VALUE_MASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');
+ shouldBe('context.getParameter(context.STENCIL_WRITEMASK) & minimumRequiredStencilMask', 'minimumRequiredStencilMask');
+
+ shouldBe('context.getParameter(context.TEXTURE_BINDING_2D)', 'null');
+ shouldBe('context.getParameter(context.TEXTURE_BINDING_CUBE_MAP)', 'null');
+ shouldBe('context.getParameter(context.UNPACK_ALIGNMENT)', '4');
+ shouldBe('context.getParameter(context.UNPACK_FLIP_Y_WEBGL)', 'false');
+ shouldBe('context.getParameter(context.UNPACK_PREMULTIPLY_ALPHA_WEBGL)', 'false');
+ shouldBe('context.getParameter(context.VIEWPORT)', '[0, 0, 2, 2]');
+ shouldBeType('context.getParameter(context.VIEWPORT)', 'Int32Array');
+
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_COMBINED_TEXTURE_IMAGE_UNITS)', '8');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_CUBE_MAP_TEXTURE_SIZE)', '16');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_FRAGMENT_UNIFORM_VECTORS)', '16');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_RENDERBUFFER_SIZE)', '1');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_TEXTURE_IMAGE_UNITS)', '8');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_TEXTURE_SIZE)', '64');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_VARYING_VECTORS)', '8');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_VERTEX_ATTRIBS)', '8');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_VERTEX_TEXTURE_IMAGE_UNITS)', '0');
+ shouldBeGreaterThanOrEqual('context.getParameter(context.MAX_VERTEX_UNIFORM_VECTORS)', '128');
+ // Note: This requirement should be removed from the spec IMO. Many impelementations
+ // will be based on FBOs and FBOs might have a restriction smaller than the current screen size.
+ // especially if there are multiple screens.
+ shouldBeTrue('context.getParameter(context.MAX_VIEWPORT_DIMS)[0] >= window.screen.width');
+ shouldBeTrue('context.getParameter(context.MAX_VIEWPORT_DIMS)[1] >= window.screen.height');
+ shouldBeType('context.getParameter(context.MAX_VIEWPORT_DIMS)', 'Int32Array');
+
+ debug("");
+ debug("check texture values");
+ var maxTextures = context.getParameter(context.MAX_TEXTURE_IMAGE_UNITS);
+ for (var ii = 0; ii < maxTextures; ++ii) {
+ context.activeTexture(context.TEXTURE0 + ii);
+ debug("check texture unit: " + ii);
+ shouldBe('context.getParameter(context.TEXTURE_BINDING_2D)', 'null');
+ shouldBe('context.getParameter(context.TEXTURE_BINDING_CUBE_MAP)', 'null');
+ }
+
+ debug("");
+ debug("check attrib values");
+ var maxAttribs = context.getParameter(context.MAX_VERTEX_ATTRIBS);
+ for (var ii = 0; ii < maxAttribs; ++ii) {
+ debug("check attrib: " + ii);
+ shouldBe('context.getVertexAttrib(ii, context.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING)', 'null');
+ shouldBe('context.getVertexAttrib(ii, context.VERTEX_ATTRIB_ARRAY_ENABLED)', 'false');
+ shouldBe('context.getVertexAttrib(ii, context.VERTEX_ATTRIB_ARRAY_SIZE)', '4');
+ shouldBe('context.getVertexAttrib(ii, context.VERTEX_ATTRIB_ARRAY_STRIDE)', '0');
+ shouldBe('context.getVertexAttrib(ii, context.VERTEX_ATTRIB_ARRAY_TYPE)', 'context.FLOAT');
+ shouldBe('context.getVertexAttrib(ii, context.VERTEX_ATTRIB_ARRAY_NORMALIZED)', 'false');
+ shouldBe('context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB)', '[0, 0, 0, 1]');
+ shouldBeType('context.getVertexAttrib(ii, context.CURRENT_VERTEX_ATTRIB)', 'Float32Array');
+ shouldBe('context.getVertexAttribOffset(ii, context.VERTEX_ATTRIB_ARRAY_POINTER)', '0');
+ }
+
+ shouldBe('context.getError()', 'context.NO_ERROR');
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html
new file mode 100644
index 0000000000..ad5c18e267
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-geterror.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL get error conformance test.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/desktop-gl-constants.js"></script>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 256px; height: 48px;"></canvas>
+<div id="description"></div><div id="console"></div>
+<script>
+"use strict";
+description("Test getError.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+
+gl.enable(desktopGL.ALPHA_TEST);
+wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "should generate INVALID_ENUM");
+gl.viewport(-1, -1, -1, -1);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "should generate INVALID_VALUE");
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "should generate INVALID_OPERATION");
+
+// Generate 2 errors of each type for 6 total possible errors.
+// The OpenGL ES 2.0 spec section 2.5 says the implementation is allowed to
+// either return the first error or many errors in an unspecied order.
+gl.viewport(-1, -1, -1, -1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.enable(desktopGL.ALPHA_TEST);
+gl.viewport(-1, -1, -1, -1);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+// Note: This error is specifically last because we know it will be synthasized
+// by WebGL at least when implemented on top of Desktop OpenGL
+gl.enable(desktopGL.ALPHA_TEST);
+
+var err1 = gl.getError();
+var err2 = gl.getError();
+var err3 = gl.getError();
+var err4 = gl.getError();
+var err5 = gl.getError();
+var err6 = gl.getError();
+
+debug("");
+if (err2 == gl.NO_ERROR) {
+ debug("This WebGL implementation looks like it uses the 'first error' method");
+ debug("There should be 1 error, the first one generated");
+ shouldBeTrue('err1 == gl.INVALID_VALUE && err2 == gl.NO_ERROR && err3 == gl.NO_ERROR');
+} else {
+ debug("This WebGL implementation looks like it uses the many error method");
+ debug("Check is that at least one of the errors is the first error");
+ shouldBeTrue('err1 == gl.INVALID_VALUE || ' +
+ 'err2 == gl.INVALID_VALUE || ' +
+ 'err3 == gl.INVALID_VALUE || ' +
+ 'err4 == gl.INVALID_VALUE || ' +
+ 'err5 == gl.INVALID_VALUE || ' +
+ 'err6 == gl.INVALID_VALUE');
+ shouldBeTrue('gl.getError() == gl.NO_ERROR');
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html
new file mode 100644
index 0000000000..3594cc678e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-getstring.html
@@ -0,0 +1,60 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL gl.getParameter Strings Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("This test checks getParameter returns strings in the correct format");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ checkPrefix("WebGL 1.0", "VERSION");
+ checkPrefix("WebGL GLSL ES 1.0", "SHADING_LANGUAGE_VERSION");
+ shouldBeNonNull("gl.getParameter(gl.VENDOR)");
+ shouldBeNonNull("gl.getParameter(gl.RENDERER)");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+}
+
+function checkPrefix(expected, enum_val) {
+ var s = gl.getParameter(gl[enum_val]);
+ if (s != null &&
+ s.length >= expected.length &&
+ s.substring(0, expected.length) == expected) {
+ testPassed("getParameter(gl." + enum_val + ") correctly started with " + expected);
+ } else {
+ testFailed("getParameter(gl." + enum_val + ") did not start with " + expected);
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html
new file mode 100644
index 0000000000..024eaa109b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-initial-state.html
@@ -0,0 +1,58 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL gl.getParameter initial values Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description("This test checks the initial value of the OpenGL state");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ checkParameterInitialValue("ONE", "BLEND_SRC_RGB");
+ checkParameterInitialValue("ONE", "BLEND_SRC_ALPHA");
+ checkParameterInitialValue("ZERO", "BLEND_DST_RGB");
+ checkParameterInitialValue("ZERO", "BLEND_DST_ALPHA");
+ shouldBe("gl.getError()", "gl.NO_ERROR");
+}
+
+function checkParameterInitialValue(expected, enum_val) {
+ var s = gl.getParameter(gl[enum_val]);
+ if (s === gl[expected]) {
+ testPassed("getParameter(gl." + enum_val + ") returned " + expected + " which is " + gl[expected]);
+ } else {
+ testFailed("getParameter(gl." + enum_val + ") returned " + s + " expected: " + expected + " which is " + gl[expected]);
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html
new file mode 100644
index 0000000000..7aa2cedf99
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/gl-object-get-calls.html
@@ -0,0 +1,24 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../js/tests/gl-object-get-calls.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html b/dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html
new file mode 100644
index 0000000000..f428156c17
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/state/state-uneffected-after-compositing.html
@@ -0,0 +1,86 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL: Check that state is not lost by compositing</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="testbed" width="16" height="16" style="width:50px; height:50px"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+var wtu = WebGLTestUtils;
+
+function runTest()
+{
+ var gl = wtu.create3DContext('testbed', { antialias: false });
+ if (!gl) {
+ testFailed('could not create context');
+ return;
+ }
+
+ var program = wtu.setupTexturedQuad(gl);
+ var tex = gl.createTexture();
+ var fb = gl.createFramebuffer();
+
+ var step1 = function() {
+ wtu.fillTexture(gl, tex, 1, 1, [0, 255, 0, 255]);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "drawing with texture should be green");
+ };
+
+ var step2 = function() {
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "drawing with texture after composite without rebinding should be green");
+
+ // Clear background to red
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Bind framebuffer with green texture.
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 255, 0, 255], "reading from fbo with attached texture should be green");
+ };
+
+ var step3 = function() {
+ // Should still have fb bound and reading should be green
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 255, 0, 255], "reading from fbo after composite without rebinding should be green");
+ };
+
+ var steps = [
+ step1,
+ step2,
+ step3,
+ ];
+
+ var stepIndex = 0;
+ var runNextStep = function() {
+ steps[stepIndex++]();
+ if (stepIndex == steps.length) {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ finishTest();
+ return;
+ }
+ wtu.waitForComposite(runNextStep);
+ };
+ runNextStep();
+}
+
+runTest();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt
new file mode 100644
index 0000000000..c6041ff82f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/00_test_list.txt
@@ -0,0 +1,14 @@
+misc/00_test_list.txt
+canvas/00_test_list.txt
+--min-version 1.0.4 canvas_sub_rectangle/00_test_list.txt
+image/00_test_list.txt
+image_data/00_test_list.txt
+--min-version 1.0.4 svg_image/00_test_list.txt
+video/00_test_list.txt
+webgl_canvas/00_test_list.txt
+image_bitmap_from_image_data/00_test_list.txt
+image_bitmap_from_image/00_test_list.txt
+image_bitmap_from_video/00_test_list.txt
+image_bitmap_from_canvas/00_test_list.txt
+image_bitmap_from_blob/00_test_list.txt
+image_bitmap_from_image_bitmap/00_test_list.txt
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..4d9e90a89a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..555ec9f7bd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..3e2dd533f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..c1048aba4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..55177f4657
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..3db61ef492
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..f6dafa9a51
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..054ad8f7d3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..42b25dbe45
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..443bbeee85
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..03d6aff9b0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..c3d2dcb1e8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..e841cd8b3b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..b41edb8f31
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..0b33104d30
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..fe394c6ae3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/canvas_sub_rectangle/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-canvas-sub-rectangle.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..99a6d0aca0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..044c4d2334
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..a0eb04e7f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..af6f0ffbf3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..a5f6adbd7f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..4e9fcfb323
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..11033be46d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..57b5a3075b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..3a0f359d58
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..63137f0c12
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..28b68bb2c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..c8712cc226
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..c7f5406d8b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..3a94793561
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..011716760c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..84ea95ec34
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_blob/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-blob.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..60bc8c96ca
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..d69fbc1ff3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..c141ecd96e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..ad2f120c9f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..b89d10cc62
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..e6d6e105ae
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..3c9564a31c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..4aae144b39
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..9d371e7a7d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..ad59d05e7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..d7a9ce4f9b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..d61f6ebf8e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..a3eeee8a9d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..f818adaa8a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..2b78f918e0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..f314b58319
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..14f6624c93
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..0802d11106
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..68ec518abb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..35b1e3bb85
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..6c55d536c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..69cbc37d95
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..eae074f55f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..c0702275b2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_bitmap/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-bitmap.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..aead08998d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..af81a29c07
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..c5b1d52ecd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..66ef9b8475
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..0bca358b3e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..91dc8e25c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..bc519e2e6e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..2359b91b59
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-image-data.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..299282586d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..7471323b4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..b700257b99
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..065dd77bc1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..6f1125132a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..e58c1612dc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..e49c039885
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..b5eeeb3b0f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_bitmap_from_video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-bitmap-from-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..7b1b1ebd6a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..88ceac1072
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..c953c8be91
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..4650594945
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..49744f65f8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..95bd9686c9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..9d80cf6927
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..b7a529f4ec
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/image_data/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,39 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-image-data.js"></script>
+</head>
+<body>
+<canvas id="texcanvas" width="2" height="2"></canvas>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt
new file mode 100644
index 0000000000..c86c269d56
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/00_test_list.txt
@@ -0,0 +1,58 @@
+--min-version 1.0.4 canvas-teximage-after-multiple-drawimages.html
+--max-version 1.9.9 compressed-tex-image.html
+copy-tex-image-and-sub-image-2d.html
+--min-version 1.0.2 copy-tex-image-2d-formats.html
+--min-version 1.0.4 copy-tex-image-crash.html
+--min-version 1.0.4 copytexsubimage2d-large-partial-copy-corruption.html
+--min-version 1.0.4 copytexsubimage2d-subrects.html
+--min-version 1.0.4 cube-incomplete-fbo.html
+--min-version 1.0.4 cube-map-uploads-out-of-order.html
+--min-version 1.0.3 default-texture.html
+--min-version 1.0.4 exif-orientation.html
+--min-version 1.0.4 format-filterable-renderable.html
+--min-version 1.0.2 --max-version 1.9.9 gl-get-tex-parameter.html
+gl-pixelstorei.html
+gl-teximage.html
+--min-version 1.0.2 mipmap-fbo.html
+origin-clean-conformance.html
+--min-version 1.0.4 origin-clean-conformance-offscreencanvas.html
+tex-image-and-sub-image-2d-with-array-buffer-view.html
+tex-image-and-uniform-binding-bugs.html
+--min-version 1.0.3 tex-image-canvas-corruption.html
+--min-version 1.0.2 tex-image-webgl.html
+tex-image-with-format-and-type.html
+tex-image-with-invalid-data.html
+--max-version 1.9.9 tex-input-validation.html
+tex-sub-image-2d-bad-args.html
+tex-sub-image-2d.html
+--min-version 1.0.4 tex-video-using-tex-unit-non-zero.html
+texparameter-test.html
+texture-active-bind-2.html
+texture-active-bind.html
+--min-version 1.0.2 texture-attachment-formats.html
+--min-version 1.0.2 texture-clear.html
+texture-complete.html
+--min-version 1.0.4 texture-copying-and-deletion.html
+--min-version 1.0.3 texture-copying-feedback-loops.html
+--min-version 1.0.4 texture-corner-case-videos.html
+--min-version 1.0.4 texture-cube-as-fbo-attachment.html
+--min-version 1.0.3 texture-draw-with-2d-and-cube.html
+--min-version 1.0.3 --max-version 1.9.9 texture-fakeblack.html
+--min-version 1.0.2 --max-version 1.9.9 texture-formats-test.html
+--min-version 1.0.2 texture-hd-dpi.html
+texture-mips.html
+--max-version 1.9.9 texture-npot-video.html
+--max-version 1.9.9 texture-npot.html
+texture-size.html
+texture-size-cube-maps.html
+--min-version 1.0.2 texture-size-limit.html
+--min-version 1.0.4 texture-srgb-upload.html
+--min-version 1.0.2 texture-sub-image-cube-maps.html
+texture-transparent-pixels-initialized.html
+--min-version 1.0.2 texture-upload-cube-maps.html
+--min-version 1.0.3 texture-upload-size.html
+--min-version 1.0.4 texture-video-transparent.html
+--min-version 1.0.4 texture-with-flip-y-and-premultiply-alpha.html
+--min-version 1.0.4 upload-from-srcset-with-empty-data.html
+--min-version 1.0.4 video-rotation.html
+--min-version 1.0.4 png-image-types.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/canvas-teximage-after-multiple-drawimages.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/canvas-teximage-after-multiple-drawimages.html
new file mode 100644
index 0000000000..0c5d45b7b0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/canvas-teximage-after-multiple-drawimages.html
@@ -0,0 +1,100 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>TexImage2D of 2D Canvas after multiple drawImages</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script>
+"use strict";
+const wtu = WebGLTestUtils;
+
+const sz = 512;
+let greenImage = null;
+
+function loadImageAndStart(startFunc) {
+ let c = document.createElement('canvas');
+ c.width = sz;
+ c.height = sz;
+ let ctx = c.getContext('2d');
+ ctx.fillStyle = 'rgb(0,255,0)';
+ ctx.fillRect(0, 0, sz, sz);
+ greenImage = wtu.makeImageFromCanvas(c, startFunc);
+}
+
+function runTest() {
+ description();
+ debug('Regression test for <a href="http://crbug.com/878545">http://crbug.com/878545</a>');
+ // Mimics the image-to-texture upload path from the old JavaScript
+ // port of O3D, salvaged at https://github.com/petersont/o3d .
+
+ // Create a canvas and draw the entire image into it.
+ let bigCanvas = document.createElement('canvas');
+ bigCanvas.width = greenImage.naturalWidth;
+ bigCanvas.height = greenImage.naturalHeight;
+ let bc = bigCanvas.getContext('2d');
+ bc.drawImage(greenImage, 0, 0, bigCanvas.width, bigCanvas.height);
+ // Create a temp canvas to flip vertically.
+ let tempCanvas = document.createElement('canvas');
+ tempCanvas.width = bigCanvas.width;
+ tempCanvas.height = bigCanvas.height;
+ let tc = tempCanvas.getContext('2d');
+ tc.translate(0, tempCanvas.height);
+ tc.scale(1, -1);
+ tc.drawImage(bigCanvas, 0, 0, tempCanvas.width, tempCanvas.height);
+ // Set up to draw via WebGL.
+ let c3d = document.getElementById('canvas');
+ let gl = wtu.create3DContext(c3d);
+ let prog = wtu.setupTexturedQuad(gl);
+ gl.uniform1i(gl.getUniformLocation(prog, 'tex'), 0);
+ let tex = gl.createTexture();
+ // Iterate through the large canvas, drawing pieces of it to a
+ // scratch canvas.
+ let scratchCanvas = document.createElement('canvas');
+ const width = tempCanvas.width / 2;
+ const height = tempCanvas.height / 2;
+ let bb = new Uint8Array(4 * c3d.width * c3d.height);
+ for (let jj = 0; jj < 2; ++jj) {
+ for (let ii = 0; ii < 2; ++ii) {
+ // Prepare texture.
+ scratchCanvas.width = width;
+ scratchCanvas.height = height;
+ let ctx = scratchCanvas.getContext('2d');
+ ctx.save();
+ ctx.translate(-(ii * width), -(jj * height));
+ ctx.scale(1.0, 1.0);
+ ctx.drawImage(tempCanvas, 0, 0, tempCanvas.width, tempCanvas.height);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE,
+ scratchCanvas);
+ ctx.restore();
+ gl.generateMipmap(gl.TEXTURE_2D);
+ // Draw and check that rendering occurred properly.
+ gl.uniform1i(gl.getUniformLocation(prog, 'tex'), 0);
+ wtu.drawUnitQuad(gl);
+ let tolerance = 2;
+ wtu.checkCanvasRect(gl, 1, 1, c3d.width - 2, c3d.height - 2,
+ [ 0, 255, 0, 255 ],
+ "should be green",
+ tolerance);
+
+ }
+ }
+
+ finishTest();
+}
+</script>
+</head>
+<body onload="loadImageAndStart(runTest)">
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="40" height="40"></canvas>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html
new file mode 100644
index 0000000000..d019a65254
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/compressed-tex-image.html
@@ -0,0 +1,24 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+const contextVersion = 1;
+</script>
+<script src="../../../js/tests/compressed-tex-image.js"></script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html
new file mode 100644
index 0000000000..fd44f9cc73
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-2d-formats.html
@@ -0,0 +1,173 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<title>Verify copyTexImage2D follows format restictions</title>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas" width="2" height="2"></canvas>
+<canvas id="canvasNoAlpha" width="2" height="2"></canvas>
+<div id="console"></div>
+<script>
+"use strict";
+
+function getChannelsFromFormat(format) {
+ switch (gl[format]) {
+ case gl.ALPHA:
+ return 0x0001;
+ case gl.LUMINANCE:
+ case gl.RGB:
+ return 0x1110;
+ case gl.LUMINANCE_ALPHA:
+ case gl.RGBA:
+ return 0x1111;
+ default:
+ return 0;
+ }
+}
+
+var formats = [
+ 'ALPHA',
+ 'LUMINANCE',
+ 'LUMINANCE_ALPHA',
+ 'RGB',
+ 'RGBA'
+];
+
+var isRenderable = {
+ 'ALPHA': false,
+ 'LUMINANCE': false,
+ 'LUMINANCE_ALPHA': false,
+ 'RGB': true,
+ 'RGBA': true
+};
+
+var gl = null;
+var wtu = WebGLTestUtils;
+
+description();
+
+var canvas = document.getElementById("canvas");
+var canvasNoAlpha = document.getElementById("canvasNoAlpha");
+var gl = wtu.create3DContext(canvas, {alpha:true});
+var glNoAlpha = wtu.create3DContext(canvasNoAlpha, {alpha:false});
+
+debug("test with an RGBA backbuffer");
+var program = wtu.setupTexturedQuad(gl);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "During Initialization");
+testFormats('RGBA');
+
+testBackbufferFormats();
+
+debug("test with an RGB backbuffer");
+var gl = glNoAlpha;
+var program = wtu.setupTexturedQuad(gl);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "During Initialization");
+testFormats('RGB');
+
+function testBackbufferFormats() {
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ for (var ii = 0; ii < formats.length; ++ii) {
+ var backFormat = formats[ii];
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl[backFormat], 2, 2, 0, gl[backFormat], gl.UNSIGNED_BYTE, null);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+ var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+
+ debug('');
+ if (status == gl.FRAMEBUFFER_COMPLETE) {
+ if (!isRenderable[backFormat]) {
+ testFailed('Creating framebuffer from ' + backFormat + ' texture succeeded even though it is not a renderable format');
+ } else {
+ debug('test with ' + backFormat + ' fbo');
+ testFormats(backFormat);
+ }
+ } else {
+ debug(backFormat + ' not supported as a renderbuffer attachment');
+ }
+ }
+}
+
+function testFormats(backFormat) {
+ for (var ii = 0; ii < formats.length; ++ii) {
+ testCopyTexImage2D(backFormat, formats[ii]);
+ }
+}
+
+function toChannels(value) {
+ return ((value & 0x1000) ? 'R' : '_') +
+ ((value & 0x0100) ? 'G' : '_') +
+ ((value & 0x0010) ? 'B' : '_') +
+ ((value & 0x0001) ? 'A' : '_');
+}
+
+function testCopyTexImage2D(backFormat, texFormat) {
+ var need = getChannelsFromFormat(texFormat);
+ var have = getChannelsFromFormat(backFormat);
+ var shouldPass = (need & have) == need;
+
+ //debug("need: " + toChannels(need));
+ //debug("have: " + toChannels(have));
+ //debug("both: " + toChannels(have & need));
+
+ // clear backbuffer
+ gl.clearColor(0.25, 1, 0.75, 0.5);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ var texture = gl.createTexture();
+ // Bind the texture to texture unit 0
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl[texFormat], 0, 0, 2, 2, 0);
+ if (!shouldPass) {
+ wtu.glErrorShouldBe(
+ gl, gl.INVALID_OPERATION,
+ "should not be able to copyTexImage2D " + texFormat + " from " + backFormat);
+ return;
+ }
+
+ wtu.glErrorShouldBe(
+ gl, gl.NO_ERROR,
+ "should be able to copyTexImage2D " + texFormat + " from " + backFormat);
+
+ // Draw
+ wtu.clearAndDrawUnitQuad(gl);
+
+ var expectedColors = {
+ 'ALPHA': [0, 0, 0, 127],
+ 'LUMINANCE': [64, 64, 64, 255],
+ 'LUMINANCE_ALPHA': [64, 64, 64, 127],
+ 'RGB': [64, 255, 191, 255],
+ 'RGBA': [64, 255, 191, 127]
+ };
+
+ var color = expectedColors[texFormat];
+
+ wtu.checkCanvas(gl, color, "should be " + color, 16);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+}
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html
new file mode 100644
index 0000000000..a751582472
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-and-sub-image-2d.html
@@ -0,0 +1,137 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script>
+"use strict";
+var successfullyParsed = false;
+
+function init()
+{
+ description('Verify copyTexImage2D and copyTexSubImage2D');
+
+ runTest();
+}
+
+var gl = null;
+var wtu = WebGLTestUtils;
+
+function runTestIteration(antialias)
+{
+ var canvas = document.getElementById(
+ antialias ? "antialiasOn" : "antialiasOff");
+ var attribs = antialias ? { antialias: true } : { antialias: false };
+ gl = wtu.create3DContext(canvas, attribs);
+ var program = wtu.setupTexturedQuad(gl);
+ var textureLoc = gl.getUniformLocation(program, "tex");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "During Initialization");
+
+ gl.colorMask(1, 1, 1, 1);
+ gl.disable(gl.BLEND);
+ debug('Testing copyTexImage2D');
+
+ // Red canvas
+ gl.clearColor(1, 0, 0, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ var texture = gl.createTexture();
+ // Bind the texture to texture unit 0
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ // Set up texture
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.uniform1i(textureLoc, 0);
+
+ var colors = [
+ [1, 0, 0, 1],
+ [0, 1, 0, 1],
+ [0, 0, 1, 1],
+ [0.5, 0.5, 0.5, 0.5],
+ ];
+ var data = new Uint8Array(2 * 2 * 4);
+ for (var ii = 0; ii < 2 * 2 * 4; ++ii)
+ data[ii] = 136; // A random number other than 0.
+ var count = 0;
+ for (var yy = -2; yy <= 2; ++yy) {
+ for (var xx = -2; xx <= 2; ++xx) {
+ for (var ii = 0; ii < 2; ++ii) {
+ var texColor = colors[count];
+ var clearColor = colors[(count + 1) % colors.length];
+ // clear to some color
+ gl.clearColor(texColor[0], texColor[1], texColor[2], texColor[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ // copy that color to the texture.
+ switch (ii) {
+ case 0:
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, xx, yy, 2, 2, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "using copyTexImage2D: x = " + xx + ", y = " + yy);
+ break;
+ case 1:
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, xx, yy, 2, 2);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "using copyTexSubImage2D: x = " + xx + ", y = " + yy);
+ break;
+ }
+
+ // clear to some other color.
+ gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ // Draw the triangles
+ wtu.clearAndDrawUnitQuad(gl);
+
+ // check the rendering results
+ for (var iy = 0; iy < 2; ++iy) {
+ for (var ix = 0; ix < 2; ++ix) {
+ var x = xx + ix;
+ var y = yy + iy;
+ var expectedColor = (x < 0 || y < 0 || x >= 2 || y >= 2) ?
+ (ii == 0 ? [0, 0, 0, 0] : [136, 136, 136, 136]) :
+ [Math.floor(255 * texColor[0]),
+ Math.floor(255 * texColor[1]),
+ Math.floor(255 * texColor[2]),
+ Math.floor(255 * texColor[3])];
+ wtu.checkCanvasRect(gl, ix, iy, 1, 1, expectedColor,
+ "" + ix + ", " + iy + " should render " + expectedColor + " (+/-1)", 1);
+ }
+ }
+ count = (count + 1) % colors.length;
+ }
+ }
+ }
+
+ debug("");
+}
+
+function runTest(antialias)
+{
+ debug("Testing with antialias on");
+ runTestIteration(true);
+ debug("Testing with antialias off");
+ runTestIteration(false);
+
+ finishTest();
+}
+</script>
+</head>
+<body onload="init()">
+<canvas id="antialiasOn" width="2" height="2"></canvas>
+<canvas id="antialiasOff" width="2" height="2"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-crash.html
new file mode 100644
index 0000000000..994051672a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copy-tex-image-crash.html
@@ -0,0 +1,69 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>copyTexImage2D should not crash</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas"></canvas>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Draw into source of copyTexSubImage2D shouldn't crash: regression test for https://crbug.com/707445");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+canvas.width = 16;
+canvas.height = 16;
+var gl = wtu.create3DContext(canvas);
+
+function runTest() {
+ // Setup/clear source texture
+ let tex1 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex1);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ let fb1 = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb1);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex1, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Setup/clear destination texture
+ let tex2 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex2);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ let fb2 = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex2, 0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ // Copy from source to destination texture
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb1);
+ gl.bindTexture(gl.TEXTURE_2D, tex2);
+ gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 16, 16, 0);
+
+ // Draw into source texture
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ let program = wtu.setupColorQuad(gl); // Used as a trivial shader; any shader will work.
+ gl.useProgram(program);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+}
+
+runTest();
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-large-partial-copy-corruption.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-large-partial-copy-corruption.html
new file mode 100644
index 0000000000..41fe47008f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-large-partial-copy-corruption.html
@@ -0,0 +1,65 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CopyTexSubImage2D partial destination texture 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>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas"></canvas>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Verifies that copyTexSubImage2D redefining part of the destination texture works as expected.");
+
+function runTest() {
+ var wtu = WebGLTestUtils;
+ var canvas = document.getElementById("canvas");
+ canvas.width = 256;
+ canvas.height = 256;
+ var gl = wtu.create3DContext(canvas);
+ // Try this test multiple times.
+ for (var ii = 0; ii < 10; ++ii) {
+ gl.clearColor(0.0, 1.0, 0.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ // Allocate a texture twice as tall as the canvas.
+ // Conceptually, it is filled with zeros.
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, canvas.width, 2 * canvas.height,
+ 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ // Copy the entire framebuffer into the top part of this texture.
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, canvas.width, canvas.height);
+ // Draw the texture back into the canvas.
+ var program = wtu.setupTexturedQuad(gl);
+ wtu.drawUnitQuad(gl);
+ gl.deleteProgram(program);
+ gl.deleteTexture(tex);
+ wtu.checkCanvasRect(gl, 0, 0, canvas.width, canvas.height / 2, [0, 255, 0, 255],
+ "should be green");
+ wtu.checkCanvasRect(gl, 0, canvas.height / 2, canvas.width, canvas.height / 2, [0, 0, 0, 0],
+ "should be transparent black");
+ }
+}
+
+runTest();
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-subrects.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-subrects.html
new file mode 100644
index 0000000000..d4a1791790
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/copytexsubimage2d-subrects.html
@@ -0,0 +1,170 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>CopyTexSubImage2D partial destination texture 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>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="canvas"></canvas>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Verifies that copyTexSubImage2D redefining part of the destination texture works as expected.");
+
+////
+
+var kWidth = 16;
+var kHeight = 16;
+
+////
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+
+canvas.width = kWidth;
+canvas.height = kHeight;
+var gl = wtu.create3DContext(canvas);
+
+////
+
+function clearTo(color) {
+ gl.clearColor(color[0], color[1], color[2], color[3]);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+}
+
+function readInto(view) {
+ gl.readPixels(0, 0, kWidth, kHeight, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(view.buffer));
+}
+
+////
+
+function runTest() {
+ gl.enable(gl.SCISSOR_TEST);
+
+ gl.scissor(0, 0, kWidth/2, kHeight/2);
+ clearTo([1,0,0,1]);
+ gl.scissor(kWidth/2, 0, kWidth/2, kHeight/2);
+ clearTo([0,1,0,1]);
+ gl.scissor(0, kHeight/2, kWidth/2, kHeight/2);
+ clearTo([0,0,1,1]);
+ gl.scissor(kWidth/2, kHeight/2, kWidth/2, kHeight/2);
+ clearTo([0,1,1,1]);
+
+ var srcData = new Uint32Array(kWidth * kHeight);
+ readInto(srcData);
+ console.log('0x' + srcData[0].toString(16));
+
+ ////
+
+ var dstTex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, dstTex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, kWidth, kHeight,
+ 0, gl.RGBA, gl.UNSIGNED_BYTE, null); // Uploads zeros.
+ var dstRefData = new Uint32Array(kWidth * kHeight); // Also cleared to zeros!
+ var dstTestData = new Uint32Array(kWidth * kHeight);
+
+ var dstFB = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, dstFB);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D, dstTex, 0);
+
+ ////
+
+ function pixelPos(x, y) {
+ return y * kWidth + x;
+ }
+
+ function testCmd(tuple) {
+ var dstX0, dstY0, srcX0, srcY0, width, height;
+ [dstX0, dstY0, srcX0, srcY0, width, height] = tuple
+ debug("copyTexSubImage2D(" +
+ [dstX0+','+dstY0, srcX0+','+srcY0, width+','+height].join(', ') +
+ ")");
+
+ // Test
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.copyTexSubImage2D(gl.TEXTURE_2D, 0,
+ dstX0, dstY0, srcX0, srcY0, width, height);
+
+ // Emulate for reference
+ for (var x = 0; x < width; x++) {
+ var srcX = srcX0 + x;
+ var dstX = dstX0 + x;
+ if (srcX < 0 || srcX >= kWidth ||
+ dstX < 0 || dstX >= kWidth)
+ {
+ continue;
+ }
+
+ for (var y = 0; y < height; y++) {
+ var srcY = srcY0 + y;
+ var dstY = dstY0 + y;
+ if (srcY < 0 || srcY >= kHeight ||
+ dstY < 0 || dstY >= kHeight)
+ {
+ continue;
+ }
+
+
+ var srcPos = pixelPos(srcX, srcY);
+ var dstPos = pixelPos(dstX, dstY);
+ dstRefData[dstPos] = srcData[srcPos];
+ }
+ }
+
+ // Compare
+ gl.bindFramebuffer(gl.FRAMEBUFFER, dstFB);
+ readInto(dstTestData);
+
+ for (var x = 0; x < kWidth; x++) {
+ for (var y = 0; y < kHeight; y++) {
+ var pos = pixelPos(x, y);
+ var refPixel = dstRefData[pos];
+ var testPixel = dstTestData[pos];
+
+ //console.log([x, y].join(",") + ":",
+ // testPixel.toString(16), refPixel.toString(16))
+ if (testPixel == refPixel)
+ continue;
+
+ testFailed("Mismatch at (" + [x, y].join(", ") + "): " +
+ " Should be 0x" + refPixel.toString(16) +
+ ", was 0x" + testPixel.toString(16));
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ var tests = [
+ [0,0, 0,0, 2,3],
+ [0,0, 5,8, 2,3],
+ [1,0, 0,0, 2,3],
+ [1,7, 0,0, 2,3],
+ ];
+
+ tests.every(x => testCmd(x));
+}
+
+runTest();
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html
new file mode 100644
index 0000000000..d08801f085
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-incomplete-fbo.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test that cube incomplete textures can not be used as FBO attachments</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="24" height="24"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var wtu = WebGLTestUtils;
+description();
+
+var gl = wtu.create3DContext("example");
+
+var testIncompleteCubemapFaceInFBO = function() {
+ // Create a cube map texture that's not cube complete.
+ var tex2 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex2);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+
+ var cube_map_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
+ ];
+ // Fill in all but 1 cube map face
+ for (var i = 0; i < cube_map_faces.length - 1; ++i) {
+ gl.texImage2D(cube_map_faces[i], 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ }
+
+ var fb2 = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X, tex2, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors after attaching cube map face.");
+ debug("Cubemap has 1 missing face, so framebuffer should not be complete.");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT");
+
+ debug("");
+
+ // Fill in missing cube map face
+ gl.texImage2D(cube_map_faces[5], 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ debug("Missing face is added, so framebuffer should become complete.");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+}
+
+testIncompleteCubemapFaceInFBO();
+
+var successfullyParsed = true;
+finishTest();
+
+</script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-map-uploads-out-of-order.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-map-uploads-out-of-order.html
new file mode 100644
index 0000000000..88ea83e325
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/cube-map-uploads-out-of-order.html
@@ -0,0 +1,90 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL cube map out of order upload 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="64" height="64">
+</canvas>
+<script>
+"use strict";
+description("Test out of order cube map uploads.");
+debug("Regression test for crbug.com/473739 / Apple Radar 20444072.");
+
+<!-- Thanks to Gregg Tavares for the original report and test case. -->
+
+var wtu = WebGLTestUtils;
+
+var canvas = document.getElementById("example");
+canvas.addEventListener('webglcontextlost', contextLost, false);
+
+var contextWasLost = false;
+
+function contextLost(e) {
+ e.preventDefault();
+ contextWasLost = true;
+ debug("***context lost -- should not happen***");
+}
+
+var dataWidth = 256;
+var dataHeight = 256;
+var gl = wtu.create3DContext(canvas);
+var tex = gl.createTexture();
+// start with 1x1 pixel cubemap
+gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+var color = new Uint8Array([128, 192, 255, 255]);
+for (var ii = 0; ii < 6; ++ii) {
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, color);
+}
+gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+gl.generateMipmap(gl.TEXTURE_CUBE_MAP); // there's no need to call this but the code doesn't check the size.
+
+var textureData = new Uint8Array(dataWidth * dataHeight * 4);
+
+// The first texture has downloaded
+var first = 1;
+gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + first, 0, gl.RGBA, dataWidth, dataHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, textureData);
+
+// Now because the first face downloaded doesn't match the other 5 faces upload the same image to the other 5
+// 1x1 faces
+for (var ii = 0; ii < 6; ++ii) {
+ if (ii !== first) {
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, 0, gl.RGBA, dataWidth, dataHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, textureData);
+ }
+}
+gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+
+// Now as each new face comes in add it
+for (var ii = 0; ii < 6; ++ii) {
+ if (ii !== first) {
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, 0, gl.RGBA, dataWidth, dataHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, textureData);
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ }
+}
+
+gl.flush();
+
+setTimeout(function() {
+ shouldBe("contextWasLost", "false");
+ finishTest();
+}, 1000);
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html
new file mode 100644
index 0000000000..0f8cd21cf6
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/default-texture.html
@@ -0,0 +1,42 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Tests texture access with no texture bound</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="24" height="24"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var wtu = WebGLTestUtils;
+description();
+
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+// When no texture is bound, it is considered an incomplete texture,
+// therefore, [0, 0, 0, 1] should be returned.
+// See OpenGL ES spec 2.0.25, section F.3.5.
+wtu.checkCanvas(gl, [0, 0, 0, 255]);
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html
new file mode 100644
index 0000000000..3fd596d445
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/exif-orientation.html
@@ -0,0 +1,167 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Verifies EXIF orientation is respected when uploading images to WebGL textures</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+</head>
+<body onload="run()">
+<canvas id="c" width="256" height="256"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+let wtu = WebGLTestUtils;
+let tiu = TexImageUtils;
+let canvas = document.getElementById("c");
+let gl = wtu.create3DContext(canvas);
+let program = tiu.setupTexturedQuad(gl, gl.RGBA);
+const resourcePath = "../../../resources/";
+const tolerance = 5;
+
+// The locations are written assuming flipY = false. For flipY = true, y = 1.0-y.
+const expectedColors = {
+ top: { location: [ 0.5, 0.25 ], color: [ 255, 0, 0 ] },
+ left: { location: [ 0.4, 0.5 ], color: [ 0, 0, 255 ] },
+ right: { location: [ 0.6, 0.5 ], color: [ 255, 255, 0 ] },
+ bottom: { location: [ 0.5, 0.75 ], color: [ 0, 255, 0 ] },
+}
+
+function output(str)
+{
+ debug(str);
+ bufferedLogToConsole(str);
+}
+
+function checkPixels(flipY)
+{
+ for (let place in expectedColors) {
+ let color = expectedColors[place];
+ let loc = color.location;
+ let x = loc[0];
+ let y = (flipY ? 1.0 - loc[1] : loc[1]);
+ output(" Checking " + place);
+ wtu.checkCanvasRect(gl, Math.floor(canvas.width * x), Math.floor(canvas.height * y), 1, 1,
+ color.color, "shouldBe " + color.color + " +/-" + tolerance, tolerance);
+ }
+}
+
+async function testImageBitmapFromBlobWithFlipY(blob, flipY)
+{
+ let bitmap;
+ // As a concession to Firefox, which doesn't yet implement
+ // createImageBitmap with creation options, skip the tests
+ // involving flipY=true if ImageBitmap creation throws an
+ // exception, and use the single-argument constructor for the
+ // flipY=false case.
+ if (flipY) {
+ try {
+ bitmap = await createImageBitmap(blob, {imageOrientation: flipY});
+ } catch (e) {
+ output(" (createImageBitmap options not supported - skipping flipY=true case)");
+ return;
+ }
+ } else {
+ bitmap = await createImageBitmap(blob);
+ }
+
+ output(" Testing texImage2D, flipY = " + flipY);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, bitmap);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ checkPixels(flipY);
+
+ output(" Testing texSubImage2D, flipY = " + flipY);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, bitmap.width, bitmap.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, bitmap);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ checkPixels(flipY);
+}
+
+async function testImageBitmapFromBlob(filename)
+{
+ let response = await fetch(resourcePath + filename);
+ let blob = await response.blob();
+ output("----------------------------------------------------------------");
+ output("Testing " + filename + " via ImageBitmap from Blob");
+ await testImageBitmapFromBlobWithFlipY(blob, true);
+ await testImageBitmapFromBlobWithFlipY(blob, false);
+}
+
+async function testImageElementWithFlipY(image, flipY)
+{
+ output(" Testing texImage2D, flipY = " + flipY);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ checkPixels(flipY);
+
+ output(" Testing texSubImage2D, flipY = " + flipY);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, image.width, image.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, image);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ checkPixels(flipY);
+}
+
+async function testImageElement(filename)
+{
+ let image = new Image();
+ image.src = resourcePath + filename;
+ await image.decode();
+
+ output("----------------------------------------------------------------");
+ output("Testing " + filename + " via HTMLImageElement");
+
+ await testImageElementWithFlipY(image, true);
+ await testImageElementWithFlipY(image, false);
+}
+
+async function testSingleImage(filename)
+{
+ await testImageBitmapFromBlob(filename);
+ await testImageElement(filename);
+}
+
+async function run()
+{
+ let tex = gl.createTexture();
+ // Bind the texture to the default texture unit 0
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ // Set up texture parameters
+ 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);
+
+ const filenames = [
+ "exif-orientation-test-1-normal.jpg",
+ "exif-orientation-test-2-mirror-horizontal.jpg",
+ "exif-orientation-test-3-rotate-180.jpg",
+ "exif-orientation-test-4-mirror-vertical.jpg",
+ "exif-orientation-test-5-mirror-horizontal-90-ccw.jpg",
+ "exif-orientation-test-6-90-ccw.jpg",
+ "exif-orientation-test-7-mirror-horizontal-90-cw.jpg",
+ "exif-orientation-test-8-90-cw.jpg",
+ ];
+
+ for (let fn of filenames) {
+ await testSingleImage(fn);
+ }
+
+ finishTest();
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/format-filterable-renderable.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/format-filterable-renderable.html
new file mode 100644
index 0000000000..df7694b821
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/format-filterable-renderable.html
@@ -0,0 +1,378 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+const wtu = WebGLTestUtils;
+description();
+
+const gl = wtu.create3DContext();
+gl.canvas.width = gl.canvas.height = 1;
+
+function makeTexImage(format, unpackFormat, unpackType, data) {
+ data = data || null;
+
+ const tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl[format], 2, 2, 0,
+ gl[unpackFormat], gl[unpackType], null);
+ return tex;
+}
+
+const DUMMY_COLOR = makeTexImage('RGBA', 'RGBA', 'UNSIGNED_BYTE');
+
+function makeProgram(gl, vsSrc, fsSrc) {
+ function makeShader(prog, type, src) {
+ const shader = gl.createShader(gl[type]);
+ gl.shaderSource(shader, src.trim());
+ gl.compileShader(shader);
+ gl.attachShader(prog, shader);
+ gl.deleteShader(shader);
+ };
+
+ const prog = gl.createProgram();
+ makeShader(prog, 'VERTEX_SHADER', vsSrc);
+ makeShader(prog, 'FRAGMENT_SHADER', fsSrc);
+ gl.linkProgram(prog);
+
+ if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) {
+ throw 'Program linking failed' + fsSrc;
+ }
+ return prog;
+}
+
+const TEX_FILTER_PROG_T = (version, samplerT) => makeProgram(gl, `\
+ ${version}
+ void main() {
+ gl_PointSize = 1.0;
+ gl_Position = vec4(0.5,0.5,0,1);
+ }`,`\
+ ${version}
+ precision mediump float;
+ uniform ${samplerT} u_tex0;
+ #if __VERSION__ == 300
+ out vec4 o_FragColor;
+ #else
+ #define o_FragColor gl_FragColor
+ #define texture texture2D
+ #endif
+ void main() {
+ o_FragColor = vec4(texture(u_tex0, vec2(0.8)));
+ }`);
+const TEX_FILTER_PROG_BY_TYPEISH = {
+ 'float': TEX_FILTER_PROG_T('', 'sampler2D'),
+};
+if (wtu.isWebGL2(gl)) {
+ TEX_FILTER_PROG_BY_TYPEISH['int'] =
+ TEX_FILTER_PROG_T('#version 300 es', 'highp isampler2D');
+ TEX_FILTER_PROG_BY_TYPEISH['uint'] =
+ TEX_FILTER_PROG_T('#version 300 es', 'highp usampler2D');
+}
+
+function runPixelProgram(gl, prog) {
+ gl.useProgram(prog);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.drawArrays(gl.POINTS, 0, 1);
+ const bytes = new Uint8Array(4);
+ gl.readPixels(0,0,1,1,gl.RGBA, gl.UNSIGNED_BYTE, bytes);
+ return [].map.call(bytes, x => x/255.0);
+}
+
+// GLES 2.0.25 p63
+const FORMAT_INFO_WEBGL1 = {
+ RGBA8 : { filter: true, render: true , unpack: ['RGBA', 'UNSIGNED_BYTE'] },
+ RGB8 : { filter: true, render: undefined, unpack: ['RGB', 'UNSIGNED_BYTE'] },
+ RGBA4 : { filter: true, render: undefined, unpack: ['RGBA', 'UNSIGNED_SHORT_4_4_4_4'] },
+ RGB5_A1: { filter: true, render: undefined, unpack: ['RGBA', 'UNSIGNED_SHORT_5_5_5_1'] },
+ RGB565 : { filter: true, render: undefined, unpack: ['RGB', 'UNSIGNED_SHORT_5_6_5'] },
+ LA8 : { filter: true, render: false , unpack: ['LUMINANCE_ALPHA', 'UNSIGNED_BYTE'] },
+ L8 : { filter: true, render: false , unpack: ['LUMINANCE', 'UNSIGNED_BYTE'] },
+ A8 : { filter: true, render: false , unpack: ['ALPHA', 'UNSIGNED_BYTE'] },
+};
+
+// GLES 3.0.6 p130-132
+const FORMAT_INFO_WEBGL2 = {
+ R8 : { render: true , filter: true , unpack: ['RED', 'UNSIGNED_BYTE'] },
+ R8_SNORM : { render: false, filter: true , unpack: ['RED', 'BYTE'] },
+ RG8 : { render: true , filter: true , unpack: ['RG', 'UNSIGNED_BYTE'] },
+ RG8_SNORM : { render: false, filter: true , unpack: ['RG', 'BYTE'] },
+ RGB8 : { render: true , filter: true , unpack: ['RGB', 'UNSIGNED_BYTE'] },
+ RGB8_SNORM : { render: false, filter: true , unpack: ['RGB', 'BYTE'] },
+ RGB565 : { render: true , filter: true , unpack: ['RGB', 'UNSIGNED_SHORT_5_6_5'] },
+ RGBA4 : { render: true , filter: true , unpack: ['RGBA', 'UNSIGNED_SHORT_4_4_4_4'] },
+ RGB5_A1 : { render: true , filter: true , unpack: ['RGBA', 'UNSIGNED_SHORT_5_5_5_1'] },
+ RGBA8 : { render: true , filter: true , unpack: ['RGBA', 'UNSIGNED_BYTE'] },
+ RGBA8_SNORM : { render: false, filter: true , unpack: ['RGBA', 'BYTE'] },
+ RGB10_A2 : { render: true , filter: true , unpack: ['RGBA', 'UNSIGNED_INT_10_10_10_2'] },
+ RGB10_A2UI : { render: true , filter: false, unpack: ['RGBA', 'UNSIGNED_INT_10_10_10_2'] },
+ SRGB8 : { render: false, filter: true , unpack: ['RGB', 'UNSIGNED_BYTE'] },
+ SRGB8_ALPHA8 : { render: true , filter: true , unpack: ['RGBA', 'UNSIGNED_BYTE'] },
+ R16F : { render: false, filter: true , unpack: ['RED', 'FLOAT'] },
+ RG16F : { render: false, filter: true , unpack: ['RG', 'FLOAT'] },
+ RGB16F : { render: false, filter: true , unpack: ['RGB', 'FLOAT'] },
+ RGBA16F : { render: false, filter: true , unpack: ['RGBA', 'FLOAT'] },
+ R32F : { render: false, filter: false, unpack: ['RED', 'FLOAT'] },
+ RG32F : { render: false, filter: false, unpack: ['RG', 'FLOAT'] },
+ RGB32F : { render: false, filter: false, unpack: ['RGB', 'FLOAT'] },
+ RGBA32F : { render: false, filter: false, unpack: ['RGBA', 'FLOAT'] },
+ R11F_G11F_B10F: { render: false, filter: true , unpack: ['RGB', 'FLOAT'] },
+ RGB9_E5 : { render: false, filter: true , unpack: ['RGB', 'FLOAT'] },
+ R8I : { render: true , filter: false, unpack: ['RED', 'BYTE'] },
+ R8UI : { render: true , filter: false, unpack: ['RED', 'UNSIGNED_BYTE'] },
+ R16I : { render: true , filter: false, unpack: ['RED', 'BYTE'] },
+ R16UI : { render: true , filter: false, unpack: ['RED', 'UNSIGNED_BYTE'] },
+ R32I : { render: true , filter: false, unpack: ['RED', 'BYTE'] },
+ R32UI : { render: true , filter: false, unpack: ['RED', 'UNSIGNED_BYTE'] },
+ RG8I : { render: true , filter: false, unpack: ['RG', 'BYTE'] },
+ RG8UI : { render: true , filter: false, unpack: ['RG', 'UNSIGNED_BYTE'] },
+ RG16I : { render: true , filter: false, unpack: ['RG', 'SHORT'] },
+ RG16UI : { render: true , filter: false, unpack: ['RG', 'UNSIGNED_SHORT'] },
+ RG32I : { render: true , filter: false, unpack: ['RG', 'INT'] },
+ RG32UI : { render: true , filter: false, unpack: ['RG', 'UNSIGNED_INT'] },
+ RGB8I : { render: false, filter: false, unpack: ['RGB', 'BYTE'] },
+ RGB8UI : { render: false, filter: false, unpack: ['RGB', 'UNSIGNED_BYTE'] },
+ RGB16I : { render: false, filter: false, unpack: ['RGB', 'SHORT'] },
+ RGB16UI : { render: false, filter: false, unpack: ['RGB', 'UNSIGNED_SHORT'] },
+ RGB32I : { render: false, filter: false, unpack: ['RGB', 'INT'] },
+ RGB32UI : { render: false, filter: false, unpack: ['RGB', 'UNSIGNED_INT'] },
+ RGBA8I : { render: true , filter: false, unpack: ['RGBA', 'BYTE'] },
+ RGBA8UI : { render: true , filter: false, unpack: ['RGBA', 'UNSIGNED_BYTE'] },
+ RGBA16I : { render: true , filter: false, unpack: ['RGBA', 'SHORT'] },
+ RGBA16UI : { render: true , filter: false, unpack: ['RGBA', 'UNSIGNED_SHORT'] },
+ RGBA32I : { render: true , filter: false, unpack: ['RGBA', 'INT'] },
+ RGBA32UI : { render: true , filter: false, unpack: ['RGBA', 'UNSIGNED_INT'] },
+
+ DEPTH_COMPONENT16: { render: 'DEPTH_ATTACHMENT', filter: false },
+ DEPTH_COMPONENT24: { render: 'DEPTH_ATTACHMENT', filter: false },
+ DEPTH_COMPONENT32F: { render: 'DEPTH_ATTACHMENT', filter: false },
+ DEPTH24_STENCIL8: { render: 'DEPTH_STENCIL_ATTACHMENT', filter: false },
+ DEPTH32F_STENCIL8: { render: 'DEPTH_STENCIL_ATTACHMENT', filter: false },
+};
+
+const ONE_BY_TYPE = {
+ 'BYTE': (1<<7)-1,
+ 'UNSIGNED_BYTE': (1<<8)-1,
+ 'SHORT': (1<<15)-1,
+ 'UNSIGNED_SHORT': (1<<16)-1,
+ 'INT': (1<<31)-1,
+ 'UNSIGNED_INT': Math.pow(2,32)-1,
+ 'FLOAT': 1,
+};
+
+const ABV_BY_TYPE = {
+ 'BYTE': Int8Array,
+ 'UNSIGNED_BYTE': Uint8Array,
+ 'SHORT': Int16Array,
+ 'UNSIGNED_SHORT': Uint16Array,
+ 'INT': Int32Array,
+ 'UNSIGNED_INT': Uint32Array,
+ 'FLOAT': Float32Array,
+};
+
+function pushBitsUnorm(prev, bitCount, floatVal) {
+ let ret = prev << bitCount;
+ ret |= floatVal * ((1 << bitCount)-1);
+ return ret;
+}
+
+const CHANNELS_BY_FORMAT = {
+ 'RED': 1,
+ 'LUMINANCE': 1,
+ 'ALPHA': 1,
+ 'LUMINANCE_ALPHA': 2,
+ 'RG': 2,
+ 'RGB': 3,
+ 'RGBA': 4,
+};
+
+function throwv(val) {
+ throw val;
+}
+
+function pixelDataForUnpack(format, type, floatVal) {
+ switch (type) {
+ case 'UNSIGNED_SHORT_5_6_5': {
+ let bits = 0;
+ bits = pushBitsUnorm(bits, 5, floatVal);
+ bits = pushBitsUnorm(bits, 6, floatVal);
+ bits = pushBitsUnorm(bits, 5, floatVal);
+ return new Uint16Array([bits]);
+ }
+ case 'UNSIGNED_SHORT_4_4_4_4': {
+ let bits = 0;
+ bits = pushBitsUnorm(bits, 4, floatVal);
+ bits = pushBitsUnorm(bits, 4, floatVal);
+ bits = pushBitsUnorm(bits, 4, floatVal);
+ bits = pushBitsUnorm(bits, 4, floatVal);
+ return new Uint16Array([bits]);
+ }
+ case 'UNSIGNED_SHORT_5_5_5_1': {
+ let bits = 0;
+ bits = pushBitsUnorm(bits, 5, floatVal);
+ bits = pushBitsUnorm(bits, 5, floatVal);
+ bits = pushBitsUnorm(bits, 5, floatVal);
+ bits = pushBitsUnorm(bits, 1, floatVal); // Ok, silly for 1 bit here.
+ return new Uint16Array([bits]);
+ }
+ case 'UNSIGNED_INT_10_10_10_2': {
+ let bits = 0;
+ bits = pushBitsUnorm(bits, 10, floatVal);
+ bits = pushBitsUnorm(bits, 10, floatVal);
+ bits = pushBitsUnorm(bits, 10, floatVal);
+ bits = pushBitsUnorm(bits, 2, floatVal); // 2 bits isn't much more useful
+ return new Uint32Array([bits]);
+ }
+ }
+
+ const channels = CHANNELS_BY_FORMAT[format] || throwv(format);
+ const one = ONE_BY_TYPE[type] || throwv('240', type);
+ const abvType = ABV_BY_TYPE[type] || throwv('241', type);
+
+ const val = floatVal * one;
+ const arr = [];
+ for (const i of range(channels)) {
+ arr.push(val);
+ }
+ return new abvType(arr);
+}
+
+function expect(name, was, expected) {
+ let text = `${name} was ${was}`;
+ const cond = was == expected;
+ if (!cond) {
+ text += `, but expected ${expected}`;
+ }
+ expectTrue(cond, text);
+}
+
+function toTypeish(sizedFormat) {
+ if (sizedFormat.endsWith('UI')) {
+ return 'int';
+ } else if (sizedFormat.endsWith('I')) {
+ return 'uint';
+ }
+ return 'float';
+}
+
+call(async () => {
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+ let formatList = FORMAT_INFO_WEBGL1;
+ if (wtu.isWebGL2(gl)) {
+ formatList = FORMAT_INFO_WEBGL2;
+ }
+ for (const [sizedFormat, info] of Object.entries(formatList)) {
+ await wtu.dispatchPromise();
+ debug(``);
+ debug(`${sizedFormat}: ${JSON.stringify(info)}`);
+
+ const typeish = toTypeish(sizedFormat);
+
+ // |---|---|
+ // | 0 | 1 |
+ // |---|---|
+ // 0| 0 | 0 |
+ // |---|---|
+ // 0
+ const tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+
+ if (gl.texStorage2D) {
+ gl.texStorage2D(gl.TEXTURE_2D, 1, gl[sizedFormat], 2, 2);
+ } else {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl[info.unpack[0]],
+ 2, 2, 0, gl[info.unpack[0]], gl[info.unpack[1]], null);
+ }
+
+ if (info.unpack) {
+ const one = pixelDataForUnpack(...info.unpack, 1.0);
+ const data = new one.constructor(one.length*4);
+ data.set(one, one.length*3);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0,
+ 2,2, gl[info.unpack[0]], gl[info.unpack[1]], data);
+ } else {
+ info.render || throwv(`${sizedFormat} without unpack or render`);
+ }
+
+ // -
+ // color-renderable test
+
+ {
+ const fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ let attach = info.render || true;
+ const isColor = (attach === true);
+ if (isColor) {
+ attach = 'COLOR_ATTACHMENT0';
+ } else {
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D, DUMMY_COLOR, 0);
+ }
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl[attach],
+ gl.TEXTURE_2D, tex, 0);
+ const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ const wasRenderable = (status == gl.FRAMEBUFFER_COMPLETE);
+ if (info.render === undefined) {
+ debug(`Non-normative: color-renderable was ${wasRenderable}`);
+ } else {
+ expect('color-renderable', wasRenderable, !!info.render);
+ }
+ if (wasRenderable) {
+ gl.clearColor(0,0,0,0);
+ gl.clearDepth(0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.enable(gl.SCISSOR_TEST);
+ gl.scissor(1,1,1,1);
+ gl.clearColor(1,1,1,1);
+ gl.clearDepth(1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.disable(gl.SCISSOR_TEST);
+ }
+ gl.deleteFramebuffer(fb);
+ if (!wasRenderable && !info.unpack) {
+ testFailed('No unpack provided and !wasRenderable, skipping filtering subtest...');
+ continue;
+ }
+ }
+
+ // -
+ // filterable test
+
+ const prog = TEX_FILTER_PROG_BY_TYPEISH[typeish];
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.clearColor(0,0,0,0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.viewport(0,0,1,1);
+ const v = runPixelProgram(gl, prog);
+ if (sizedFormat != 'A8') {
+ v[3] = 0; // Incomplete no-alpha formats put 1 in alpha.
+ }
+ const wasFilterable = v.some(x => !!x);
+ expect('filterable', wasFilterable, info.filter);
+ }
+
+ finishTest();
+});
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html
new file mode 100644
index 0000000000..fbfc2c510a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-get-tex-parameter.html
@@ -0,0 +1,27 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL getTexParameter 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>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../../js/tests/gl-get-tex-parameter.js"></script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html
new file mode 100644
index 0000000000..161a45271b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-pixelstorei.html
@@ -0,0 +1,96 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL pixelStorei 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>
+</head>
+<body>
+<canvas id="example" width="50" height="50"></canvas>
+<canvas id="2d00" width="50" height="50"></canvas>
+<canvas id="2d01" width="50" height="50"></canvas>
+<canvas id="2d02" width="50" height="50"></canvas>
+<canvas id="2d03" width="50" height="50"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main() {
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main() {
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+
+<script>
+"use strict";
+function init() {
+ description("This test checks that drawImage and readPixels are not effected by gl.Pixelstorei(gl.PACK_ALIGNMENT) and visa versa");
+
+ debug("There should be 5 red triangles on 5 black squares above");
+ debug("");
+
+ var wtu = WebGLTestUtils;
+ var canvas3d = document.getElementById("example");
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([ 0,0.5,0, -0.5,-0.5,0, 0.5,-0.5,0 ]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+
+ function checkData(ctx, name) {
+ // Test several locations
+ // First line should be all black
+ wtu.checkCanvasRect(ctx, 0, 0, 50, 1, [0, 0, 0, 0]);
+
+ // Line 25 should be red for at least 6 red pixels starting 22 pixels in
+ wtu.checkCanvasRect(ctx, 22, 25, 6, 1, [255, 0, 0, 255]);
+
+ // Last line should be all black
+ wtu.checkCanvasRect(ctx, 0, 49, 50, 1, [0, 0, 0, 0]);
+ }
+
+ var ctx2d;
+
+ function checkColors() {
+ checkData(gl, "3d context");
+ checkData(ctx2d, "2d context");
+ }
+
+ var table = [1, 2, 4, 8];
+ for (var ii = 0; ii < table.length; ++ii) {
+ gl.pixelStorei(gl.PACK_ALIGNMENT, table[ii]);
+ ctx2d = document.getElementById("2d0" + ii).getContext("2d");
+ ctx2d.globalCompositeOperation = 'copy';
+ ctx2d.drawImage(canvas3d, 0, 0);
+ checkColors();
+ assertMsg(gl.getParameter(gl.PACK_ALIGNMENT) == table[ii],
+ "PACK_ALIGNMENT is " + table[ii]);
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html
new file mode 100644
index 0000000000..897377534c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/gl-teximage.html
@@ -0,0 +1,406 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texImage2D conformance 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>
+</head>
+<body>
+<canvas id="example" width="256" height="16" style="width: 256px; height: 48px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+enableJSTestPreVerboseLogging();
+description("Test texImage2D conversions.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+gl.disable(gl.DITHER);
+var program = wtu.setupTexturedQuad(gl);
+var successfullyParsed;
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+var imgURLs = [
+ '../../../resources/1-channel.jpg',
+ '../../../resources/gray-ramp-256-with-128-alpha.png',
+ '../../../resources/gray-ramp-256.png',
+ '../../../resources/gray-ramp-default-gamma.png',
+ '../../../resources/gray-ramp-gamma0.1.png',
+ '../../../resources/gray-ramp-gamma1.0.png',
+ '../../../resources/gray-ramp-gamma2.0.png',
+ '../../../resources/gray-ramp-gamma4.0.png',
+ '../../../resources/gray-ramp-gamma9.0.png',
+ '../../../resources/gray-ramp.png',
+ '../../../resources/zero-alpha.png',
+ '../../../resources/3x3.png',
+ '../../../resources/blue-1x1.jpg',
+ '../../../resources/red-indexed.png',
+ '../../../resources/transparent-on-left-indexed.png',
+ '../../../resources/green-2x2-16bit.png',
+ '../../../resources/small-square-with-colorspin-profile.jpg',
+ '../../../resources/small-square-with-colorspin-profile.png',
+ '../../../resources/small-square-with-cie-rgb-profile.png',
+ '../../../resources/small-square-with-colormatch-profile.png',
+ '../../../resources/small-square-with-e-srgb-profile.png',
+ '../../../resources/small-square-with-smpte-c-profile.png',
+ '../../../resources/small-square-with-srgb-iec61966-2.1-profile.png'];
+
+
+wtu.loadImagesAsync(imgURLs, runTests);
+
+function runTests(imgs) {
+ var loc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(loc, 0);
+
+ gl.disable(gl.BLEND);
+ gl.disable(gl.DEPTH_TEST);
+
+ var width = gl.canvas.width;
+ var height = gl.canvas.height;
+
+ function checkPixel(x, y, color) {
+ wtu.checkCanvasRect(gl, x, y, 1, 1, color);
+ }
+
+ function checkPixelRange(x, y, color, allowedRange) {
+ var msg = "pixel " + x + ", " + y + " should be within " +
+ allowedRange + " units of " +
+ color[0] + ", " +
+ color[1] + ", " +
+ color[2] + ", " +
+ color[3];
+ wtu.checkCanvasRect(gl, x, y, 1, 1, color, msg, allowedRange);
+ }
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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);
+
+ var buf = new Uint8Array(width * height * 4);
+
+ debug("");
+ debug("check pixels are NOT pre-multiplied");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/zero-alpha.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+
+ var left = 0;
+ var middle = Math.floor(width / 2);
+ var right = width - 1;
+ var bottom = 0;
+ var center = Math.floor(height / 2);
+ var top = height - 1;
+ checkPixel(left, top, [ 0, 0, 0, 255]);
+ checkPixel(middle, top, [255, 0, 255, 255]);
+ checkPixel(right, top, [ 0, 0, 255, 255]);
+ checkPixel(left, center, [128, 128, 128, 255]);
+ checkPixel(middle, center, [255, 255, 255, 255]);
+ checkPixel(right, center, [ 0, 255, 255, 255]);
+ checkPixel(left, bottom, [255, 0, 0, 255]);
+ checkPixel(middle, bottom, [255, 255, 0, 255]);
+ checkPixel(right, bottom, [ 0, 255, 0, 255]);
+
+ debug("");
+ debug("check quantization");
+ var quantInfo = [
+ {format: gl.RGBA, type: gl.UNSIGNED_BYTE, counts: [256, 256, 256, 256]},
+ {format: gl.RGBA, type: gl.UNSIGNED_SHORT_4_4_4_4, counts: [ 16, 16, 16, 16]},
+ {format: gl.RGB, type: gl.UNSIGNED_SHORT_5_6_5, counts: [ 32, 64, 32, 1]},
+ {format: gl.RGBA, type: gl.UNSIGNED_SHORT_5_5_5_1, counts: [ 32, 32, 32, 2]}];
+ for (var qq = 0; qq < quantInfo.length; ++qq) {
+ var info = quantInfo[qq];
+ gl.texImage2D(
+ gl.TEXTURE_2D, 0, info.format, info.format, info.type,
+ imgs['../../../resources/gray-ramp-256.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+ wtu.clearAndDrawUnitQuad(gl);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ var counts = [{ }, { }, { }, { }];
+ var numUniqueValues = [0, 0, 0, 0];
+ // Count the number of unique values in each channel.
+ for (var ii = 0; ii < width * height * 4; ii += 4) {
+ for (var jj = 0; jj < 4; ++jj) {
+ var v = buf[ii + jj];
+ if (!counts[jj][v]) {
+ counts[jj][v] = 1;
+ ++numUniqueValues[jj];
+ } else {
+ ++counts[jj][v];
+ }
+ }
+ }
+ for (var ii = 0; ii < 4; ++ii) {
+ assertMsg(numUniqueValues[ii] == info.counts[ii],
+ "There should be " + info.counts[ii] +
+ " unique values in channel " + ii + ". Found " +
+ numUniqueValues[ii]);
+ }
+ }
+
+ debug("");
+ debug("Check that gamma settings don't effect 8bit pngs");
+ wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);');
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/gray-ramp-default-gamma.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+ wtu.clearAndDrawUnitQuad(gl);
+ var ref = new Uint8Array(width * height * 4);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, ref);
+
+ var gammaImages = [
+ '../../../resources/gray-ramp-gamma0.1.png',
+ '../../../resources/gray-ramp-gamma1.0.png',
+ '../../../resources/gray-ramp-gamma2.0.png',
+ '../../../resources/gray-ramp-gamma4.0.png',
+ '../../../resources/gray-ramp-gamma9.0.png'];
+ for (var ii = 0; ii < gammaImages.length; ++ii) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs[gammaImages[ii]]);
+ wtu.clearAndDrawUnitQuad(gl);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ var same = true;
+ for (var jj = 0; jj < width * height * 4; ++jj) {
+ if (buf[jj] != ref[jj]) {
+ same = false;
+ break;
+ }
+ }
+ assertMsg(same, "pixels should be same regardless of gamma settings.");
+ }
+
+ debug("");
+ debug("check pixels are UN pre-multiplied");
+ for (var ii = 0; ii < 2; ++ii) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ if (ii == 0) {
+ var canvas2d = document.createElement("canvas");
+ canvas2d.width = 256;
+ canvas2d.height = 1;
+ var ctx = canvas2d.getContext("2d");
+ ctx.drawImage(imgs['../../../resources/gray-ramp-256-with-128-alpha.png'], 0, 0);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, canvas2d);
+ } else {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/gray-ramp-256-with-128-alpha.png']);
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+ wtu.clearAndDrawUnitQuad(gl);
+ var buf = new Uint8Array(width * height * 4);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ var lt128Count = [0, 0, 0];
+ var ge128Count = [0, 0, 0];
+ for (var jj = 0; jj < width; ++jj) {
+ var off = jj * 4;
+ for (var cc = 0; cc < 3; ++cc) {
+ if (buf[off + cc] < 128) {
+ ++lt128Count[cc];
+ } else {
+ ++ge128Count[cc];
+ }
+ }
+ }
+ // Not sure the exact count here because gamma does effect drawing into the
+ // canvas but it should be close to 50% so I'll pass 45%
+ for (var jj = 0; jj < 3; ++jj) {
+ assertMsg(ge128Count[jj] > 256 * 0.45,
+ "Half the pixels in channel " + jj +
+ " should be >= 128,128,128. found " +
+ ((ge128Count[jj] / 256) * 100).toFixed() + "%");
+ assertMsg(lt128Count[jj] > 256 * 0.45,
+ "Half the pixels in channel " + jj +
+ " should be < 128,128,128. found " +
+ ((lt128Count[jj] / 256) * 100).toFixed() + "%");
+ }
+ }
+
+ debug("");
+ debug("check canvas pixels are UN pre-multiplied");
+ var canvas2d = document.createElement("canvas");
+ canvas2d.width = 1;
+ canvas2d.height = 1;
+ var ctx = canvas2d.getContext("2d");
+ ctx.fillStyle ="rgba(255,255,255,0.5)";
+ ctx.fillRect(0, 0, 256, 1);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+ checkPixelRange(0, 0, [255, 255, 255, 127], 4);
+
+ debug("");
+ debug("check canvas pixels are pre-multiplied");
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+ checkPixelRange(0, 0, [127, 127, 127, 127], 4);
+
+
+ debug("");
+ debug("check pixels are pre-multiplied");
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
+ // TODO(gman): use different texture that won't pass on failure
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/zero-alpha.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+
+ var same = true;
+ for (var jj = 0; jj < width * height * 4; ++jj) {
+ if (buf[jj] != 0) {
+ same = false;
+ break;
+ }
+ }
+ assertMsg(same, "pixels should all be 0.");
+
+ debug("");
+ debug("check pixels are flipped");
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/3x3.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+
+ checkPixel(left, top, [255, 0, 0, 255]);
+ checkPixel(middle, top, [255, 255, 0, 255]);
+ checkPixel(right, top, [255, 0, 0, 255]);
+ checkPixel(left, center, [255, 0, 255, 255]);
+ checkPixel(middle, center, [255, 0, 0, 255]);
+ checkPixel(right, center, [ 0, 255, 0, 255]);
+ checkPixel(left, bottom, [ 0, 0, 0, 255]);
+ checkPixel(middle, bottom, [ 0, 0, 255, 255]);
+ checkPixel(right, bottom, [255, 0, 0, 255]);
+
+ debug("");
+ debug("check uploading of images with no alpha channel works");
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/blue-1x1.jpg']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ checkPixelRange(middle, center, [ 0, 0, 255, 255], 10);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+
+ debug("");
+ debug("check uploading of 16-bit images");
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/green-2x2-16bit.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ checkPixelRange(middle, center, [ 15, 121, 0, 255], 10);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+
+ debug("");
+ debug("check uploading of images with ICC profiles");
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ wtu.failIfGLError(gl, 'gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);');
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/small-square-with-colorspin-profile.jpg']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ // The image is red. However, if we ignore the color profile, it is blue.
+ checkPixelRange(middle, center, [ 0, 0, 255, 255], 10);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/small-square-with-colorspin-profile.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ // The image is red. However, if we ignore the color profile, it is blue.
+ checkPixelRange(middle, center, [ 0, 0, 255, 255], 10);
+
+ var iccPNGs = [
+ '../../../resources/small-square-with-cie-rgb-profile.png',
+ '../../../resources/small-square-with-colormatch-profile.png',
+ '../../../resources/small-square-with-e-srgb-profile.png',
+ '../../../resources/small-square-with-smpte-c-profile.png',
+ '../../../resources/small-square-with-srgb-iec61966-2.1-profile.png'];
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ for (var ii = 0; ii < iccPNGs.length; ++ii) {
+ var buf2 = new Uint8Array(width * height * 4);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs[iccPNGs[ii]]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf2);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+ var same = true;
+ for (var jj = 0; jj < buf.length; ++jj) {
+ if (buf[jj] != buf2[jj]) {
+ same = false;
+ break;
+ }
+ }
+ assertMsg(same, "uploading PNGs with same data but various ICC profiles should generate the same results");
+ }
+
+ debug("");
+ debug("check uploading of indexed PNG images");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/red-indexed.png']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ // The image should be red.
+ checkPixelRange(middle, center, [ 255, 0, 0, 255 ], 10);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/transparent-on-left-indexed.png']);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvasRect(gl, 0, 0, 128, 16, [255, 0, 255, 0], "should be transparent purple");
+ wtu.checkCanvasRect(gl, 128, 0,128, 16, [255, 255, 0, 255], "should be yellow");
+
+ debug("");
+ debug("check uploading of 1-channel JPG images");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+ imgs['../../../resources/1-channel.jpg']);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ // The image should be gray.
+ checkPixelRange(middle, center, [ 128, 128, 128, 255 ], 28);
+
+ debug("")
+ debug("check calling texImage2D with NULL clears the texture");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB,
+ imgs['../../../resources/red-indexed.png'].width,
+ imgs['../../../resources/red-indexed.png'].height,
+ 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+ wtu.clearAndDrawUnitQuad(gl);
+ // The image should be white.
+ checkPixelRange(middle, center, [ 0, 0, 0, 255 ], 10);
+
+ debug("");
+ debug("check zero size cases");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, 2, 0, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, new Uint8Array());
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from zero sized textures");
+
+ debug("");
+ successfullyParsed = true;
+ shouldBeTrue("successfullyParsed");
+ debug('<br /><span class="pass">TEST COMPLETE</span>');
+ notifyFinishedToHarness();
+}
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html
new file mode 100644
index 0000000000..1fe851d738
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/mipmap-fbo.html
@@ -0,0 +1,109 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Test if mipmap incomplete textures can be used as FBO attachments, and mipmap generation on a texture filled by an FBO works correctly</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="24" height="24"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+var wtu = WebGLTestUtils;
+description();
+
+var gl = wtu.create3DContext("example");
+
+function testMipmapGeneration() {
+ // setup render target texture //
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ // setup framebuffer //
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ // fill the framebuffer //
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.viewport(0, 0, 32, 32);
+ gl.clearColor(1, 0, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ // generate mipmap //
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.generateMipmap(gl.TEXTURE_2D);
+
+ var program = wtu.setupTexturedQuad(gl);
+ gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ // readback //
+ wtu.checkCanvas(gl, [255, 0, 255, 255]);
+}
+
+var testCubemapFaceWithIncompleteMipmapInFBO = function() {
+ // Create a cube map texture that's not mipmap complete.
+ var tex2 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex2);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
+
+ var cube_map_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 i = 0; i < cube_map_faces.length; ++i) {
+ gl.texImage2D(cube_map_faces[i], 0, gl.RGBA, 32, 32, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ }
+
+ var fb2 = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb2);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_CUBE_MAP_POSITIVE_X, tex2, 0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors after attaching cube map face.");
+ shouldBe("gl.checkFramebufferStatus(gl.FRAMEBUFFER)", "gl.FRAMEBUFFER_COMPLETE");
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+
+ var colorProgram = wtu.setupColorQuad(gl);
+ var colorLocation = gl.getUniformLocation(colorProgram, 'u_color');
+ gl.uniform4f(colorLocation, 0.0, 1.0, 0.0, 1.0);
+ gl.viewport(0, 0, 32, 32);
+ wtu.drawUnitQuad(gl);
+ // Read what's in the framebuffer - note that we need to use checkCanvasRect since the
+ // FB dimensions are different from canvas dimensions.
+ wtu.checkCanvasRect(gl, 0, 0, 32, 32, [0, 255, 0, 255],
+ "Framebuffer with a non-mipmap complete cube map attachment should be green");
+}
+
+testMipmapGeneration();
+debug("");
+testCubemapFaceWithIncompleteMipmapInFBO();
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance-offscreencanvas.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance-offscreencanvas.html
new file mode 100644
index 0000000000..208696e98a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance-offscreencanvas.html
@@ -0,0 +1,125 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Origin Restrictions Conformance Tests for OffscreenCanvas</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas"></canvas>
+<img id="img" style="display:none;">
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+// Checks if function throws an exception.
+function causedException(func) {
+ var hadException = false;
+ try {
+ func();
+ } catch(e) {
+ hadException = true;
+ }
+ return hadException;
+}
+
+var defaultImgUrl = "https://get.webgl.org/conformance-resources/opengl_logo.jpg";
+var localImgUrl = "../../../resources/opengl_logo.jpg";
+
+var imgDomain;
+var pageDomain;
+
+function imageLoaded(img) {
+ description("This test ensures WebGL implementations for OffscreenCanvas follow proper same-origin restrictions.");
+
+ if (!window.OffscreenCanvas) {
+ testPassed("No OffscreenCanvas support");
+ finishTest();
+ return;
+ }
+
+ assertMsg(img.width > 0 && img.height > 0, "img was loaded");
+ imgDomain = wtu.getBaseDomain(wtu.getHost(img.src));
+ pageDomain = wtu.getBaseDomain(window.location.host);
+ assertMsg(imgDomain != pageDomain,
+ "img domain (" + imgDomain + ") and page domain (" + pageDomain + ") are not the same.");
+
+ function makeTexImage2D(gl, src) {
+ return function() {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, src);
+ };
+ }
+
+ function makeTexSubImage2D(gl, src) {
+ return function() {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, src);
+ };
+ }
+
+ function makeReadPixels(gl) {
+ return function() {
+ var buf = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ };
+ }
+
+ var offscreencanvas = new OffscreenCanvas(10, 10);
+ var gl = wtu.create3DContext(offscreencanvas);
+
+ debug("");
+ debug("check that an attempt to upload an image from another origin throws an exception.");
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 256, 256, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ assertMsg(causedException(makeTexImage2D(gl, img)),
+ "texImage2D with cross-origin image should throw exception.");
+ assertMsg(causedException(makeTexSubImage2D(gl, img)),
+ "texSubImage2D with cross-origin image should throw exception.");
+
+ debug("check that readPixels continues to work against this offscreencanvas.");
+ assertMsg(!causedException(makeReadPixels(gl)),
+ "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas.");
+
+ debug("check that an attempt to upload a tainted canvas throws an exception.");
+ var canvas = document.getElementById("canvas");
+ var ctx2d = canvas.getContext("2d");
+ ctx2d.drawImage(img, 0, 0);
+ assertMsg(causedException(makeTexImage2D(gl, canvas)),
+ "texImage2D with NON origin clean canvas should throw exception.");
+ assertMsg(causedException(makeTexSubImage2D(gl, canvas)),
+ "texSubImage2D with NON origin clean canvas should throw exception.");
+
+ debug("check that readPixels continues to work against this offscreencanvas.");
+ assertMsg(!causedException(makeReadPixels(gl)),
+ "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas.");
+
+ // TODO: Should check video.
+ // TODO: Should check CORS support.
+
+ finishTest();
+}
+
+(async function() {
+ const img = document.getElementById('img');
+ try {
+ await wtu.awaitOrTimeout(wtu.loadCrossOriginImage(img, defaultImgUrl, localImgUrl));
+ } catch (e) {
+ testFailed(`Image setup failed (${e}).`);
+ finishTest();
+ return;
+ }
+ imageLoaded(img);
+})();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html
new file mode 100644
index 0000000000..fb7f572173
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/origin-clean-conformance.html
@@ -0,0 +1,137 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Origin Restrictions Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas1"></canvas>
+<canvas id="canvas2"></canvas>
+<img id="img" style="display:none;">
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+// Checks if function throws an exception.
+function causedException(func) {
+ var hadException = false;
+ try {
+ func();
+ } catch(e) {
+ hadException = true;
+ }
+ return hadException;
+}
+
+var defaultImgUrl = "https://get.webgl.org/conformance-resources/opengl_logo.jpg";
+var localImgUrl = "../../../resources/opengl_logo.jpg";
+
+var imgDomain;
+var pageDomain;
+var successfullyParsed;
+
+function imageLoaded(img) {
+ description("This test ensures WebGL implementations follow proper same-origin restrictions.");
+
+ assertMsg(img.width > 0 && img.height > 0, "img was loaded");
+ imgDomain = wtu.getBaseDomain(wtu.getHost(img.src));
+ pageDomain = wtu.getBaseDomain(window.location.host);
+ assertMsg(imgDomain != pageDomain,
+ "img domain (" + imgDomain + ") and page domain (" + pageDomain + ") are not the same.");
+
+ function makeTexImage2D(gl, src) {
+ return function() {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, src);
+ };
+ }
+
+ function makeTexSubImage2D(gl, src) {
+ return function() {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, src);
+ };
+ }
+
+ function makeReadPixels(gl) {
+ return function() {
+ var buf = new Uint8Array(4);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ };
+ }
+
+ function makeToDataURL(canvas) {
+ return function() {
+ var data = canvas.toDataURL();
+ }
+ }
+
+ var canvas1 = document.getElementById("canvas1");
+ var gl = wtu.create3DContext(canvas1);
+
+ debug("");
+ debug("check that an attempt to upload an image from another origin throws an exception.");
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 256, 256, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ assertMsg(causedException(makeTexImage2D(gl, img)),
+ "texImage2D with cross-origin image should throw exception.");
+ assertMsg(causedException(makeTexSubImage2D(gl, img)),
+ "texSubImage2D with cross-origin image should throw exception.");
+
+ debug("check that readPixels and toDataURL continue to work against this canvas.");
+ assertMsg(!causedException(makeReadPixels(gl)),
+ "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas.");
+ assertMsg(!causedException(makeToDataURL(canvas1)),
+ "should not throw exception by toDataURL for WebGL canvas, which should stay origin clean.");
+
+ debug("check that an attempt to upload a tainted canvas throws an exception.");
+ var canvas2 = document.getElementById("canvas2");
+ var ctx2d = canvas2.getContext("2d");
+ ctx2d.drawImage(img, 0, 0);
+ assertMsg(causedException(makeToDataURL(canvas2)),
+ "should throw exception by toDataURL for NON origin clean canvas.");
+ assertMsg(causedException(makeTexImage2D(gl, canvas2)),
+ "texImage2D with NON origin clean canvas should throw exception.");
+ assertMsg(causedException(makeTexSubImage2D(gl, canvas2)),
+ "texSubImage2D with NON origin clean canvas should throw exception.");
+
+ debug("check that readPixels and toDataURL continue to work against this canvas.");
+ assertMsg(!causedException(makeReadPixels(gl)),
+ "readPixels should never throw exception -- not possible to dirty origin of WebGL canvas.");
+ assertMsg(!causedException(makeToDataURL(canvas1)),
+ "should not throw exception by toDataURL for WebGL canvas, which should stay origin clean.");
+
+ // TODO: Should check video.
+ // TODO: Should check CORS support.
+
+ debug("");
+ successfullyParsed = true;
+ shouldBeTrue("successfullyParsed");
+ debug('<br /><span class="pass">TEST COMPLETE</span>');
+ notifyFinishedToHarness();
+}
+
+(async function() {
+ const img = document.getElementById('img');
+ try {
+ await wtu.awaitOrTimeout(wtu.loadCrossOriginImage(img, defaultImgUrl, localImgUrl));
+ } catch (e) {
+ testFailed(`Image setup failed (${e}).`);
+ finishTest();
+ return;
+ }
+ imageLoaded(img);
+})();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/png-image-types.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/png-image-types.html
new file mode 100644
index 0000000000..4eb98b1405
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/png-image-types.html
@@ -0,0 +1,164 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="utf-8">
+ <link rel="stylesheet" href="../../../resources/js-test-style.css" />
+ <script src="../../../js/js-test-pre.js"></script>
+ <script src="../../../js/webgl-test-utils.js"></script>
+</head>
+
+<body>
+ <div id="description"></div>
+ <div id="console"></div>
+ <script>
+"use strict";
+description("This test verifies correct channel mapping of different PNG image types.");
+
+const testData = {
+ "Grayscale": {
+ src: [
+ // [0x40]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVQI12NwAAAAQgBBg7nsrQAAAABJRU5ErkJggg==",
+ // [0x4040]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABEAAAAABq7kcWAAAAC0lEQVQI12NwcAAAAMMAgUenLEIAAAAASUVORK5CYII="
+ ],
+ expectations: [
+ { color: [0x00, 0x00, 0x00, 0xFF], format: "ALPHA" },
+ { color: [0x40, 0x40, 0x40, 0xFF], format: "RGB" },
+ { color: [0x40, 0x40, 0x40, 0xFF], format: "RGBA" },
+ { color: [0x40, 0x40, 0x40, 0xFF], format: "LUMINANCE" },
+ { color: [0x40, 0x40, 0x40, 0xFF], format: "LUMINANCE_ALPHA" },
+ { color: [0x40, 0x00, 0x00, 0xFF], format: "RED", internalformat: "R8" },
+ { color: [0x40, 0x40, 0x00, 0xFF], format: "RG", internalformat: "RG8" }
+ ]
+ },
+ "Grayscale Alpha": {
+ src: [
+ // [0x40, 0x80]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQI12NwaAAAAQMAwUxZTl4AAAAASUVORK5CYII=",
+ // [0x4040, 0x8080]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABEAQAAADljNBBAAAADUlEQVQI12NwcGhoAAADRQGBoxssPgAAAABJRU5ErkJggg=="
+ ],
+ expectations: [
+ { color: [0x00, 0x00, 0x00, 0x80], format: "ALPHA" },
+ { color: [0x40, 0x40, 0x40, 0xFF], format: "RGB" },
+ { color: [0x40, 0x40, 0x40, 0x80], format: "RGBA" },
+ { color: [0x40, 0x40, 0x40, 0xFF], format: "LUMINANCE" },
+ { color: [0x40, 0x40, 0x40, 0x80], format: "LUMINANCE_ALPHA" },
+ { color: [0x40, 0x00, 0x00, 0xFF], format: "RED", internalformat: "R8" },
+ { color: [0x40, 0x40, 0x00, 0xFF], format: "RG", internalformat: "RG8" }
+ ]
+ },
+ "Color": {
+ src: [
+ // [0xBF, 0x7F, 0xFF]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12PYX/8fAAQ+Aj5BqwprAAAAAElFTkSuQmCC",
+ // [0xBFBF, 0x7F7F, 0xFFFF]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABEAIAAADA54+dAAAAD0lEQVQI12PYv7++/v9/AA6yBHvtbgBNAAAAAElFTkSuQmCC"
+ ],
+ expectations: [
+ { color: [0x00, 0x00, 0x00, 0xFF], format: "ALPHA" },
+ { color: [0xBF, 0x7F, 0xFF, 0xFF], format: "RGB" },
+ { color: [0xBF, 0x7F, 0xFF, 0xFF], format: "RGBA" },
+ { color: [0xBF, 0xBF, 0xBF, 0xFF], format: "LUMINANCE" },
+ { color: [0xBF, 0xBF, 0xBF, 0xFF], format: "LUMINANCE_ALPHA" },
+ { color: [0xBF, 0x00, 0x00, 0xFF], format: "RED", internalformat: "R8" },
+ { color: [0xBF, 0x7F, 0x00, 0xFF], format: "RG", internalformat: "RG8" }
+ ]
+
+ },
+ "Color Alpha": {
+ src: [
+ // [0xBF, 0x7F, 0xFF, 0x40]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQI12PYX//fAQAGvAJ+xPMwKQAAAABJRU5ErkJggg==",
+ // [0xBFBF, 0x7F7F, 0xFFFF, 0x4040]
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABEAYAAABPhRjKAAAAEUlEQVQI12PYv7++/v9/BwcAGGgE+8YN4XUAAAAASUVORK5CYII="
+ ],
+ expectations: [
+ { color: [0x00, 0x00, 0x00, 0x40], format: "ALPHA" },
+ { color: [0xBF, 0x7F, 0xFF, 0xFF], format: "RGB" },
+ { color: [0xBF, 0x7F, 0xFF, 0x40], format: "RGBA" },
+ { color: [0xBF, 0xBF, 0xBF, 0xFF], format: "LUMINANCE" },
+ { color: [0xBF, 0xBF, 0xBF, 0x40], format: "LUMINANCE_ALPHA" },
+ { color: [0xBF, 0x00, 0x00, 0xFF], format: "RED", internalformat: "R8" },
+ { color: [0xBF, 0x7F, 0x00, 0xFF], format: "RG", internalformat: "RG8" }
+ ]
+ }
+};
+
+const wtu = WebGLTestUtils;
+const gl = wtu.create3DContext();
+
+wtu.setupTexturedQuad(gl);
+gl.bindTexture(gl.TEXTURE_2D, gl.createTexture());
+
+(async () => {
+ for (const [type, testCase] of Object.entries(testData)) {
+ if (testCase.src.length != 2) throw new Error('testCase.src.length != 2');
+ let images = testCase.src.map(src => loadImage(src));
+ images = await Promise.all(images);
+ debug("");
+ debug("");
+ debug(`PNG image type ${type} with RGBA values of ${testCase.expectations[2].color}`);
+ let formats = testCase.expectations;
+ if (!wtu.isWebGL2(gl)) {
+ formats = formats.filter((f) => !f.internalformat);
+ }
+ for (const f of formats) {
+ debug("");
+ debug(`GL format: ${f.format}`);
+
+ function check(data, description) {
+ debug(`Upload ${description}`);
+ gl.texImage2D(
+ gl.TEXTURE_2D,
+ 0,
+ gl[f.internalformat || f.format],
+ gl[f.format],
+ gl.UNSIGNED_BYTE,
+ data
+ );
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, f.color, undefined, 1);
+ }
+
+ check(images[0].image, "8-bit PNG from Image");
+ check(images[1].image, "16-bit PNG from Image");
+
+ if (images[0].bitmap) {
+ check(images[0].bitmap, "8-bit PNG from ImageBitmap");
+ check(images[1].bitmap, "16-bit PNG from ImageBitmap");
+ }
+ }
+ }
+ finishTest();
+})();
+
+async function loadImage(src) {
+ const img = new Image();
+ img.src = src;
+ await img.decode();
+ const ret = { image: img };
+ if (self.createImageBitmap) {
+ try {
+ ret.bitmap = await createImageBitmap(img, {
+ premultiplyAlpha: "none",
+ });
+ } catch {}
+ }
+ return ret;
+}
+
+var successfullyParsed = true;
+ </script>
+</body>
+
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html
new file mode 100644
index 0000000000..34c94a68a7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html
@@ -0,0 +1,304 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="16" height="16"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Verifies texImage2D and texSubImage2D code paths taking ArrayBufferView');
+
+var wtu = WebGLTestUtils;
+
+function roundUpToAlignment(value, alignment) {
+ return Math.floor((value + alignment - 1) / alignment) * alignment;
+}
+
+function generateRGBAData(type, unpackAlignment, sourceData, width, height)
+{
+ var numColors = sourceData.length / 4;
+ var colorOffset = function(y) {
+ return 4 * Math.floor(y * numColors / height);
+ };
+
+ switch (type) {
+ case gl.UNSIGNED_BYTE: {
+ var rowWidth = roundUpToAlignment(width * 4, unpackAlignment);
+ var data = new Uint8Array(height * rowWidth);
+ for (var y = 0; y < height; ++y) {
+ var index = y * rowWidth;
+ var offset = colorOffset(y);
+ for (var element = 0; element < width * 4; ++element) {
+ data[index + element] = sourceData[offset + element % 4];
+ }
+ }
+ return data;
+ }
+ case gl.UNSIGNED_SHORT_4_4_4_4: {
+ var rowWidth = roundUpToAlignment(width * 2, unpackAlignment) / 2;
+ var data = new Uint16Array(height * rowWidth);
+ for (var y = 0; y < height; ++y) {
+ var offset = colorOffset(y);
+ for (var x = 0; x < width; ++x) {
+ var index = y * rowWidth + x;
+ data[index] = (((sourceData[offset + 0] & 0xF0) << 8)
+ | ((sourceData[offset + 1] & 0xF0) << 4)
+ | ((sourceData[offset + 2] & 0xF0) >> 0)
+ | ((sourceData[offset + 3] & 0xF0) >> 4));
+ }
+ }
+ return data;
+ }
+ case gl.UNSIGNED_SHORT_5_5_5_1: {
+ var rowWidth = roundUpToAlignment(width * 2, unpackAlignment) / 2;
+ var data = new Uint16Array(height * rowWidth);
+ for (var y = 0; y < height; ++y) {
+ var offset = colorOffset(y);
+ for (var x = 0; x < width; ++x) {
+ var index = y * rowWidth + x;
+ data[index] = (((sourceData[offset + 0] & 0xF8) << 8)
+ | ((sourceData[offset + 1] & 0xF8) << 3)
+ | ((sourceData[offset + 2] & 0xF8) >> 2)
+ | ((sourceData[offset + 3] & 0x80) >> 7));
+ }
+ }
+ return data;
+ }
+ }
+}
+
+function typeToString(type)
+{
+ switch (type) {
+ case gl.UNSIGNED_BYTE: return 'UNSIGNED_BYTE';
+ case gl.UNSIGNED_SHORT_5_5_5_1: return 'UNSIGNED_SHORT_5_5_5_1';
+ case gl.UNSIGNED_SHORT_4_4_4_4: return 'UNSIGNED_SHORT_4_4_4_4';
+ }
+ return 'Unknown type ' + type;
+}
+
+function runOneIteration(useTexSubImage2D, type, unpackAlignment, flipY, premultiplyAlpha,
+ topColor, bottomColor, extraColor, bindingTarget, program)
+{
+ debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') +
+ ' with type=' + typeToString(type) +
+ ', unpackAlignment=' + unpackAlignment +
+ ', flipY=' + flipY + ', premultiplyAlpha=' + premultiplyAlpha +
+ ', bindingTarget=' + (bindingTarget == gl.TEXTURE_2D ? 'TEXTURE_2D' : 'TEXTURE_CUBE_MAP'));
+ gl.colorMask(true, true, true, true);
+ gl.clearColor(0, 0, 0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ // Enable writes to the RGB channels
+ gl.colorMask(true, true, true, false);
+ var texture = gl.createTexture();
+ // Bind the texture to texture unit 0
+ gl.bindTexture(bindingTarget, texture);
+ // Set up texture parameters
+ gl.texParameteri(bindingTarget, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(bindingTarget, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(bindingTarget, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ // Set up pixel store parameters
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiplyAlpha);
+ // Generate the data
+ var sourceData = [ 255, 0, 0, 255,
+ 0, 255, 0, 0 ];
+ var texWidth = 5; // this must be mod 4 + 1 to test unpackAlignment
+ // cube map texture must be square.
+ if (bindingTarget == gl.TEXTURE_CUBE_MAP)
+ texWidth = 16;
+ var texHeight = 16;
+ var data = generateRGBAData(type, unpackAlignment, sourceData, texWidth, texHeight);
+ if (gl.getError() != gl.NO_ERROR)
+ testFailed("GL error before texture upload");
+ var targets = [gl.TEXTURE_2D];
+ if (bindingTarget == gl.TEXTURE_CUBE_MAP) {
+ targets = [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];
+ }
+ // Upload the image into the texture
+ for (var tt = 0; tt < targets.length; ++tt) {
+ if (useTexSubImage2D) {
+ // Initialize the texture to black first
+ gl.texImage2D(targets[tt], 0, gl.RGBA, texWidth, texHeight, 0,
+ gl.RGBA, type, null);
+ if (gl.getError() != gl.NO_ERROR)
+ testFailed("GL error after texImage2D(null)");
+ gl.texSubImage2D(targets[tt], 0, 0, 0, texWidth, texHeight, gl.RGBA, type, data);
+ if (gl.getError() != gl.NO_ERROR)
+ testFailed("GL error after texSubImage2D");
+ } else {
+ gl.texImage2D(targets[tt], 0, gl.RGBA, texWidth, texHeight, 0, gl.RGBA, type, data);
+ if (gl.getError() != gl.NO_ERROR)
+ testFailed("GL error after texImage2D");
+ }
+ }
+
+ var testWidth = gl.drawingBufferWidth;
+ var testHeight = gl.drawingBufferHeight / 2;
+
+ var loc;
+ if (bindingTarget == gl.TEXTURE_CUBE_MAP) {
+ loc = gl.getUniformLocation(program, "face");
+ }
+
+ for (var tt = 0; tt < targets.length; ++tt) {
+ if (bindingTarget == gl.TEXTURE_CUBE_MAP) {
+ gl.uniform1i(loc, targets[tt]);
+ }
+
+ // Draw the triangles
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+
+ // Check the top pixel and bottom pixel and make sure they have
+ // the right color.
+ var rects = [wtu.makeCheckRect(0, 0, testWidth, testHeight, bottomColor, "bottom pixel should be " + bottomColor, 0),
+ wtu.makeCheckRect(0, testHeight, testWidth, testHeight, topColor, "top pixel should be " + topColor, 0)];
+ wtu.checkCanvasRects(gl, rects);
+ }
+
+ // Change part of the texture.
+ var partWidth = 16;
+ var partHeight = 16;
+ // make texture double res of part.
+ var data = generateRGBAData(type, unpackAlignment, sourceData, partWidth * 2, partHeight * 2);
+ for (var tt = 0; tt < targets.length; ++tt) {
+ gl.texImage2D(targets[tt], 0, gl.RGBA, partWidth * 2, partHeight * 2, 0, gl.RGBA, type, data);
+ }
+ // set part.
+ var extraData = [
+ 255, 0, 0, 255,
+ 0, 0, 255, 0
+ ];
+ var data = generateRGBAData(type, unpackAlignment, extraData, partWidth, partHeight);
+ for (var tt = 0; tt < targets.length; ++tt) {
+ gl.texSubImage2D(targets[tt], 0, 0, 0, partWidth, partHeight, gl.RGBA, type, data);
+ }
+ var halfWidth = gl.drawingBufferWidth / 2;
+ var halfHeight = gl.drawingBufferHeight / 2;
+ var quarterHeight = gl.drawingBufferHeight / 4;
+ var red = [255, 0, 0, 255];
+ var tcolor0 = flipY ? extraColor : red;
+ var tcolor1 = flipY ? red : extraColor;
+
+ for (var tt = 0; tt < targets.length; ++tt) {
+ if (bindingTarget == gl.TEXTURE_CUBE_MAP) {
+ gl.uniform1i(loc, targets[tt]);
+ }
+
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ var rects = [wtu.makeCheckRect(0, 0, halfWidth, quarterHeight, tcolor0, "bottom left bottom pixels should be " + tcolor0, 0),
+ wtu.makeCheckRect(0, quarterHeight, halfWidth, quarterHeight, tcolor1, "bottom left top pixels should be " + tcolor1, 0),
+ wtu.makeCheckRect(halfWidth, 0, halfWidth, halfHeight, bottomColor, "bottom right pixels should be " + bottomColor, 0),
+ wtu.makeCheckRect(0, halfHeight, testWidth, halfHeight, topColor, "top pixels should be " + topColor, 0)];
+ wtu.checkCanvasRects(gl, rects);
+ }
+
+ // set far corner.
+ for (var tt = 0; tt < targets.length; ++tt) {
+ gl.texSubImage2D(targets[tt], 0, partWidth, partHeight, partWidth, partHeight, gl.RGBA, type, data);
+ }
+ for (var tt = 0; tt < targets.length; ++tt) {
+ if (bindingTarget == gl.TEXTURE_CUBE_MAP) {
+ gl.uniform1i(loc, targets[tt]);
+ }
+
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ var rects = [wtu.makeCheckRect(0, 0, halfWidth, quarterHeight, tcolor0, "bottom left bottom pixels should be " + tcolor0, 0),
+ wtu.makeCheckRect(0, quarterHeight, halfWidth, quarterHeight, tcolor1, "bottom left top pixels should be " + tcolor1, 0),
+ wtu.makeCheckRect(halfWidth, 0, halfWidth, halfHeight, bottomColor, "bottom left pixels should be " + bottomColor, 0),
+ wtu.makeCheckRect(0, halfHeight, halfWidth, halfHeight, topColor, "top right pixels should be " + topColor, 0),
+ wtu.makeCheckRect(halfWidth, halfHeight, halfWidth, quarterHeight, tcolor0, "top right bottom pixels should be " + tcolor0, 0),
+ wtu.makeCheckRect(halfWidth, halfHeight + quarterHeight, halfWidth, quarterHeight, tcolor1, "top right top pixels should be " + tcolor1, 0)];
+ wtu.checkCanvasRects(gl, rects);
+ }
+}
+
+function runTest(bindingTarget, program)
+{
+ var red = [255, 0, 0, 255];
+ var green = [0, 255, 0, 255];
+ var blue = [0, 0, 255, 255];
+ var redPremultiplyAlpha = [255, 0, 0, 255];
+ var greenPremultiplyAlpha = [0, 0, 0, 255];
+ var bluePremultiplyAlpha = [0, 0, 0, 255];
+
+ var types = [ gl.UNSIGNED_BYTE, gl.UNSIGNED_SHORT_5_5_5_1, gl.UNSIGNED_SHORT_4_4_4_4 ];
+ var unpackAlignments = [ 1, 2, 4, 8 ];
+
+ var cases = [
+ { sub: false, flipY: true, premultiplyAlpha: false, topColor: red, bottomColor: green, extraColor: blue },
+ { sub: false, flipY: false, premultiplyAlpha: false, topColor: green, bottomColor: red, extraColor: blue },
+ { sub: false, flipY: true, premultiplyAlpha: true, topColor: redPremultiplyAlpha, bottomColor: greenPremultiplyAlpha, extraColor: bluePremultiplyAlpha },
+ { sub: false, flipY: false, premultiplyAlpha: true, topColor: greenPremultiplyAlpha, bottomColor: redPremultiplyAlpha, extraColor: bluePremultiplyAlpha },
+ { sub: true, flipY: true, premultiplyAlpha: false, topColor: red, bottomColor: green, extraColor: blue },
+ { sub: true, flipY: false, premultiplyAlpha: false, topColor: green, bottomColor: red, extraColor: blue },
+ { sub: true, flipY: true, premultiplyAlpha: true, topColor: redPremultiplyAlpha, bottomColor: greenPremultiplyAlpha, extraColor: bluePremultiplyAlpha },
+ { sub: true, flipY: false, premultiplyAlpha: true, topColor: greenPremultiplyAlpha, bottomColor: redPremultiplyAlpha, extraColor: bluePremultiplyAlpha },
+ ];
+
+ for (var i in types) {
+ for (var j in unpackAlignments) {
+ for (var k in cases) {
+ runOneIteration(cases[k].sub, types[i], unpackAlignments[j], cases[k].flipY, cases[k].premultiplyAlpha,
+ cases[k].topColor, cases[k].bottomColor, cases[k].extraColor, bindingTarget, program);
+ }
+ }
+ }
+}
+
+var gl = wtu.create3DContext("example");
+
+var program = wtu.setupTexturedQuad(gl);
+runTest(gl.TEXTURE_2D, program);
+program = wtu.setupTexturedQuadWithCubeMap(gl);
+runTest(gl.TEXTURE_CUBE_MAP, program);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+
+const tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+
+const validDatas = [
+ `new Uint8Array(4)`,
+ `new Uint8Array(new ArrayBuffer(4))`,
+ `new Uint8ClampedArray(4)`,
+ `new Uint8ClampedArray(new ArrayBuffer(4))`,
+];
+if (window.SharedArrayBuffer) {
+ validDatas.push(
+ `new Uint8Array(new SharedArrayBuffer(4))`,
+ `new Uint8ClampedArray(new SharedArrayBuffer(4))`
+ );
+}
+for (const x of validDatas) {
+ shouldNotThrow(`gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1,1, 0, gl.RGBA, gl.UNSIGNED_BYTE, ${x});`);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+ shouldNotThrow(`gl.texSubImage2D(gl.TEXTURE_2D, 0, 0,0, 1,1, gl.RGBA, gl.UNSIGNED_BYTE, ${x});`);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html
new file mode 100644
index 0000000000..292f94a8b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-and-uniform-binding-bugs.html
@@ -0,0 +1,44 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+description('Tests passing a vec4 to a uniform and a canvas to texImage2D');
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var floatProgram = wtu.loadProgramFromFile(gl, "../../../resources/floatUniformShader.vert", "../../../resources/noopUniformShader.frag");
+shouldBeUndefined("gl.useProgram(floatProgram)");
+var fval4Loc = gl.getUniformLocation(floatProgram, "fval4");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+shouldBeUndefined("gl.uniform4fv(fval4Loc, new Float32Array([0.1, 0.2, 0.4, 1.0]));");
+
+var tmpcanvas = document.createElement("canvas");
+tmpcanvas.width = 2;
+tmpcanvas.height = 2;
+var texture = gl.createTexture();
+shouldBeUndefined("gl.bindTexture(gl.TEXTURE_2D, texture)");
+shouldBeUndefined("gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, tmpcanvas)");
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html
new file mode 100644
index 0000000000..4277917644
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-canvas-corruption.html
@@ -0,0 +1,51 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Testing 3D canvas is usable after being used as texImage2D source</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="512" height="512"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+// Regression test for http://crbug.com/368582
+description();
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var ctx = canvas.getContext("2d");
+
+var gl = wtu.create3DContext();
+var texture = gl.createTexture();
+
+var image = wtu.makeImage('../../../resources/blue-1x1.jpg', function() {
+ renderToCanvas();
+ renderToCanvas();
+ wtu.checkCanvas(ctx, [0, 0, 255, 255], "All pixels should be blue", 2);
+ finishTest();
+});
+
+function renderToCanvas() {
+ // Clear the 2d canvas then draw the image to it (a blue pixel)
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+ ctx.drawImage(image, 0, 0, canvas.width, canvas.height);
+
+ // Upload the results to a WebGL texture
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html
new file mode 100644
index 0000000000..653f8d9820
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-webgl.html
@@ -0,0 +1,78 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texImage2D from WebGL conformance 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>
+</head>
+<body>
+<canvas id="example" width="256" height="16" style="width: 256px; height: 48px;"></canvas>
+<canvas id="source" width="256" height="16" style="width: 256px; height: 48px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Test texImage2D from a webgl canvas.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+gl.disable(gl.DITHER);
+var program = wtu.setupTexturedQuad(gl);
+var gl1 = wtu.create3DContext("source");
+gl1.disable(gl.DITHER);
+gl1.disable(gl.BLEND);
+gl1.disable(gl.DEPTH_TEST);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+wtu.glErrorShouldBe(gl1, gl1.NO_ERROR, "Should be no errors from setup.");
+
+gl.disable(gl.BLEND);
+gl.disable(gl.DEPTH_TEST);
+
+gl1.clearColor(1.0, 0.0, 0.0, 1.0);
+gl1.clear(gl1.COLOR_BUFFER_BIT);
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, gl1.canvas);
+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_MAG_FILTER, gl.LINEAR);
+gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+wtu.clearAndDrawUnitQuad(gl);
+
+wtu.checkCanvas(gl, [255, 0, 0, 255], "Canvas should be red");
+
+gl1.clearColor(0.0, 1.0, 0.0, 1.0);
+gl1.clear(gl1.COLOR_BUFFER_BIT);
+
+var program1 = wtu.setupTexturedQuad(gl1);
+var tex1 = gl1.createTexture();
+gl1.bindTexture(gl.TEXTURE_2D, tex1);
+gl1.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, 1, 1, 0, gl.RGB, gl.UNSIGNED_BYTE, new Uint8Array([0, 0, 255]));
+
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, gl1.canvas);
+wtu.clearAndDrawUnitQuad(gl);
+
+wtu.checkCanvas(gl, [0, 255, 0, 255], "Canvas should be green");
+
+// Test a scenario from Chrome where a WebGL context would lose its active texture binding when its
+// canvas was used as the texture source for another WebGL context.
+wtu.clearAndDrawUnitQuad(gl1);
+
+wtu.checkCanvas(gl1, [0, 0, 255, 255], "Canvas should be blue");
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html
new file mode 100644
index 0000000000..1fbf4c6ccb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-format-and-type.html
@@ -0,0 +1,722 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/pnglib.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = null;
+var textureLoc = null;
+var successfullyParsed = false;
+
+//----------------------------------------------------------------------
+// Harness
+
+var testCases = [];
+
+var DataMode = {
+ IMAGE: 0,
+ IMAGE_DATA: 1,
+
+ NUM_HTML_MODES: 2,
+
+ RAW_DATA: 2,
+
+ // This must remain the last mode.
+ NUM_MODES: 3
+};
+
+function init()
+{
+ description('Verify texImage2D and texSubImage2D code paths taking both HTML and user-specified data with all format/type combinations');
+
+ var canvas = document.getElementById("example");
+ gl = wtu.create3DContext(canvas);
+ gl.disable(gl.DITHER);
+ var program = wtu.setupTexturedQuad(gl);
+
+ gl.clearColor(0,0,0,1);
+ gl.clearDepth(1);
+ gl.disable(gl.BLEND);
+
+ textureLoc = gl.getUniformLocation(program, "tex");
+
+ initializeTests();
+}
+
+function initializeTests()
+{
+ // Verify that uploading to packed pixel formats performs the
+ // required conversion and associated loss of precision.
+ for (var dataMode = 0; dataMode < DataMode.NUM_HTML_MODES; ++dataMode) {
+ for (var useTexSubImage2D = 0; useTexSubImage2D < 2; ++useTexSubImage2D) {
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateOpaqueGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.RGBA,
+ type: gl.UNSIGNED_BYTE,
+ verifier: allChannelsIncreaseByNoMoreThan,
+ threshold: 1,
+ numOccurrences: 1,
+ description: "RGBA/UNSIGNED_BYTE should maintain full precision of data"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateOpaqueGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.RGBA,
+ type: gl.UNSIGNED_SHORT_4_4_4_4,
+ verifier: allChannelsIncreaseByAtLeast,
+ threshold: 15,
+ numOccurrences: 10,
+ description: "RGBA/UNSIGNED_SHORT_4_4_4_4 must drop low four bits of precision"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateOpaqueGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.RGBA,
+ type: gl.UNSIGNED_SHORT_5_5_5_1,
+ verifier: allChannelsIncreaseByAtLeast,
+ threshold: 7,
+ numOccurrences: 20,
+ description: "RGBA/UNSIGNED_SHORT_5_5_5_1 must drop low three bits of precision"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateOpaqueGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.RGB,
+ type: gl.UNSIGNED_BYTE,
+ verifier: allChannelsIncreaseByNoMoreThan,
+ threshold: 1,
+ numOccurrences: 1,
+ description: "RGB/UNSIGNED_BYTE should maintain full precision of data"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateOpaqueGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.RGB,
+ type: gl.UNSIGNED_SHORT_5_6_5,
+ verifier: allChannelsIncreaseByAtLeast,
+ threshold: 3,
+ numOccurrences: 20,
+ description: "RGB/UNSIGNED_SHORT_5_6_5 must drop low two or three bits of precision"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTranslucentGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.ALPHA,
+ type: gl.UNSIGNED_BYTE,
+ verifier: alphaChannelIncreasesByNoMoreThan,
+ threshold: 1,
+ numOccurrences: 1,
+ description: "ALPHA/UNSIGNED_BYTE should maintain full precision of data"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateOpaqueGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.LUMINANCE,
+ type: gl.UNSIGNED_BYTE,
+ verifier: allChannelsIncreaseByNoMoreThan,
+ threshold: 1,
+ numOccurrences: 1,
+ description: "LUMINANCE/UNSIGNED_BYTE should maintain full precision of data"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateOpaqueGrayscaleRamp,
+ premultiplyAlpha: false,
+ format: gl.LUMINANCE_ALPHA,
+ type: gl.UNSIGNED_BYTE,
+ verifier: allChannelsIncreaseByNoMoreThan,
+ threshold: 1,
+ numOccurrences: 1,
+ description: "LUMINANCE_ALPHA/UNSIGNED_BYTE should maintain full precision of data"
+ });
+ }
+ }
+
+ // Verify that setting the UNPACK_PREMULTIPLY_ALPHA_WEBGL pixel
+ // store parameter and sending down a zero alpha causes the color
+ // channels to go to zero.
+ for (var dataMode = 0; dataMode < DataMode.NUM_MODES; ++dataMode) {
+ for (var useTexSubImage2D = 0; useTexSubImage2D < 2; ++useTexSubImage2D) {
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.RGBA,
+ type: gl.UNSIGNED_BYTE,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGBA/UNSIGNED_BYTE"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.RGBA,
+ type: gl.UNSIGNED_SHORT_4_4_4_4,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGBA/UNSIGNED_SHORT_4_4_4_4"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.RGBA,
+ type: gl.UNSIGNED_SHORT_5_5_5_1,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGBA/UNSIGNED_SHORT_5_5_5_1"
+ });
+ // The following few tests are invalid for the raw data
+ // mode because there is either no alpha channel or no
+ // separate alpha channel.
+ if (dataMode != DataMode.RAW_DATA) {
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.RGB,
+ type: gl.UNSIGNED_BYTE,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGB/UNSIGNED_BYTE"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.RGB,
+ type: gl.UNSIGNED_SHORT_5_6_5,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with RGB/UNSIGNED_SHORT_5_6_5"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.ALPHA,
+ type: gl.UNSIGNED_BYTE,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with ALPHA/UNSIGNED_BYTE"
+ });
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.LUMINANCE,
+ type: gl.UNSIGNED_BYTE,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with LUMINANCE/UNSIGNED_BYTE"
+ });
+ }
+ testCases.push({
+ dataMode: dataMode,
+ useTexSubImage2D: !!useTexSubImage2D,
+ width: 256,
+ height: 1,
+ generator: generateTransparentGrayscaleRamp,
+ premultiplyAlpha: true,
+ format: gl.LUMINANCE_ALPHA,
+ type: gl.UNSIGNED_BYTE,
+ verifier: colorChannelsAreZero,
+ description: "UNPACK_PREMULTIPLY_ALPHA_WEBGL with LUMINANCE_ALPHA/UNSIGNED_BYTE"
+ });
+ }
+ }
+
+ // Produce data for all testcases. Because we load images, some of
+ // these may generate their data asynchronously.
+ generateTestData();
+}
+
+function generateTestData()
+{
+ for (var i = 0; i < testCases.length; i++) {
+ var testCase = testCases[i];
+ var wrapper = null;
+ switch (testCase.dataMode) {
+ case DataMode.IMAGE:
+ wrapper = new ImageWrapper(testCase.width, testCase.height);
+ break;
+ case DataMode.IMAGE_DATA:
+ wrapper = new ImageDataWrapper(testCase.width, testCase.height);
+ break;
+ case DataMode.RAW_DATA:
+ switch (testCase.type) {
+ case gl.UNSIGNED_BYTE:
+ switch (testCase.format) {
+ case gl.RGBA:
+ wrapper = new RGBA8DataWrapper(testCase.width, testCase.height);
+ break;
+ case gl.RGB:
+ wrapper = new RGB8DataWrapper(testCase.width, testCase.height);
+ break;
+ case gl.ALPHA:
+ wrapper = new A8DataWrapper(testCase.width, testCase.height);
+ break;
+ case gl.LUMINANCE:
+ wrapper = new L8DataWrapper(testCase.width, testCase.height);
+ break;
+ case gl.LUMINANCE_ALPHA:
+ wrapper = new LA8DataWrapper(testCase.width, testCase.height);
+ break;
+ }
+ break;
+ case gl.UNSIGNED_SHORT_4_4_4_4:
+ wrapper = new RGBA4444DataWrapper(testCase.width, testCase.height);
+ break;
+ case gl.UNSIGNED_SHORT_5_5_5_1:
+ wrapper = new RGBA5551DataWrapper(testCase.width, testCase.height);
+ break;
+ case gl.UNSIGNED_SHORT_5_6_5:
+ wrapper = new RGB565DataWrapper(testCase.width, testCase.height);
+ break;
+ }
+ }
+ testCase.wrapper = wrapper;
+ testCase.generator(wrapper);
+ testCase.wrapper.generateData();
+ }
+
+ // See whether we need to run the tests, in case all of them
+ // generated their results synchronously.
+ maybeRunTests();
+}
+
+var ranTests = false;
+
+function maybeRunTests()
+{
+ if (!ranTests)
+ for (var i = 0; i < testCases.length; ++i)
+ if (!testCases[i].wrapper || !testCases[i].wrapper.data)
+ return;
+
+ ranTests = true;
+
+ for (var i = 0; i < testCases.length; ++i)
+ runOneTest(testCases[i]);
+
+ finishTest();
+}
+
+function testCaseToString(testCase)
+{
+ var mode;
+ switch (testCase.dataMode) {
+ case DataMode.IMAGE:
+ mode = "Image";
+ break;
+ case DataMode.IMAGE_DATA:
+ mode = "ImageData";
+ break;
+ case DataMode.RAW_DATA:
+ mode = "raw data";
+ break;
+ }
+ return (testCase.useTexSubImage2D ? "texSubImage2D" : "texImage2D") +
+ " with " + mode + " at " + testCase.width + "x" + testCase.height;
+}
+
+function runOneTest(testCase)
+{
+ debug("Testing " + testCaseToString(testCase));
+ var data = testCase.wrapper.data;
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ var texture = gl.createTexture();
+ // Bind the texture to texture unit 0.
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ // Set up texture parameters.
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ // Set up pixel store parameters.
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, testCase.premultiplyAlpha);
+ // Upload the image into the texture.
+ if (testCase.useTexSubImage2D) {
+ // Initialize the texture to black first.
+ gl.texImage2D(gl.TEXTURE_2D, 0, testCase.format, testCase.width, testCase.height, 0,
+ testCase.format, testCase.type, null);
+ }
+ switch (testCase.dataMode) {
+ case DataMode.IMAGE:
+ case DataMode.IMAGE_DATA:
+ if (testCase.useTexSubImage2D)
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, testCase.format, testCase.type, data);
+ else
+ gl.texImage2D(gl.TEXTURE_2D, 0, testCase.format, testCase.format, testCase.type, data);
+ break;
+ case DataMode.RAW_DATA:
+ if (testCase.useTexSubImage2D)
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, testCase.width, testCase.height, testCase.format, testCase.type, data);
+ else
+ gl.texImage2D(gl.TEXTURE_2D, 0, testCase.format, testCase.width, testCase.height, 0, testCase.format, testCase.type, data);
+ break;
+ }
+ // Point the uniform sampler to texture unit 0.
+ gl.uniform1i(textureLoc, 0);
+ // Draw the triangles.
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ // Clean up the texture.
+ gl.deleteTexture(texture);
+
+ // Read back the rendering results.
+ var buf = new Uint8Array(testCase.width * testCase.height * 4);
+ gl.readPixels(0, 0, testCase.width, testCase.height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ // Run the verification routine.
+ if (testCase.verifier(buf, testCase.threshold, testCase.numOccurrences))
+ testPassed(testCase.description);
+ else
+ testFailed(testCase.description);
+}
+
+//----------------------------------------------------------------------
+// Wrappers for programmatic construction of Image, ImageData and raw texture data
+//
+
+function ImageWrapper(width, height)
+{
+ this.pngBuilder_ = new PNGlib(width, height, 256);
+}
+
+ImageWrapper.prototype.getWidth = function() {
+ return this.pngBuilder_.width;
+};
+
+ImageWrapper.prototype.getHeight = function() {
+ return this.pngBuilder_.height;
+};
+
+ImageWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ this.pngBuilder_.buffer[this.pngBuilder_.index(x, y)] = this.pngBuilder_.color(r, g, b, a);
+};
+
+// Generates data into "data" property, possibly asynchronously.
+ImageWrapper.prototype.generateData = function() {
+ var that = this;
+ var url = "data:image/png;base64," + this.pngBuilder_.getBase64();
+ var img = wtu.makeImage(url, function() {
+ that.data = img;
+ maybeRunTests();
+ });
+};
+
+function ImageDataWrapper(width, height)
+{
+ if (!ImageDataWrapper.tempCanvas) {
+ ImageDataWrapper.tempCanvas = document.createElement("canvas");
+ }
+ this.imageData_ = ImageDataWrapper.tempCanvas.getContext("2d").createImageData(width, height);
+}
+
+ImageDataWrapper.tempCanvas = null;
+
+ImageDataWrapper.prototype.getWidth = function() {
+ return this.imageData_.width;
+};
+
+ImageDataWrapper.prototype.getHeight = function() {
+ return this.imageData_.height;
+};
+
+ImageDataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ var index = 4 * (this.imageData_.width * y + x);
+ this.imageData_.data[index] = r;
+ this.imageData_.data[index + 1] = g;
+ this.imageData_.data[index + 2] = b;
+ this.imageData_.data[index + 3] = a;
+};
+
+ImageDataWrapper.prototype.generateData = function() {
+ this.data = this.imageData_;
+ maybeRunTests();
+};
+
+function TextureDataWrapper(width, height)
+{
+ this.width_ = width;
+ this.height_ = height;
+}
+
+TextureDataWrapper.prototype.getWidth = function() {
+ return this.width_;
+};
+
+TextureDataWrapper.prototype.getHeight = function() {
+ return this.height_;
+};
+
+TextureDataWrapper.prototype.generateData = function() {
+ this.data = this.data_;
+ maybeRunTests();
+};
+
+function RGBA8DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint8Array(4 * width * height);
+}
+
+RGBA8DataWrapper.prototype = new TextureDataWrapper;
+
+RGBA8DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ var index = 4 * (this.width_ * y + x);
+ this.data_[index] = r;
+ this.data_[index + 1] = g;
+ this.data_[index + 2] = b;
+ this.data_[index + 3] = a;
+};
+
+function RGBA5551DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint16Array(width * height);
+}
+
+RGBA5551DataWrapper.prototype = new TextureDataWrapper;
+
+RGBA5551DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ var value = (((r & 0xF8) << 8)
+ | ((g & 0xF8) << 3)
+ | ((b & 0xF8) >> 2)
+ | (a >> 7));
+ this.data_[this.width_ * y + x] = value;
+};
+
+function RGBA4444DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint16Array(width * height);
+}
+
+RGBA4444DataWrapper.prototype = new TextureDataWrapper;
+
+RGBA4444DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ var value = (((r & 0xF0) << 8)
+ | ((g & 0xF0) << 4)
+ | (b & 0xF0)
+ | (a >> 4));
+ this.data_[this.width_ * y + x] = value;
+};
+
+function RGB8DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint8Array(3 * width * height);
+}
+
+RGB8DataWrapper.prototype = new TextureDataWrapper;
+
+RGB8DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ var index = 3 * (this.width_ * y + x);
+ this.data_[index] = r;
+ this.data_[index + 1] = g;
+ this.data_[index + 2] = b;
+};
+
+function RGB565DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint16Array(width * height);
+}
+
+RGB565DataWrapper.prototype = new TextureDataWrapper;
+
+RGB565DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ var value = (((r & 0xF8) << 8)
+ | ((g & 0xFC) << 3)
+ | ((b & 0xF8) >> 3));
+ this.data_[this.width_ * y + x] = value;
+};
+
+function A8DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint8Array(width * height);
+}
+
+A8DataWrapper.prototype = new TextureDataWrapper;
+
+A8DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ this.data_[this.width_ * y + x] = a;
+};
+
+function L8DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint8Array(width * height);
+}
+
+L8DataWrapper.prototype = new TextureDataWrapper;
+
+L8DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ this.data_[this.width_ * y + x] = r;
+};
+
+function LA8DataWrapper(width, height)
+{
+ TextureDataWrapper.call(this, width, height);
+ this.data_ = new Uint8Array(2 * width * height);
+}
+
+LA8DataWrapper.prototype = new TextureDataWrapper;
+
+LA8DataWrapper.prototype.setPixel = function(x, y, r, g, b, a) {
+ var index = 2 * (this.width_ * y + x);
+ this.data_[index] = r;
+ this.data_[index + 1] = a;
+};
+
+//----------------------------------------------------------------------
+// Color ramp generation functions
+//
+
+function generateOpaqueGrayscaleRamp(wrapper)
+{
+ var width = wrapper.getWidth();
+ var height = wrapper.getHeight();
+ for (var x = 0; x < width; ++x) {
+ var value = Math.round(255.0 * x / width);
+ for (var y = 0; y < height; ++y)
+ wrapper.setPixel(x, y, value, value, value, 255);
+ }
+}
+
+function generateTranslucentGrayscaleRamp(wrapper)
+{
+ var width = wrapper.getWidth();
+ var height = wrapper.getHeight();
+ for (var x = 0; x < width; ++x) {
+ var value = Math.round(255.0 * x / width);
+ for (var y = 0; y < height; ++y)
+ wrapper.setPixel(x, y, value, value, value, value);
+ }
+}
+
+function generateTransparentGrayscaleRamp(wrapper)
+{
+ var width = wrapper.getWidth();
+ var height = wrapper.getHeight();
+ for (var x = 0; x < width; ++x) {
+ var value = Math.round(255.0 * x / width);
+ for (var y = 0; y < height; ++y)
+ wrapper.setPixel(x, y, value, value, value, 0);
+ }
+}
+
+//----------------------------------------------------------------------
+// Verification routines
+//
+
+function allChannelsIncreaseByNoMoreThan(array, threshold, numOccurrences) {
+ var numFound = 0;
+ for (var i = 4; i < array.length; i += 4)
+ for (var j = 0; j < 4; j++)
+ if (array[i + j] - array[i + j - 4] > threshold)
+ ++numFound;
+
+ return numFound < numOccurrences;
+}
+
+function alphaChannelIncreasesByNoMoreThan(array, threshold, numOccurrences) {
+ var numFound = 0;
+ for (var i = 7; i < array.length; i += 4)
+ if (array[i] - array[i - 4] > threshold)
+ ++numFound;
+
+ return numFound < numOccurrences;
+}
+
+function allChannelsIncreaseByAtLeast(array, threshold, numOccurrences) {
+ var numFound = 0;
+ for (var i = 4; i < array.length; i += 4)
+ for (var j = 0; j < 4; ++j)
+ if (array[i + j] - array[i + j - 4] > threshold)
+ ++numFound;
+
+ return numFound > numOccurrences;
+}
+
+function colorChannelsAreZero(array, threshold, numOccurrences) {
+ var passed = true;
+ var numFailures = 0;
+
+ for (var i = 4; i < array.length; i += 4)
+ for (var j = 0; j < 3; ++j)
+ if (array[i + j] != 0) {
+ passed = false;
+ if (++numFailures <= 5)
+ debug(" array[" + (i + j) + "] should have been 0, was " + array[i + j]);
+ }
+
+ return passed;
+}
+
+</script>
+</head>
+<body onload="init()">
+<canvas id="example" width="256" height="1"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html
new file mode 100644
index 0000000000..4500624c81
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-image-with-invalid-data.html
@@ -0,0 +1,158 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+ <title>texImage2D and texSubImage2D tests with invalid data</title>
+ <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+ <script src="../../../js/js-test-pre.js"></script>
+ <script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script type="application/javascript">
+description("texImage2D and texSubImage2D tests with invalid data");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("canvas");
+var contextVersion = wtu.getDefault3DContextVersion();
+var gl = wtu.create3DContext(canvas);
+if (!gl)
+ testFailed("Context created.");
+else
+ testPassed("Context created.");
+
+var tex;
+
+function setup() {
+ tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+}
+
+function teardown() {
+ gl.deleteTexture(tex);
+}
+
+function test(desc, func, expected) {
+ debug(desc);
+
+ var exc = null;
+ try {
+ func();
+ } catch (x) {
+ exc = x;
+ }
+
+ if (expected == gl.INVALID_OPERATION) {
+ wtu.glErrorShouldBe(gl, expected);
+ } else if (expected == "exception") {
+ if (exc) {
+ testPassed("threw exception");
+ } else {
+ testFailed("did not throw exception");
+ }
+ }
+}
+
+test("Calling texImage2D with no WebGLTexture bound generates INVALID_OPERATION",
+ function () {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ },
+ gl.INVALID_OPERATION);
+
+test("Calling texSubImage2D with no WebGLTexture bound generates INVALID_OPERATION",
+ function () {
+ var buffer = new Uint8Array(4);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buffer);
+ },
+ gl.INVALID_OPERATION);
+
+setup();
+
+test("Passing a buffer not large enough to texImage2D should generate an INVALID_OPERATION",
+ function () {
+ var tooSmall = new Uint8Array(64);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, tooSmall);
+ },
+ gl.INVALID_OPERATION);
+
+if (contextVersion < 2) {
+ test("Passing texImage2D parameter data of Number type should throw an exception",
+ function () {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, 42);
+ },
+ "exception");
+} else {
+ test("Passing texImage2D parameter data of Number type should generate an INVALID_OPERATION",
+ function () {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, 42);
+ },
+ gl.INVALID_OPERATION);
+}
+
+if (contextVersion < 2) {
+ test("Passing texImage2D parameter data of String type should throw a TypeError",
+ function () {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
+ },
+ "exception");
+} else {
+ test("Passing texImage2D parameter data of String type should generate an INVALID_OPERATION",
+ function () {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 64, 64, 0, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
+ },
+ gl.INVALID_OPERATION);
+}
+
+test("Passing a buffer not large enough to texSubImage2D should generate an INVALID_OPERATION",
+ function () {
+ var tooSmall = new Uint8Array(64);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, tooSmall);
+ },
+ gl.INVALID_OPERATION);
+
+if (contextVersion < 2) {
+ test("Passing texSubImage2D parameter data of Number type should throw a TypeError",
+ function () {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, 42);
+ },
+ "exception");
+} else {
+ test("Passing texSubImage2D parameter data of Number type should generate an INVALID_OPERATION",
+ function () {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, 42);
+ },
+ gl.INVALID_OPERATION);
+}
+
+if (contextVersion < 2) {
+ test("Passing texSubImage2D parameter data of String type should throw a TypeError",
+ function () {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
+ },
+ "exception");
+} else {
+ test("Passing texSubImage2D parameter data of String type should generate an INVALID_OPERATION",
+ function () {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 64, 64, gl.RGBA, gl.UNSIGNED_BYTE, "not a buffer");
+ },
+ gl.INVALID_OPERATION);
+}
+
+teardown();
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html
new file mode 100644
index 0000000000..b0910422f5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-input-validation.html
@@ -0,0 +1,24 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+var contextVersion = 1;
+</script>
+<script src="../../../js/tests/tex-input-validation.js"></script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html
new file mode 100644
index 0000000000..8cbd00cce9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d-bad-args.html
@@ -0,0 +1,133 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="testbed" width="16" height="16"></canvas>
+<canvas id="c" width="16" height="16"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Tests texSubImage2D with bad arguments');
+
+var wtu = WebGLTestUtils;
+var contextVersion = wtu.getDefault3DContextVersion();
+var c = document.getElementById("c");
+
+var gl = wtu.create3DContext("testbed");
+var tex = gl.createTexture();
+var maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
+var maxTextureLevel = Math.floor(Math.log2(maxTextureSize)) + 1;
+
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 1, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "no previously defined texture image");
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Setup should succeed");
+
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 1, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "y + height > texture height");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "x + width > texture width");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, -1, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "negative x");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, -1, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "negative y");
+gl.texSubImage2D(gl.TEXTURE_2D, -1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "negative level");
+shouldThrow("gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, null)");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "null pixels");
+
+// GL_INVALID_VALUE may be generated if level is greater than log 2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE.
+// GL_INVALID_OPERATION is generated if the texture array has not been defined by a previous glTexImage2D or glCopyTexImage2D operation whose internalformat matches the format of glTexSubImage2D.
+gl.texSubImage2D(gl.TEXTURE_2D, maxTextureLevel + 1, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "too high level");
+
+gl.texSubImage2D(gl.FLOAT, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "bad target");
+if (contextVersion > 1) {
+ gl.texSubImage2D(gl.TEXTURE_3D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+ wtu.glErrorShouldBe(gl, gl.INVALID_ENUM, "bad target");
+}
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "good args");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original");
+if (contextVersion < 2) {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original");
+}
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "make texture RGB");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "format same as original RGB");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original RGB");
+if (contextVersion < 2) {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGB, gl.UNSIGNED_SHORT_5_6_5, c);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original RGB");
+}
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "make texture RGBA UNSIGNED_BYTE");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "format same as original");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original");
+if (contextVersion < 2) {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original");
+}
+
+// Large canvas will trigger GPU-to-GPU fast path in chrome,
+// while small canvas will go into normal path, i.e. read pixles from canvas then upload to texture.
+var largeCanvas = document.createElement("canvas");
+largeCanvas.width = 257;
+largeCanvas.height = 257;
+var largeCanvasContext = largeCanvas.getContext("2d");
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, largeCanvas);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "make texture RGBA UNSIGNED_BYTE");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "format same as original");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, c);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original");
+if (contextVersion < 2) {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, c);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original");
+}
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, largeCanvas);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "format same as original");
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, largeCanvas);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "format not same as original");
+if (contextVersion < 2) {
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_SHORT_4_4_4_4, largeCanvas);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "type not same as original");
+}
+
+var maxCubeMapTextureSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);
+var maxCubeMapTextureLevel = Math.floor(Math.log2(maxCubeMapTextureSize)) + 1;
+for (var f = 0; f < 6; f++) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + f, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, c);
+ gl.texSubImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + f, maxCubeMapTextureLevel + 1, 0, 0, gl.RGB, gl.UNSIGNED_BYTE, c);
+ wtu.glErrorShouldBe(gl, [gl.INVALID_VALUE, gl.INVALID_OPERATION], "too high level");
+ gl.deleteTexture(tex);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html
new file mode 100644
index 0000000000..0d72946613
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-sub-image-2d.html
@@ -0,0 +1,101 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform sampler2D tex;
+varying vec2 texCoord;
+
+void main()
+{
+ float intensity = texture2D(tex, texCoord).a;
+ gl_FragColor = vec4(intensity, intensity, intensity, 1.0);
+}
+</script>
+
+</head>
+<body>
+<canvas id="example" width="256" height="1"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Tests texSubImage2D upload path from Uint8Array');
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var gl = wtu.create3DContext(canvas);
+gl.disable(gl.DITHER);
+var program = wtu.setupProgram(
+ gl,
+ [wtu.simpleTextureVertexShader, "fshader"],
+ ['vPosition', 'texCoord0']);
+wtu.setupUnitQuad(gl);
+var textureWidth = 256;
+var textureHeight = 1;
+
+var textureLoc = gl.getUniformLocation(program, "tex");
+
+var texture = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, texture);
+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);
+// Allocate the texture object
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.ALPHA, textureWidth, textureHeight, 0, gl.ALPHA, gl.UNSIGNED_BYTE, null);
+// Prepare the image data
+var array = new Uint8Array(textureWidth);
+for (var i = 0; i < textureWidth; i++)
+ array[i] = i;
+// Fill the texture object with data -- this is actually the code path being tested
+gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, textureWidth, textureHeight, gl.ALPHA, gl.UNSIGNED_BYTE, array);
+
+// Clear and set up
+gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.useProgram(program);
+gl.uniform1i(textureLoc, 0);
+// Draw the texture to the frame buffer
+gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+// Read back the frame buffer
+var buf = new Uint8Array(textureWidth * textureHeight * 4);
+gl.readPixels(0, 0, textureWidth, textureHeight, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+
+// Verify the frame buffer's contents
+var passed = true;
+for (var i = 0; i < textureWidth; i++) {
+ var val = i;
+ if (buf[4 * i + 0] != val ||
+ buf[4 * i + 1] != val ||
+ buf[4 * i + 2] != val) {
+ testFailed("pixel at (" + i + ", 0) was (" +
+ buf[4 * i + 0] + ", " +
+ buf[4 * i + 1] + ", " +
+ buf[4 * i + 2] + "), should be (" +
+ val + ", " + val + ", " + val + ")");
+ passed = false;
+ break;
+ }
+}
+
+if (passed)
+ testPassed("");
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html
new file mode 100644
index 0000000000..ee9bad4341
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/tex-video-using-tex-unit-non-zero.html
@@ -0,0 +1,191 @@
+<!--
+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.
+-->
+
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Texture uploading from video through tex unit 1 bug</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="640" height="480"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<img id="src-image">
+<script id="shader-fs" type="x-shader/x-fragment">
+ precision mediump float;
+
+ uniform sampler2D uTexture0;
+ uniform sampler2D uTexture1;
+
+ varying vec2 vUV;
+
+ void main(void) {
+ vec4 texture0Color = texture2D(uTexture0, vUV);
+ vec4 texture1Color = texture2D(uTexture1, vUV);
+
+ gl_FragColor = mix(texture0Color, texture1Color, 0.5);
+ }
+</script>
+<script id="shader-vs" type="x-shader/x-vertex">
+ attribute vec3 aVertexPosition;
+ attribute vec2 aTextureCoord;
+
+ varying vec2 vUV;
+
+ void main(void) {
+ vUV = aTextureCoord;
+ gl_Position = vec4(aVertexPosition, 1.0);
+ }
+</script>
+
+<script>
+"use strict";
+
+(async function test() {
+ var wtu = WebGLTestUtils;
+ description("Regression test for crbug.com/676719");
+
+ var gl = wtu.create3DContext("example", {preserveDrawingBuffer: true});
+
+ if (!gl) {
+ testFailed("context does not exist");
+ finishTest();
+ return;
+ }
+
+ var program = wtu.setupProgram(gl, ["shader-vs", "shader-fs"],
+ ["aVertexPosition", "aTextureCoord"], [0, 1]);
+
+ if (!program) {
+ testFailed("program does not exist");
+ finishTest();
+ return;
+ }
+
+ var loc0 = gl.getUniformLocation(program, "uTexture0");
+ var loc1 = gl.getUniformLocation(program, "uTexture1");
+ if (!loc0 || !loc1) {
+ testFailed("Failed to query uniform locations");
+ finishTest();
+ return;
+ }
+ gl.uniform1i(loc0, 0);
+ gl.uniform1i(loc1, 1);
+
+ wtu.setupUnitQuad(gl, 0, 1);
+
+ // Load textures
+ var imageSrc = "data:type/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AwVEx4QrzHJHAAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAABm4SURBVHja7d15eN11nejxT3KSnGxN2qbpku5JWwpdkIIszuCwWWxlExFx7kVleUYF1OHqPMgz3AsyzAVRmasiijrORR2duV4Z2gLKUugIc1kKLWhZuqTQtE26pm3S7Nv9Q6cPe5vfSdq05/V6Hv6g7e8sv3PO97zPb/n+cqpufbovAICskmsVAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAAAQAFYBAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAABYBUAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAANkq70h4Epu/elJWvFjjb3vGOxbIekV5OTF3bEnMqyqN4/70X1VZ2tiajQEAwJEpJ/pixqiifV/27xtXGkeNKoq8lA3YAgAOA5lspbLlh2wypiQv3ldVuu8L/9ixJVGa9lUlAAA4oq34wvFWwkFiGwoACAAAQAAAAAIAABAAAIAAAAAEAAAwZJkHAIDDyt6O7vj9lpZYWd8SK+qbY2X9XvMHZGsADMZMaZleX8DsbQCZ6+7pjTU722Jl/d4//dcSq3e0Rl/kWDkCAIAjRUNTR6xs2Bsr/vRl/2LD3mjr7nvLv/LlLwAAOKKccNcLVoIAIKmRRamYO7YkZo8piemjimLcsIIYW1oQ5YWpKMzLjcK83Ojp64u2rt5o6eyNhubO2NzUEWvfsJltT0evFQkJDSvIjTNrhse88aVx1KjimDw8HaXpVJQWpKKnty9au3qisbU76vZ0xKW/WmMMQACQ3FGjCuP8Y0bFmdXlMXts6QG98Om8VAwvihhfno4TYti+v+vu6Y3lm5vjwdW74tertg/oQPC/PlIdH59TmWjZ2p2tMf8nq6K9py+jx1CYlxMPXzYnaiqKEi3/f/6wPa59YP3b/jzT40bezWBfSfBQX6nwUNz/YN3n8VUlcfXJVXF6dXkU5KXe8d/kpyIK81Mxsrggxg0ryLoxAAHAAMiJvjj/6Iq4/ISxcfz4YQP3pkjlximTyuOUSeVx/V9MjHtf2hHf/n+bo765K+Pbvv6h12JeVUnUVBT3e9maiuK44YxJccMjGzJ6DDeeMTnxl//aHa1x/UOvefPxJmNK8uL2BdVx1rQR/fsM52TfGMDQYR6Aw9TpU8vj0cvnxPfOnz6gH/y3Ki5IxX89bkz87q+Ojes+OCEKMnzHtHX3xefuWxftXT2Jlv/0caPjzycnf75nVJfHp+aNSfbYu3r++Ni7+7wB2eesmvJ47Mq5/f7y/8+v8GwbAxAAJFSezo1vn1MdP//EzJg5uuSg3W9Rfiq++IHx8dvL5sTRlUUZ3dbL29vi5sfqkr1hc3PjjoU1MSzBKDSiMBXfWlid+HHftHRDvLqjzZuQfT45d1T844UzYnhRfrJf8DnZOQYgAOin6RWF8ZvPzImLZlcessdwVGVxLL50VsyfNjyj27ln5bZ4cPXORMuOL0/H38+f0u/lvrGgOkaXJtvnuuSVnfHzF7Z7E7LPR48ZGd9cWBN5qeTDaE4WjwEIAA7QSRNKY/Gls2LyiMJD/liKC1Lx4wunxyVzRmV0O19+cH1s3N2eaNmPza6MhTMOfJPrJ+aMigVHjUx0X6/vaouv/Ga9NyH7nDihNKOtScYABAAHZN64kvjpx4+KssKhc8xmKjc3bl8wNRbMSP4roKmjN65atC66epIdYfz1D0+JUcX7XycTywvia2dOTnQfnd098flF62Jvp6Og36q3NzvXSVk6N+46b1qk3+Uo/35tAcjJ7jEAAcB7qBqWH/d8/KgoTQ+9EzZSublx57nTYs6Y4sS3saKhJb7+u42Jlh1ZXBDf3M+vsJzoi++cUxPDEg6c/3PZxvj9llZvxHeQrYdC3nb21BhXlh6Q28oxBiAAeCd5ORE//Oj0GFmcP2QfY2F+Ku46f1oU5yc/mvn7TzfEsvW7Ey37oWkj4pNz330z5NUnV8WJE8sS3fYjaxvjR89t9UZ8twDI0gI4/5iB2+yds59NANkyBnCIvmOsgqHr6pPHxXFVmZ3e09vbG8te2xOP1e6O5zbvjYbmztjd1h3pvNyoKM6L46pK44ya4XHezJHvOnHJ/lSPLIrrPjgxblya7Mj+yMmJLyxZF49ePifGDOv/L6ubzpwcT25oio17Ot/057NGF8WX/3x8ooe0eU9H/PUD9vvbAjC4cowBCADeqmpYflxzyviMbmPZ+t1xw8Ovx2u7O972d91dvdGypzPq9jTGolca4/bfbYrbzp4SZ9SMSHRfn543Jn66cmvUNnYkWr6xrSe+sKQ2fnnJzEjl9m/DVGk6L759Tk187J9f3neFsHQqJ+48d1qiAa27pzeuXrwudrf3eCO+5xYACZD5FgBjAAKAt/jiB8ZHcUHyg4xuXVYXdz7dcOC/eJs641O/Wh1fO2tyXHHCuH7fX34qN679swlxzZLaxI/5P+qa486n6uNLfzah38ueNLEsPnfiuPj+s1siIuJvT58YMyqT7Zf81pObYvnmvf1e7r2miD3U0+0Ohl7f/2/S09sbyzftjcfX746n65piW0tX7Gjtis7uvigvzIuqsoKYPaY4TplUFmfWDI/hRfnvuQUgG8cABEDWG1mUiotmJ9/PeMeTm/r1wd/3iy5y4sZHN8TE8nTMn97/U+bOmTkybnm8LrbsTT5d6Dee2BQnTyqLkxLst//KqRPisfW7Y0xpQVyWcLa/J17bHd99qj5cblQA9MdjtbvilsfrYvWOdz6tdWdbd+xs644/bG2NX/5+R6RyIs6ePiI+e+JYYwCHjIMAh6CPzRoVRfnJyn/F5ua448lNie+7L3Li+odeTzRVb34qNy7O8LzgvsiJqxeti8bW/g8ghfmpuPO8aXHHwurIze3/W3vb3s64enHtvt0I7Oe1sgsgenp747rfro9Lf7XmXb/833G5vogH1+yK83/+ijEAAcAbK7oi8bI3P1aX8RfYlr1dce9LyWbpW5hwsp03atjbFf/tgWSbEY8ZXZLoFK2e3t744pLa2NnW7Q1oC8CBPf/e3rh6ce2gzBCZ7WMAAiArjShMxbyqZPN7v7KtJdG+63eytHZXouXmjC2NMSWZ71l6pHZP/Gh5w0Fb73c+3RBPbGjyBuzXL8Xs9o/Pb40lrzYaAwZpDEAAZJ0Txpcm2nwdEfHw2l0D9jj+sDX55DfzxpcOyGO45bG6eLFh76Cv82c3NsU3n9jkzdfvLQDZmwCvNbbFrcs2GgMGeQxAAGSV4zK4rOezm5oH7HHsbE1+EM+8qoG5NGl3X8TnF62N5vbB2yzf2NoVVy1a54A2WwD69+v/uS3R0dNnDBjkMYDBZTvNEFMzMvmFPv75E0cPiecwdQAvVrJhd2d89aHX4nvnTx+Ux3rtA7XR4IjlZAGQpQXQ2tkd/3fVDmPAQRoDsAUga0wsTx/2z2FCecGA3t59rzTGL1/cNuCP84fPNsSjtXu86WwD6Jf/2NAUzYN4cShjAAIgS40pzT/sn8PokoF/Djc8/Hqs2T5wF+V5ob45/v5x05bSfyvr9xoDDsEYgAA44pXkpw7751A8CM+hvacvPnvf2mjtzHx63qb27vj8onXRbb8/SQKgocUYcAjGAATAEa8w//B/SYoG6Tms2dke//Zy5vteH1jdGHVvuXAQSWTnhEmb9nQYAw7RGIAAYIjLSw3O2+rYscXx8dmZzzJ28ZxRccpERyln/PU/AN//RXmHX0Q0dbhI1KEaAxAAR7S2rl4r4R2UpXPjBxdMT3y50jdK5ebGnefVxMgimykzGuQHoADK0offa9A8yAFgDEAAZKnWLr8u3skdC2ti0vCBO7Vo7LB0fPfcadl7LtsAKBiAX+9lhYffmciDdf6/MQABkOW2OSf9bS4/fkwsGIT5xU+rHh7XnFJlBSeUzktFToanAs4YVWRFGgM4REwENMRs3NMRc8clm0bz2O88Hztaj6yL2cwZUxw3nD5x0G7/b06dEM9sbB6w+dOzTVF+brR2JY+A2WNKrERjALYAEBGxfld74mVnjSk+otZFaUFu3H3B9EjnDd5+4rxUbtx1/rQYXpi9xwP09Cbf51yezuw3xIkTHIxpDEAAEBERKzL4JXqkDabfWlgdkw/ClKJVZen49jk1WXs8QEcGEyKMzmDSmvFlBXHiBBeNMQYgAIiIiOcz+PBfNHtUxvtkh4rPHDc6o2ui99dZ00bE504aN2i339WT/Fd2YWpwT5XL5KCzmork+/A/Obcy8VXvjAFH/hiAAMg6O9u6Y2V9sit6TSgvjAUzRh6Sxz1rdFH84uKjBuy2/vsZkxIt+1pjWzS2Jpvk57oPTojjxg3OPunO7uQBMG7Y4M6rvr0l+UFnSX9xVg3Lj8+eONYH3hiAAOCNlrzSmHjZv/vQ5BhWcPBe1hkVhfG9c2vit5+ZHX9RPTzj2yvJ/+N+/8IEU4l29fTGNUtq48sPvpbovgvyUvH986dFWXrg19+eDM4d/8DkskF9DRuak8+KuHDGiCjs5+mAOdEXt509NYoLHINsDEAA8Ca/fmlHtCfcLDt2WDp+9NHpg77Z+P3jS+MnF06PpVfMiQtmjRqwTbnfXDA1po5Mtln5H57cFC80tMTD63bHz1ZuTXQbE4cXxj98pGbA19eODH5lX3XyuChPD95Hde3O5AedVZQUxK1nTz3wBfr64o6F1XHmtBE+6MYABABv+7Jo7Y57X9qZePlTpw6Pf7lkZowvG9hNxyMKU3HZvNGx9PLZcd+ls+LsGSMH9EN/6fsq47xjkk31u3xjU3znqfp9/3/Toxti3Y5kVw/88IyRcfnxYwZ03dVlMH/8lBFFsfSKuXHNyePi+KqSqCjKi4H8gffy1swubnPxnMq45UOTY3/Tv08sL4hfXjIzLp472ofcGMAQYBvcEPXdpzbHhbMqEm0Kj4h4/8SyWHbl3Pj+Mw3xs5VbY3vCc4OrR6Tj1CnlsWDGiDhlUtmgzfF9TGVR3HTm5ETLNrd3xzVLaqPvDRenae/pi6sWr4sln5qV6DTCG06fGMs3Nccftg7MJYjX7mjLaPlxZem4/rT+HRcx/rZnDujfPbWxOePnd9nxY+ODU8rj5y9sjcdq90R9c0f09UWMKS2ImZVFce7Mipg/fUQUF5h+2Rjw3jZ/9aSDvq6T3ueBfsYEAP38xdgZdz5dH185NfkkOMUFqfjyqRPiSx+oiic3NMXTdU2xamtrrN/VFk3tPbG3syd6+iKK8nKjtCA3xpWlY3xZQcwYVRSzRpfEseNKoqosPejPtTg/J36QcL9/RMTfPvJ6bGp6+37sl7a1xdf/fVP8jwRhkc5LxQ8umBbzf7IqWgZgbvblm5uH7Httc1NnrNneGjMqMzuHvKaiKG48c0rceKbPrzEAAUBG7nyqPuZPG5F4VrB9L3IqN06rHh6nDdEDdG7/cHXi08kWv7wjfv0em0rvfrYhTqsujw9O7f9znzKiKL61sDo+t2hdxs/xmY3N0drZM2R/AS96ZWf8TaVJZIwBZBM7b4awrt6IK+5dk/i0tsPBXx5bGR+dlWy//+Y9HXHdQ/s54j8nJ750f23idXju0RXxqeMy32fd3t0Xj67bNWRfh1+8uC06ul2ExhiAAGDIqG/uik//ak00tx9583vPHFUUN5+VbL9/T29vfOn+2mjq2P/m+W0t3YlPDYyIuPGMSXFMZeYXrfnxc1uG7GuxraU7/uX32w/6/d79TL0PeRaPAQgA9mNFQ0v85b++GrvbjpyrhBXl5cTdF0yLooT7/e9+dku/Dl57eN3u+OmKZF/Ahfmp+MEF06Mow8vfPl/fEr9Z3ThkX5Pbf7fpoP7SvO+lHXHzY3U+4Fk6BiAA6McA8JF7XorV21uPiOdz24enxrRRyfY5r9qyN77+7xv7vdxNS+tiTcL1V1NRFLcvmJrx877+odeivqljSL4mu9t74q/vXx+9vb2Dfl/3vrQ9vnB/bUROjg93lo4BCAD64fXdHfGRe1bFPz2/JaMruA20rp7eWPTyjjjnnlUH9O8vmTMqLppdmei+Wjt74qrF6yLJ9Ws6evri6sXrEu/rvnBWZXxy7qiM1tX21u74L//66pCNgKXr98TXBvlX+Y+XN8QXl9RGrynrs3YMQACQQFt3X9zwyIY496cvxVN1ew7pY1nf2Ba3LauLk+5aGVctro2VDfufUGZGRWH83YemJL7PWx6vi9rG5F+eL29vi1uXbUy8/M1nTYkZFZldoXDNzvZY+L9XDdndAT9+bmt89bfro3OADwrc29EdVy1aGzcurXvTnA1k1xjA0OE0wMPUi1ta46JfvBonTSiNvzpxXJxRXR4FeYN/ilnd7vb4zerGuP/VxljRzw97YV5O3H3B9MSnwi1dtyvuWbkt4+fwo+Vb4vTq4YnmLS8uSMXdF0yPBfesivYMLqO7vbU7rvy3tXF8VUlcecLYOGva0Jok52cvbI9VW1vjGwumxtGjM79A0v2v7oyvLd0Q9c32YWfzGIAAYAA9s2lvPLNpbYwoTMW5R1fEGdXlccqksihND8xLu6OlM1bU740nX2+KJ17fE2symDf+1vlTEk82s6OlM659YP3ArLQ/nRq49Io5UVHS/6lSZ1QWx63zp8S1GZxZ8J+er2+J5xfXRmFeTpw4YVi8f8KwmF5RFJOGp6OyJD/K06koyMuN/NTB31i3sqEl5v/TqrjwmIq48v1jY87Y/p2L3tndEw+u3hU/XN4QL26x39oYwFCTU3Xr0/bEHWFSOREzK/84k9fM0cUxqTwdY0rzY3RpfpQUpCKdyo10Xk709kV0dPdGW1dv7Gjtih0tXbG5qTPWN7ZHbWNbrNra+o4z7JGdpg5Px2nV5TFvfGlUjyiMqrJ0lBakIp2XE21dvbGnvSfq9rTHq9vb4qm6pli2fs+AzKKIMQABAAAMEAcBAoAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAgAAEAAAAACAAAQAACAAAAABAAAIAAAAAEAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAABAAAIAAAAAEAAAgAAAAAQAACAAAQAAAAAIAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAAQAACAAAAABAAAIAABAAAAAAgAAEAAAgAAAAN7o/wMPKI9LWOVgigAAAABJRU5ErkJggg==";
+ var imageElement = document.getElementById("src-image");
+ imageElement.src = imageSrc;
+ await imageElement.decode();
+
+ var resourcePath = "../../../resources/";
+
+ var videos = [
+ { src: resourcePath + "red-green.mp4",
+ type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"' },
+ { src: resourcePath + "red-green.webmvp8.webm",
+ type: 'video/webm; codecs="vp8, vorbis"' },
+ { src: resourcePath + "red-green.bt601.vp9.webm",
+ type: 'video/webm; codecs="vp9"' },
+ { src: resourcePath + "red-green.theora.ogv",
+ type: 'video/ogg; codecs="theora, vorbis"' },
+ ];
+ var currentVideo = null;
+
+ for (const info of videos) {
+ currentVideo = info;
+ debug("");
+ debug("testing: " + info.type);
+ const video = document.createElement("video");
+ video.muted = true;
+ var canPlay = true;
+ if (!video.canPlayType) {
+ testFailed("video.canPlayType required method missing");
+ continue;
+ }
+ if(!video.canPlayType(info.type).replace(/no/, '')) {
+ debug(info.type + " unsupported");
+ continue;
+ }
+ document.body.appendChild(video);
+ video.type = info.type;
+ video.src = info.src;
+ await new Promise(res => {
+ wtu.startPlayingAndWaitForVideo(video, res);
+ });
+ video.pause();
+
+ var texture0 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture0);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ 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.bindTexture(gl.TEXTURE_2D, null);
+
+ var texture1 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture1);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, imageElement);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ 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.bindTexture(gl.TEXTURE_2D, null);
+
+ // <-- Begin Observed -->
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, texture1);
+
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, texture0);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
+
+ wtu.clearAndDrawUnitQuad(gl, [255, 0, 255, 255]);
+
+ var observedPixels = new Uint8Array(640 * 480 * 4);
+ gl.readPixels(0, 0, 640, 480, gl.RGBA, gl.UNSIGNED_BYTE, observedPixels);
+ // <-- End Observed -->
+
+ // <-- Begin Expected -->
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, texture0);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
+
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_2D, texture1);
+
+ wtu.clearAndDrawUnitQuad(gl, [255, 0, 255, 255]);
+
+ var expectedPixels = new Uint8Array(640 * 480 * 4);
+ gl.readPixels(0, 0, 640, 480, gl.RGBA, gl.UNSIGNED_BYTE, expectedPixels);
+ // <-- End Expected -->
+
+ // Compare results
+ const tolerance = 1;
+ var numDifferentPixels = wtu.comparePixels(observedPixels, expectedPixels, tolerance, undefined);
+ if (numDifferentPixels) {
+ testFailed("Texture states were incorrect for " + currentVideo.type +
+ ", rendering was wrong: found " + numDifferentPixels + " differing pixels");
+ } else {
+ testPassed(`Texture states were correct +/-${tolerance}, rendering as expected`);
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+ }
+
+ debug("");
+ finishTest();
+})();
+</script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html
new file mode 100644
index 0000000000..e6e33874cf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texparameter-test.html
@@ -0,0 +1,129 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL TexParameter conformance 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>
+</head>
+<body>
+<canvas id="canvas_drawing" width="12" height="12"></canvas>
+<canvas id="canvas_texture" width="2" height="2"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Tests TexParameter works as expected");
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas_drawing");
+var canvas_texture = null;
+var texParam = [
+ gl.REPEAT,
+ gl.CLAMP_TO_EDGE,
+ gl.MIRRORED_REPEAT,
+];
+var color = [200, 0, 254, 255];
+var textures = [];
+
+if (!gl) {
+ testFailed("WebGL context does not exist");
+} else {
+ testPassed("WebGL context exists");
+
+ wtu.setupTexturedQuadWithTexCoords(gl, [-2.5, -2.5], [3.5, 3.5]);
+
+ setupCanvasTexture();
+ setupTextures();
+ for (var ii = 0; ii < texParam.length; ++ii) {
+ runDrawingTest(textures[ii], texParam[ii]);
+ }
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+function setupCanvasTexture() {
+ canvas_texture = document.getElementById("canvas_texture");
+ var ctx2d = canvas_texture.getContext("2d");
+ ctx2d.fillStyle = "rgba(" + color[0] + "," + color[1] + "," + color[2] + "," + color[3] + ")";
+ ctx2d.fillRect(0, 0, 1, 1);
+}
+
+function setupTextures() {
+ for (var ii = 0; ii < texParam.length; ++ii) {
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas_texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, texParam[ii]);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, texParam[ii]);
+ textures[ii] = texture;
+ }
+}
+
+function runDrawingTest(texture, param) {
+ gl.clearColor(1, 1, 1, 1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ checkPixels(param);
+}
+
+function checkPixels(param) {
+ var buf = new Uint8Array(12 * 12 * 4);
+ gl.readPixels(0, 0, 12, 12, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+ var passed = true;
+ for (var yy = 0; yy < 12; ++yy) {
+ for (var xx = 0; xx < 12; ++xx) {
+ var ec = [0, 0, 0, 0];
+ switch (param) {
+ case gl.REPEAT:
+ if (xx % 2 == 1 && yy % 2 == 1) {
+ ec = color;
+ }
+ break;
+ case gl.CLAMP_TO_EDGE:
+ if (xx < 6 && yy < 6) {
+ ec = color;
+ }
+ break;
+ case gl.MIRRORED_REPEAT:
+ if (xx % 4 < 2 && yy % 4 < 2) {
+ ec = color;
+ }
+ break;
+ }
+ var off = (yy * 12 + xx) * 4;
+ if (buf[off + 0] != ec[0] || buf[off + 1] != ec[1] ||
+ buf[off + 2] != ec[2] || buf[off + 3] != ec[3]) {
+ var msg = 'at (' + xx + ', ' + yy + ') expected: ' +
+ ec[0] + ', ' + ec[1] + ', ' + ec[2] + ', ' + ec[3] + ' found: ' +
+ buf[off + 0] + ', ' + buf[off + 1] + ', ' + buf[off + 2] + ', ' + buf[off + 3];
+ testFailed(msg);
+ passed = false;
+ }
+ }
+ }
+ if (passed) {
+ testPassed("Drawing with wrap " + wtu.glEnumToString(gl, param) + " as expected");
+ }
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html
new file mode 100644
index 0000000000..f459924ad1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind-2.html
@@ -0,0 +1,210 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ActiveTexture BindTexture conformance test #2</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<canvas id="canvas2d" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+uniform mat4 world;
+attribute vec3 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = world * vec4(vPosition, 1);
+ texCoord = texCoord0;
+}
+</script>
+<script id="fshader2d" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform sampler2D tex2d;
+varying vec2 texCoord;
+void main()
+{
+ gl_FragColor = texture2D(tex2d, texCoord);
+}
+</script>
+<script id="fshaderCube" type="x-shader/x-fragment">
+precision mediump float;
+
+uniform samplerCube texCube;
+void main()
+{
+ gl_FragColor = textureCube(texCube, vec3(0,1,0));
+}
+</script>
+
+<script>
+"use strict";
+function init()
+{
+ description(
+ "Tests that binding both TEXTURE_2D and TEXTURE_CUBE_MAP to the same " +
+ "active texture unit works as long as they are not used " +
+ "simultaneously in the same shader program.");
+
+ var canvas2d = document.getElementById("canvas2d");
+ var ctx2d = canvas2d.getContext("2d");
+ ctx2d.globalCompositeOperation = "copy";
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(
+ gl, ["vshader", "fshader2d"], ["vPosition", "texCoord0"]);
+
+ var program2d = program;
+ var programCube = wtu.setupProgram(
+ gl, ["vshader", "fshaderCube"], ["vPosition", "texCoord0"]);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([-1, 1,0, 1,1,0, -1,-1,0,
+ -1,-1,0, 1,1,0, 1,-1,0]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ var vertexObject = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vertexObject);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([ 0,0, 1,0, 0,1,
+ 0,1, 1,0, 1,1]),
+ gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+
+ // Make texture unit 1 active.
+ gl.activeTexture(gl.TEXTURE1);
+
+ // Make a 2d texture
+ var tex2d = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex2d);
+ ctx2d.fillStyle = "rgba(0, 0, 255, 255)";
+ ctx2d.fillRect(0, 0, 1, 1);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+
+ // make a cube texture
+ var texCube = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube);
+ ctx2d.fillStyle = "rgba(255, 0, 255, 255)";
+ ctx2d.fillRect(0, 0, 1, 1);
+ var targets = [
+ 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 ii = 0; ii < targets.length; ++ii) {
+ gl.texImage2D(targets[ii], 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+ }
+
+ // Setup program2d and programCube
+ var tex2dLoc = gl.getUniformLocation(program2d, "tex2d");
+ var world2dLoc = gl.getUniformLocation(program2d, "world");
+ var texCubeLoc = gl.getUniformLocation(programCube, "texCube");
+ var worldCubeLoc = gl.getUniformLocation(programCube, "world");
+
+ gl.useProgram(program2d);
+ gl.uniform1i(tex2dLoc, 1);
+ gl.useProgram(programCube);
+ gl.uniform1i(texCubeLoc, 1);
+
+ gl.clearColor(1,0,0,1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ var programs = [program2d, programCube];
+ var worldLocs = [world2dLoc, worldCubeLoc];
+ for (var ii = 0; ii < 4; ++ii) {
+ var x = ii % 2;
+ var y = Math.floor(ii / 2);
+ gl.useProgram(programs[x]);
+ gl.uniformMatrix4fv(
+ worldLocs[x], false,
+ [0.5, 0, 0, 0,
+ 0, 0.5, 0, 0,
+ 0, 0, 1, 0,
+ -0.5 + x, -0.5 + y, 0, 1]);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+
+ var colors = [
+ [0,0,255,255],
+ [255,0,255,255],
+ [0,0,255,255],
+ [255,0,255,255]];
+
+ for (var ii = 0; ii < colors.length; ++ii) {
+ var c = colors[ii];
+ var x = ii % 2;
+ var y = Math.floor(ii / 2);
+ wtu.checkCanvasRect(gl, x, y, 1, 1, c);
+ }
+
+ // Test that binding to one target does not affect the other
+ debug("");
+ debug("Testing texture target binding/unbinding");
+
+ var worldMatrix = [
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1];
+
+ gl.activeTexture(gl.TEXTURE2);
+
+ // Unbinding the TEXTURE_CUBE_MAP target should not affect the TEXTURE_2D target
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ gl.bindTexture(gl.TEXTURE_2D, tex2d);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+
+ gl.useProgram(program2d);
+ gl.uniform1i(tex2dLoc, 2);
+ gl.uniformMatrix4fv(world2dLoc, false, worldMatrix);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ wtu.checkCanvasRect(gl, 0, 0, 2, 2, [0,0,255,255]);
+
+ // Unbinding the TEXTURE_2D target should not affect the TEXTURE_CUBE_MAP target
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube);
+ gl.bindTexture(gl.TEXTURE_2D, tex2d);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ gl.useProgram(programCube);
+ gl.uniform1i(texCubeLoc, 2);
+ gl.uniformMatrix4fv(worldCubeLoc, false, worldMatrix);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+
+ wtu.checkCanvasRect(gl, 0, 0, 2, 2, [255,0,255,255]);
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html
new file mode 100644
index 0000000000..f24bd9b1f3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-active-bind.html
@@ -0,0 +1,179 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ActiveTexture BindTexture conformance 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>
+</head>
+<body>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<canvas id="canvas2d" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+uniform mat4 world;
+attribute vec3 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = world * vec4(vPosition, 1);
+ texCoord = texCoord0;
+}
+</script>
+<script id="trivial-vs" type="text/plain">
+void main()
+{
+ gl_Position = vec4(0,0,0,1);
+ gl_PointSize = 1.0;
+}
+</script>
+<script id="tex-point-fs" type="text/plain">
+precision mediump float;
+uniform sampler2D uSampler;
+void main()
+{
+ gl_FragColor = texture2D(uSampler, vec2(0));
+}
+</script>
+<script>
+"use strict";
+var gl;
+
+function init()
+{
+ description(
+ "Tests that glActiveTexture and glBindTexture work as expected" +
+ "Specifically texture targets are per active texture unit.");
+
+ var canvas2d = document.getElementById("canvas2d");
+ var ctx2d = canvas2d.getContext("2d");
+
+ var wtu = WebGLTestUtils;
+ gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(
+ gl,
+ ["vshader", wtu.simpleTextureFragmentShader],
+ ['vPosition', 'texCoord0']);
+ wtu.setupUnitQuad(gl);
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.BLEND);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var colors = [
+ [0,192,128,255],
+ [128,64,255,255],
+ [192,255,64,255],
+ [200,0,255,255]];
+
+ // Make 4 textures by using 4 active texture units if available.
+ var texunits = Math.min(colors.length, gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS))
+ var textures = [];
+ for (var ii = 0; ii < texunits; ++ii) {
+ var tex = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE0 + ii);
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ textures[ii] = tex;
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ // now use each texture unit to write into the textures,
+ for (var ii = 0; ii < texunits; ++ii) {
+ var c = colors[ii];
+ ctx2d.fillStyle =
+ "rgba(" + c[0] + "," + c[1] + "," + c[2] + "," + c[3] + ")";
+ ctx2d.fillRect(0, 0, 1, 1);
+ gl.activeTexture(gl.TEXTURE0 + ii);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var textureLoc = gl.getUniformLocation(program, "tex");
+ var worldLoc = gl.getUniformLocation(program, "world");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ gl.clearColor(1,0,0,1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ for (var ii = 0; ii < texunits; ++ii) {
+ var x = ii % 2;
+ var y = Math.floor(ii / 2);
+ gl.uniform1i(textureLoc, ii);
+ gl.uniformMatrix4fv(
+ worldLoc, false,
+ [0.5, 0, 0, 0,
+ 0, 0.5, 0, 0,
+ 0, 0, 1, 0,
+ -0.5 + x, -0.5 + y, 0, 1]);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ for (var ii = 0; ii < texunits; ++ii) {
+ var x = ii % 2;
+ var y = Math.floor(ii / 2);
+ wtu.checkCanvasRect(gl, x, y, 1, 1, colors[ii]);
+ }
+
+ debug("");
+ debug("Swizzle applied to correct ActiveTexture index");
+
+ {
+ const prog = wtu.setupProgram(
+ gl,
+ ["trivial-vs", "tex-point-fs"]);
+ prog.uSampler = gl.getUniformLocation(prog, "uSampler");
+ gl.useProgram(prog);
+ gl.viewport(0, 0, 1, 1);
+ gl.activeTexture(gl.TEXTURE0);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ const tex0_rgba8 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex0_rgba8);
+ const tex0_rgba8_data = new Uint8Array([10, 20, 30, 40]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, tex0_rgba8_data);
+
+ const tex2_a8 = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex2_a8);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.ALPHA, 1, 1, 0, gl.ALPHA, gl.UNSIGNED_BYTE, null);
+
+ window.control = new Uint8Array(4);
+ window.after_swizzle_applied = new Uint8Array(4);
+
+ gl.bindTexture(gl.TEXTURE_2D, tex0_rgba8);
+ gl.drawArrays(gl.POINTS, 0, 1);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, window.control);
+ shouldBeString("window.control", tex0_rgba8_data.toString());
+
+ gl.activeTexture(gl.TEXTURE2);
+ gl.bindTexture(gl.TEXTURE_2D, tex2_a8);
+ gl.uniform1i(prog.uSampler, 2);
+ gl.activeTexture(gl.TEXTURE0);
+ gl.drawArrays(gl.POINTS, 0, 1);
+ // Firefox would apply the A8-on-R8 swizzle to whatever tex-unit was active.
+
+ gl.uniform1i(prog.uSampler, 0);
+ gl.drawArrays(gl.POINTS, 0, 1);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, window.after_swizzle_applied);
+ shouldBeString("window.after_swizzle_applied", tex0_rgba8_data.toString());
+ // Firefox would then get 0,0,0,10 here, as the [ZERO,ZERO,ZERO,RED] swizzle was applied to our
+ // 10,20,30,40 texture.
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html
new file mode 100644
index 0000000000..b569ca061d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-attachment-formats.html
@@ -0,0 +1,176 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Texture Attachment Format Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2" style="width: 100px; height:100px; border: 1px solid black;"> </canvas>
+<script>
+"use strict";
+description();
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking texture formats.");
+
+ var numValidFormats = 0;
+ var clearColor = [0.25, 0.5, 0.75, 0.25];
+
+ var floatToBits = function(value, bits) {
+ var range = (1 << bits) - 1;
+ var result = 0;
+ if (range > 0) {
+ result = Math.floor(Math.floor(value * range) * 255 / range);
+ }
+
+ //debug("v = " + value + ", bits = " + bits + ", range = " + range + ", result = " + result);
+ return result;
+ }
+
+ var testFormat = function(info) {
+ debug("");
+ debug("testing: " + info.format + ", " + info.type);
+
+ var format = gl[info.format];
+ var type = gl[info.type];
+
+ gl.texImage2D(gl.TEXTURE_2D,
+ 0, // level
+ format, // internalFormat
+ 16, // width
+ 16, // height
+ 0, // border
+ format, // format
+ type, // type
+ null); // data
+ var fbStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ debug(wtu.glEnumToString(gl, fbStatus));
+ if (fbStatus != gl.FRAMEBUFFER_COMPLETE) {
+ debug("format unsupported");
+ if (info.mustBeFramebufferComplete) {
+ testFailed(info.format + " must be FRAMEBUFFER_COMPLETE");
+ }
+ return;
+ }
+
+ ++numValidFormats;
+
+ var startExpected = [0, 0, 0, info.channels[3] < 0 ? 255 : 0];
+
+ var expected = [];
+ var tolerance = [];
+ for (var ii = 0; ii < 4; ++ii) {
+ var color = 0;
+ var channel = info.channels[ii];
+ if (channel < 0) {
+ color = ii < 3 ? 0 : 255
+ } else {
+ color = floatToBits(clearColor[channel], info.bits[ii]);
+ }
+ expected.push(color);
+ tolerance.push(channel < 0 ? 0 : (1 + (1 << (8 - info.bits[ii]))));
+ }
+
+ wtu.checkCanvas(gl, startExpected, "should be " + startExpected);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvas(gl, expected, "should be " + expected + " with tolerance " + tolerance, tolerance);
+ }
+
+ var validFormats = [
+ { format: 'RGBA',
+ type: 'UNSIGNED_BYTE',
+ channels: [0, 1, 2, 3],
+ bits: [8, 8, 8, 8],
+ mustBeFramebufferComplete: true
+ },
+ { format: 'ALPHA',
+ type: 'UNSIGNED_BYTE',
+ channels: [-1, -1, -1, 3],
+ bits: [0, 0, 0, 8],
+ mustBeFramebufferComplete: false
+ },
+ { format: 'RGB',
+ type: 'UNSIGNED_BYTE',
+ channels: [0, 1, 2, -1],
+ bits: [8, 8, 8, 0],
+ mustBeFramebufferComplete: false
+ },
+ { format: 'RGB',
+ type: 'UNSIGNED_SHORT_5_6_5',
+ channels: [0, 1, 2, -1],
+ bits: [5, 6, 5, 0],
+ mustBeFramebufferComplete: false
+ },
+ { format: 'RGBA',
+ type: 'UNSIGNED_SHORT_5_5_5_1',
+ channels: [0, 1, 2, 3],
+ bits: [5, 5, 5, 1],
+ mustBeFramebufferComplete: false
+ },
+ { format: 'RGBA',
+ type: 'UNSIGNED_SHORT_4_4_4_4',
+ channels: [0, 1, 2, 3],
+ bits: [4, 4, 4, 4],
+ mustBeFramebufferComplete: false
+ },
+ { format: 'LUMINANCE',
+ type: 'UNSIGNED_BYTE',
+ channels: [0, 0, 0, -1],
+ bits: [8, 8, 8, -1],
+ mustBeFramebufferComplete: false
+ },
+ { format: 'LUMINANCE_ALPHA',
+ type: 'UNSIGNED_BYTE',
+ channels: [0, 0, 0, 3],
+ bits: [8, 8, 8, 8],
+ mustBeFramebufferComplete: false
+ }
+ ];
+
+ gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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.framebufferTexture2D(
+ gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0);
+
+ for (var ii = 0; ii < validFormats.length; ++ii) {
+ var info = validFormats[ii];
+ testFormat(info);
+ }
+
+ debug("");
+ shouldBeTrue("numValidFormats > 0");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html
new file mode 100644
index 0000000000..6e658f5b4e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-clear.html
@@ -0,0 +1,43 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture clear conformance 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>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([0,255,0,255]));
+wtu.clearAndDrawUnitQuad(gl);
+wtu.checkCanvas(
+ gl, [0, 255, 0, 255], "should be green");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html
new file mode 100644
index 0000000000..370f6d5fa2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-complete.html
@@ -0,0 +1,63 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL "Texture Complete" texture conformance 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>
+</head>
+<body>
+<canvas id="example" width="40" height="40" style="width: 40px; height: 40px;"></canvas>
+<canvas id="canvas2d" width="16" height="16" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function init()
+{
+ description(
+ "Checks that a texture that is not -texture-complete- does not draw if"+
+ " filtering needs mips");
+
+ var canvas2d = document.getElementById("canvas2d");
+ var ctx2d = canvas2d.getContext("2d");
+ ctx2d.fillStyle = "rgba(0,192,128,1)";
+ ctx2d.fillRect(0, 0, 16, 16);
+
+ var wtu = WebGLTestUtils;
+ var canvas = document.getElementById("example");
+ var gl = wtu.create3DContext(canvas);
+ var program = wtu.setupTexturedQuad(gl);
+
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.BLEND);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ // 16x16 texture no mips
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
+
+ var loc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(loc, 0);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0,0,0,255],
+ "texture that is not -texture-complete- when " +
+ "TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-and-deletion.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-and-deletion.html
new file mode 100644
index 0000000000..1caff3d224
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-and-deletion.html
@@ -0,0 +1,91 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Texture Copying and Deletion 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>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description('Checks that texture copying and deletion work correctly together.');
+debug('Regression test for <a href="http://anglebug.com/4267">http://anglebug.com/4267</a>');
+const wtu = WebGLTestUtils;
+const canvas = document.getElementById("example");
+canvas.addEventListener('webglcontextlost', contextLost, false);
+
+let contextWasLost = false;
+function contextLost(e) {
+ e.preventDefault();
+ contextWasLost = true;
+ debug("***context lost -- should not happen***");
+}
+
+const gl = wtu.create3DContext(canvas);
+
+const texture = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+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);
+
+const texture2 = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, texture2);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+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);
+
+const framebuffer = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+assertMsg(gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE,
+ "framebuffer should be FRAMEBUFFER_COMPLETE.");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after setup");
+
+// This test does not call getError, because doing so seems to cause
+// an implicit flush which intermittently masks the bug.
+
+debug("");
+debug("testing copyTexImage2D");
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.copyTexImage2D(gl.TEXTURE_2D, 1, gl.RGBA, 0, 0, 2, 2, 0);
+// Not necessary to do any CopyTexImage2D operations to texture2.
+
+debug("");
+debug("testing copyTexSubImage2D");
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 1, 0, 0, 0, 0, 1, 1);
+gl.bindTexture(gl.TEXTURE_2D, texture2);
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1);
+
+debug('deleting framebuffer');
+gl.deleteFramebuffer(framebuffer);
+debug('deleting texture');
+gl.deleteTexture(texture);
+debug('deleting texture2');
+// On buggy driver, crashes during this deleteTexture call.
+gl.deleteTexture(texture2);
+
+setTimeout(function() {
+ shouldBe("contextWasLost", "false");
+ finishTest();
+}, 1000);
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html
new file mode 100644
index 0000000000..0ff4e0ec4c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-copying-feedback-loops.html
@@ -0,0 +1,82 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Texture Copying Feedback Loops 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>
+</head>
+<body>
+<canvas id="example" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Checks that texture copying feedback loops fail correctly.");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var texture = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+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);
+
+var texture2 = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, texture2);
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+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);
+
+var framebuffer = gl.createFramebuffer();
+gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+assertMsg(gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE,
+ "framebuffer should be FRAMEBUFFER_COMPLETE.");
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "after setup");
+
+debug("");
+debug("testing copyTexImage2D");
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.copyTexImage2D(gl.TEXTURE_2D, 1, gl.RGBA, 0, 0, 2, 2, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "after copyTexImage2D to same texture but different level");
+gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 2, 2, 0);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "after copyTexImage2D to same texture same level, invalid feedback loop");
+gl.bindTexture(gl.TEXTURE_2D, texture2);
+gl.copyTexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 0, 0, 2, 2, 0);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "after copyTexImage2D to different texture");
+
+debug("");
+debug("testing copyTexSubImage2D");
+gl.bindTexture(gl.TEXTURE_2D, texture);
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 1, 0, 0, 0, 0, 1, 1);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "after copyTexSubImage2D to same texture but different level");
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1);
+wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "after copyTexSubImage2D to same texture same level, invalid feedback loop");
+gl.bindTexture(gl.TEXTURE_2D, texture2);
+gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 0, 0, 1, 1);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "after copyTexSubImage2D to different texture");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-corner-case-videos.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-corner-case-videos.html
new file mode 100644
index 0000000000..0d7061c83f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-corner-case-videos.html
@@ -0,0 +1,47 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/texture-corner-case-videos.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<canvas id="c2d" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest(
+ 'Verify uploading various corner-case videos to 2D textures',
+ "RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "", 1,
+ [
+ // Regression test for http://crbug.com/701060.
+ // Generated with the following command line:
+ // ffmpeg -r 25 -i red-green-480-272.png -vframes 10 -vcodec h264 -vf setsar=136:135,setdar=16:9 -pix_fmt yuv420p ...
+ {
+ comment: "Video whose natural size is larger than coded size due to uncommon pixel shape (Sample Aspect Ratio)",
+ src: "../../../resources/red-green-480x272-sar-136x135-dar-16x9.mp4",
+ type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
+ // A fairly high tolerance is used because colorspace conversion seems to differ widely between
+ // hardware-accelerated video decoders. At least on Windows / NVIDIA, this test was seen to convert
+ // (0,255,0) to (13,238,14), and (255,0,0) to (238,14,14).
+ tolerance: 18,
+ }
+ ])();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html
new file mode 100644
index 0000000000..5e09d3240f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-cube-as-fbo-attachment.html
@@ -0,0 +1,65 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture cube as FBO color attachment</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+var gl;
+
+function run()
+{
+ description(
+ "Tests using a cube map face as the color attachment of a framebuffer object. " +
+ "This test covers an ANGLE validation bug. See https://code.google.com/p/angleproject/issues/detail?id=849 .");
+
+ var wtu = WebGLTestUtils;
+ gl = wtu.create3DContext("example");
+ var textureCube = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, textureCube);
+ 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
+ ];
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ for (var ii = 0; ii < faces.length; ++ii) {
+ gl.texImage2D(faces[ii], 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ }
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+
+ for (var ii = 0; ii < faces.length; ++ii) {
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, faces[ii], textureCube, 0);
+ shouldBe('gl.checkFramebufferStatus(gl.FRAMEBUFFER)', 'gl.FRAMEBUFFER_COMPLETE');
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors for face " + wtu.glEnumToString(gl, faces[ii]));
+ }
+}
+
+run();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html
new file mode 100644
index 0000000000..c905c5595a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-draw-with-2d-and-cube.html
@@ -0,0 +1,103 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL ActiveTexture BindTexture conformance 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>
+</head>
+<body>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<canvas id="canvas2d" width="1" height="1" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec3 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vec4(vPosition, 1);
+ texCoord = texCoord0;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec2 texCoord;
+uniform sampler2D tex2D;
+uniform samplerCube texCube;
+void main()
+{
+ gl_FragColor = texture2D(tex2D, texCoord);
+ gl_FragColor += textureCube(texCube, vec3(texCoord, 0));
+}
+</script>
+<script>
+"use strict";
+var gl;
+
+function init()
+{
+ description(
+ "Tests drawing with two textures of different type. " +
+ "This test covers an ANGLE validation bug. See http://crbug.com/390412.");
+
+ var canvas2d = document.getElementById("canvas2d");
+ var ctx2d = canvas2d.getContext("2d");
+
+ var wtu = WebGLTestUtils;
+ gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(
+ gl,
+ ["vshader", "fshader"],
+ ['vPosition', 'texCoord0']);
+ wtu.setupUnitQuad(gl);
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.BLEND);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var texture2D = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, texture2D);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var textureCube = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE1);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, textureCube);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texImage2D(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ var texture2DLoc = gl.getUniformLocation(program, "tex2D");
+ var textureCubeLoc = gl.getUniformLocation(program, "texCube");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+
+ gl.clearColor(1,0,0,1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ gl.uniform1i(texture2DLoc, 0);
+ gl.uniform1i(textureCubeLoc, 1);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html
new file mode 100644
index 0000000000..ecd1d40ca5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-fakeblack.html
@@ -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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Tests if fake black textures are corectly implemented on desktops</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="24" height="24"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+
+function createTexture(gl,r,g,b,a) {
+ // setup render target texture //
+
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ 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.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 3, 3, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+
+ // setup framebuffer //
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ // fill the framebuffer //
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.clearColor(r, g, b, a);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ gl.deleteFramebuffer(fbo);
+
+ return texture;
+}
+
+function init() {
+ /*
+ * This test has been written due to a bug found in firefox's code
+ * and fixed in the following patch :
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=879952#c5
+ */
+ var wtu = WebGLTestUtils;
+ description();
+
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupTexturedQuad(gl);
+
+ var texture0 = createTexture(gl,1,0,0,1);
+ var texture1 = createTexture(gl,0,1,0,1);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture0);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [255, 0, 0, 255]);
+
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0, 0, 0, 255]);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture1);
+ 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.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0, 255, 0, 255]);
+
+ gl.bindTexture(gl.TEXTURE_2D, texture0);
+ gl.drawArrays(gl.TRIANGLES, 0, 6);
+ wtu.checkCanvas(gl, [0, 0, 0, 255]);
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html
new file mode 100644
index 0000000000..863ab53a0b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-formats-test.html
@@ -0,0 +1,274 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Texture Format Conformance Tests</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/desktop-gl-constants.js"></script>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas2d" width="2" height="2" style="width: 50px; height: 50px; border: 1px solid black;"></canvas>
+<canvas id="canvas" width="2" height="2" style="width: 100px; height:100px; border: 1px solid black;"></canvas>
+<script>
+"use strict";
+description("This test ensures WebGL implementations allow the OpenGL ES 2.0 texture formats and do not allow DesktopGL texture formats.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+ debug("Checking texture formats.");
+
+ var createTexture = function(internalFormat, format, opt_border) {
+ var border = (opt_border === undefined) ? 0 : opt_border;
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D,
+ 0, // level
+ internalFormat, // internalFormat
+ 16, // width
+ 16, // height
+ border, // border
+ format, // format
+ gl.UNSIGNED_BYTE, // type
+ null); // data
+ }
+
+ var testValidFormat = function(internalFormat, formatName) {
+ createTexture(internalFormat, internalFormat);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "was able to create texture of " + formatName);
+ }
+
+ var testInvalidFormat = function(internalFormat, formatName) {
+ createTexture(internalFormat, internalFormat);
+ var err = gl.getError();
+ if (err == gl.NO_ERROR) {
+ testFailed("should NOT be able to create texture of type " + formatName);
+ } else if (err == gl.INVALID_ENUM || err == gl.INVALID_VALUE) {
+ testPassed("not able to create invalid format: " + formatName);
+ }
+ }
+
+ var invalidEnums = [
+ '1',
+ '2',
+ '3',
+ '4',
+ 'RGB4',
+ 'RGB5',
+ 'RGB8',
+ 'RGB10',
+ 'RGB12',
+ 'RGB16',
+ 'RGBA2',
+ 'RGBA4',
+ 'RGB5_A1',
+ 'RGBA8',
+ 'RGB10_A2',
+ 'RGBA12',
+ 'RGBA16',
+ 'BGR',
+ 'BGRA',
+ 'ALPHA4_EXT',
+ 'ALPHA8_EXT',
+ 'ALPHA12_EXT',
+ 'ALPHA16_EXT',
+ 'COMPRESSED_ALPHA',
+ 'COMPRESSED_LUMINANCE',
+ 'COMPRESSED_LUMINANCE_ALPHA',
+ 'COMPRESSED_INTENSITY',
+ 'COMPRESSED_RGB',
+ 'COMPRESSED_RGBA',
+ 'DEPTH_COMPONENT16',
+ 'DEPTH_COMPONENT24',
+ 'DEPTH_COMPONENT32',
+ 'LUMINANCE4_EXT',
+ 'LUMINANCE8_EXT',
+ 'LUMINANCE12_EXT',
+ 'LUMINANCE16_EXT',
+ 'LUMINANCE4_ALPHA4_EXT',
+ 'LUMINANCE6_ALPHA2_EXT',
+ 'LUMINANCE8_ALPHA8_EXT',
+ 'LUMINANCE12_ALPHA4_EXT',
+ 'LUMINANCE12_ALPHA12_EXT',
+ 'LUMINANCE16_ALPHA16_EXT',
+ 'INTENSITY_EXT',
+ 'INTENSITY4_EXT',
+ 'INTENSITY8_EXT',
+ 'INTENSITY12_EXT',
+ 'INTENSITY16_EXT',
+ 'RGB4_EXT',
+ 'RGB5_EXT',
+ 'RGB8_EXT',
+ 'RGB10_EXT',
+ 'RGB12_EXT',
+ 'RGB16_EXT',
+ 'RGBA2_EXT',
+ 'RGBA4_EXT',
+ 'RGB5_A1_EXT',
+ 'RGBA8_EXT',
+ 'RGB10_A2_EXT',
+ 'RGBA12_EXT',
+ 'RGBA16_EXT',
+ 'SLUMINANCE_EXT',
+ 'SLUMINANCE8_EXT',
+ 'SLUMINANCE_ALPHA_EXT',
+ 'SLUMINANCE8_ALPHA8_EXT',
+ 'SRGB_EXT',
+ 'SRGB8_EXT',
+ 'SRGB_ALPHA_EXT',
+ 'SRGB8_ALPHA8'
+ ];
+
+ for (var ii = 0; ii < invalidEnums.length; ++ii) {
+ var formatName = invalidEnums[ii]
+ if (desktopGL[formatName] === undefined) {
+ debug("bad format" + formatName)
+ } else {
+ testInvalidFormat(desktopGL[formatName], "GL_" + formatName);
+ }
+ }
+
+ var validEnums = [
+ 'ALPHA',
+ 'RGB',
+ 'RGBA',
+ 'LUMINANCE',
+ 'LUMINANCE_ALPHA'
+ ];
+
+ for (var ii = 0; ii < validEnums.length; ++ii) {
+ var formatName = validEnums[ii]
+ testValidFormat(gl[formatName], "gl." + formatName);
+ }
+
+ debug("");
+ debug("checking non 0 border parameter to gl.TexImage2D");
+ createTexture(gl['RGBA'], gl['RGBA'], 1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "non 0 border to gl.TexImage2D should return INVALID_VALUE");
+
+
+ var checkTypes = function() {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ 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);
+
+ var loc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(loc, 0);
+
+ var checkType = function(r, g, b, a, type, format, buf) {
+ var typeName = wtu.glEnumToString(gl, type);
+ var formatName = wtu.glEnumToString(gl, format);
+ var desc = "format: " + formatName + ", type: " + typeName;
+ debug("");
+ debug("checking gl.texImage2D with " + desc + " and buffer type " +
+ buf.constructor.name);
+ gl.texImage2D(gl.TEXTURE_2D,
+ 0, // level
+ format, // internalFormat
+ 2, // width
+ 2, // height
+ 0, // border
+ format, // format
+ type, // type
+ buf); // data
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.texImage2D with " + desc + " should generate NO_ERROR");
+
+ wtu.clearAndDrawUnitQuad(gl, [255, 0, 0, 255]);
+ wtu.checkCanvas(gl, [r,g,b,a],
+ "texture " + desc + " should draw with " +
+ r + ", " + g + ", " + b + ", " + a);
+
+ }
+ checkType(
+ 0, 255, 0, 255, gl.UNSIGNED_BYTE, gl.RGBA,
+ new Uint8Array(
+ [ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255]));
+ checkType(
+ 0, 255, 0, 255, gl.UNSIGNED_BYTE, gl.RGBA,
+ new Uint8ClampedArray(
+ [ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255,
+ 0, 255, 0, 255]));
+ checkType(
+ 0, 0, 255, 255, gl.UNSIGNED_SHORT_4_4_4_4, gl.RGBA,
+ new Uint16Array(
+ [ 255, 255,
+ 255, 255,
+ 255, 255,
+ 255, 255]));
+ checkType(
+ 0, 255, 0, 255, gl.UNSIGNED_SHORT_5_6_5, gl.RGB,
+ new Uint16Array(
+ [ 2016, 2016,
+ 2016, 2016,
+ 2016, 2016,
+ 2016, 2016]));
+ checkType(
+ 0, 0, 255, 255, gl.UNSIGNED_SHORT_5_5_5_1, gl.RGBA,
+ new Uint16Array(
+ [ 63, 63,
+ 63, 63,
+ 63, 63,
+ 63, 63]));
+ checkType(
+ 255, 255, 255, 255, gl.UNSIGNED_BYTE, gl.LUMINANCE,
+ new Uint8Array([
+ 255,
+ 255,
+ 255,
+ 255]));
+ checkType(
+ 0, 0, 0, 128, gl.UNSIGNED_BYTE, gl.ALPHA,
+ new Uint8Array([
+ 128,
+ 128,
+ 128,
+ 128]));
+ checkType(
+ 128, 128, 128, 192, gl.UNSIGNED_BYTE, gl.LUMINANCE_ALPHA,
+ new Uint8Array([
+ 128, 192,
+ 128, 192,
+ 128, 192,
+ 128, 192]));
+ }
+ var program = wtu.setupTexturedQuad(gl);
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+ checkTypes();
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html
new file mode 100644
index 0000000000..5126fad9f7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-hd-dpi.html
@@ -0,0 +1,117 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL HD-DPI issues texture conformance 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>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description();
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+function fillInMips(gl, size) {
+ // fill in the mips
+ var level = 1;
+ for (;;) {
+ size /= 2;
+ if (size < 1) {
+ break;
+ }
+ var numBytes = size * size * 4;
+ var pixels = new Uint8Array(numBytes);
+ for (var jj = 0; jj < numBytes; jj += 4) {
+ pixels[jj + 0] = 0;
+ pixels[jj + 1] = 255;
+ pixels[jj + 2] = 0;
+ pixels[jj + 3] = 255;
+ }
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
+ }
+}
+
+function testCanvas(size) {
+ debug("");
+ debug("testing 2D canvas size " + size + ", " + size);
+
+ var canvas = document.createElement("canvas");
+ canvas.width = size;
+ canvas.height = size;
+ var ctx = canvas.getContext("2d");
+ ctx.fillStyle = "rgb(0,255,0)";
+ ctx.fillRect(0, 0, size, size);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
+
+ fillInMips(gl, size);
+
+ // Draw. If this an HD-DPI device and the 2d canvas is double res or larger
+ // the implementation must scale to CSS pixels (ie, canvas.width, canvas.height)(
+ // when doing the copy in texImage2D. If it has not scaled and instead done
+ // a direct copy of the larger texture this test will not have created enough mips
+ // and will therefore not be "texture complete" and will render in black.
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+function testWebGL(size) {
+ debug("");
+ debug("testing WebGL canvas size " + size + ", " + size);
+
+ var canvas = document.createElement("canvas");
+ canvas.width = size;
+ canvas.height = size;
+ var gl2 = wtu.create3DContext(canvas);
+ gl2.clearColor(0,1,0,1);
+ gl2.clear(gl.COLOR_BUFFER_BIT);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
+
+ fillInMips(gl, size);
+
+ // Draw. If this an HD-DPI device check for 2 possible bugs.
+ //
+ // 1) the WebGL canvas is double res or larger. That's just a bug period and
+ // is checked for in another test but would also fail here.
+ //
+ // 2) the WebGL canvas is single res but the code the scales a double res
+ // 2d canvas also mistakenly scales a single res WebGL canvas.
+ //
+ // If it has been scaled then we'll have the wrong kind of mips chain here.
+ // Level 0 will be half resolution. Level 1 will be the same resolution
+ // and will therefore not be "texture complete" and will render in black.
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green");
+}
+
+testCanvas(4);
+testCanvas(512);
+testWebGL(4);
+testWebGL(512);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html
new file mode 100644
index 0000000000..6f038b8475
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-mips.html
@@ -0,0 +1,297 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture mips conformance 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>
+</head>
+<body>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+uniform vec4 uMult;
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vPosition * uMult;
+ texCoord = texCoord0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform sampler2D tex;
+varying vec2 texCoord;
+void main()
+{
+ gl_FragColor = texture2D(tex, texCoord);
+}
+</script>
+<script>
+"use strict";
+var canvas;
+var wtu = WebGLTestUtils;
+function init()
+{
+ description("Checks mip issues");
+
+ canvas = document.getElementById("example");
+ shouldBe("canvas.width", "2");
+ shouldBe("canvas.height", "2");
+
+ var gl = wtu.create3DContext(canvas);
+
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "for generateMipmap with mip 0 is 0x0");
+ gl.texImage2D(
+ gl.TEXTURE_2D, 1, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4));
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "for generateMipmap with mip 0 is 0x0");
+
+ tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "for generateMipmap with mip 0 is 0x0");
+
+ 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 ii = 0; ii < faces.length; ++ii) {
+ gl.texImage2D(
+ faces[ii], 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ new Uint8Array(4 * 2 * 2));
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ wtu.glErrorShouldBe(gl, ii == 5 ? gl.NO_ERROR : gl.INVALID_OPERATION, "for generateMipmap with " + (ii + 1) + " faces");
+ }
+
+ wtu.setupUnitQuad(gl, 0, 1);
+ var program = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition', 'texCoord0'], [0, 1]);
+
+ gl.disable(gl.DEPTH_TEST);
+ gl.disable(gl.BLEND);
+
+ var colors = {
+ blue: [0, 0, 255, 255],
+ red: [255, 0, 0, 255],
+ green: [0, 255, 0, 255],
+ cyan: [128, 255, 255, 255],
+ black: [0, 0, 0, 255],
+ blank: [0, 0, 0, 0]
+ };
+
+ var mips = [
+ ];
+
+ var texLoc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(texLoc, 0);
+ var multLoc = gl.getUniformLocation(program, "uMult");
+
+ // ----------------------------------------------------
+ var clearTex = createTexture();
+ gl.uniform4f(multLoc, 1, 1, 1, 1);
+ gl.bindTexture(gl.TEXTURE_2D, clearTex);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ debug('gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 16, 16, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);');
+ setMipData(0, 16, 'blank');
+ makeDivMipChain();
+ generateMipmap();
+ check('blank', "texture created with null that has all mips");
+
+ // ----------------------------------------------------
+ var tex = createTexture();
+ gl.uniform4f(multLoc, 1, 1, 1, 1);
+
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ // 16x16 texture no mips
+ fillLevel(tex, 0, 16, 'cyan');
+
+ check('black',
+ "texture that is missing mips when TEXTURE_MIN_FILTER not NEAREST or LINEAR");
+
+ generateMipmap();
+
+ check('cyan', "texture that has all mips");
+
+ // Fill in the bottom 2 mips with a different color.
+ fillLevel(tex, 4, 1, 'green');
+ fillLevel(tex, 3, 2, 'green');
+
+ // Choose the nearest mip
+ texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+
+ check('green', "texture that is only using the smallest 2 mips");
+
+ gl.uniform4f(multLoc, 16, 16, 1, 1);
+
+ check('cyan', "texture that is using only the largest 2 mips");
+
+ // Set the top level
+ fillLevel(tex, 0, 1, 'red');
+ check('red',
+ "texture that is only using the top level even though other levels are defined");
+
+ // Set the top 2 levels using generateMipmap
+ fillLevel(tex, 0, 2, 'blue');
+ generateMipmap();
+
+ check('blue',
+ "texture that is only using the top 2 levels even though other levels are defined");
+
+ // Set the top 2 levels back to sizes that end up using levels 2, 3, and 4 again.
+ fillLevel(tex, 0, 16, 'blue');
+ fillLevel(tex, 1, 8, 'blue');
+ check('blue', "texture that is only using the largest 2 mips");
+ gl.uniform4f(multLoc, 1, 1, 1, 1);
+ check('green', "texture that is only using the smallest 2 mips");
+
+ // ----------------------------------------------------
+ var tex = createTexture();
+ gl.uniform4f(multLoc, 1, 1, 1, 1);
+ fillLevel(tex, 0, 8, 'cyan');
+ generateMipmap();
+ check('cyan', "texture that has 3 mips");
+
+ fillLevel(tex, 0, 16, 'blue');
+ texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ check('blue', "texture that is only using top mips");
+
+ fillLevel(tex, 0, 8, 'red');
+ texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+ check('cyan', "texture that is only using smallest mips");
+
+ gl.uniform4f(multLoc, 16, 16, 1, 1);
+ check('red', "texture that is using only the largest mip");
+
+ // ----------------------------------------------------
+ var tex = createTexture();
+ gl.uniform4f(multLoc, 1, 1, 1, 1);
+ fillLevel(tex, 2, 1, 'green');
+ fillLevel(tex, 1, 2, 'green');
+ fillLevel(tex, 0, 4, 'green');
+ check('green', "texture that was built smallest mip first");
+
+ // ----------------------------------------------------
+ var tex = createTexture();
+ gl.uniform4f(multLoc, 1, 1, 1, 1);
+ fillLevel(tex, 0, 16, 'red');
+ generateMipmap();
+ check('red', "texture with 1 genmipmaps");
+ fillLevel(tex, 0, 16, 'blue');
+ generateMipmap();
+ fillLevel(tex, 0, 16, 'green');
+ generateMipmap();
+ check('green', "texture with 2 genmipmaps");
+
+ // ----------------------------------------------------
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+
+ function createTexture() {
+ debug("<hr/>gl.createTexture()");
+ mips = [];
+ makeDivMipChain();
+ return gl.createTexture();
+ }
+
+ function texParameteri(target, pname, value) {
+ debug("gl.texParameteri(" +
+ wtu.glEnumToString(gl, target) + ", " +
+ wtu.glEnumToString(gl, pname) + ", " +
+ wtu.glEnumToString(gl, value) + ")")
+ gl.texParameteri(target, pname, value);
+ }
+
+ function generateMipmap() {
+ debug("gl.generateMipmap(gl.TEXTURE_2D)");
+ gl.generateMipmap(gl.TEXTURE_2D);
+ var mip0 = mips[0];
+ var size = mip0.size;
+ var level = 1;
+ for(;;) {
+ size = Math.floor(size / 2);
+ if (!size) {
+ break;
+ }
+ setMipData(level, size, mip0.color);
+ ++level;
+ }
+ makeDivMipChain();
+ }
+
+ function check(color, msg) {
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, colors[color], msg + " should draw with " + color);
+ }
+
+ function fillLevel(tex, level, size, color) {
+ setMipData(level, size, color);
+ debug("gl.texImage2D(gl.TEXTURE_2D, " + level + ", gl.RGBA, " + size + ", " + size +
+ ", 0, gl.RGBA, gl.UNSIGNED_BYTE, " + color + ");");
+ wtu.fillTexture(gl, tex, size, size, colors[color], level);
+ makeDivMipChain();
+ }
+
+ function setMipData(level, size, color) {
+ mips[level] = {
+ size: size,
+ color: color
+ };
+ }
+
+ function makeDivMipChain(color) {
+ var html = [
+ '<div style="height: 68px; margin-top: 5px">',
+ '<div style="float:left;">mips: </div>'];
+ for (var ii = 0; ii < 5; ++ii) {
+ var mip = mips[ii];
+ if (mip) {
+ html.push(makeDivSquare(mip.size, mip.color));
+ } else {
+ html.push(makeDivSquare(16, undefined));
+ }
+ }
+ html.push("</div>");
+ debug(html.join(""));
+ }
+
+ function makeDivSquare(size, color) {
+ size *= 4;
+ var c = color ? colors[color] : [255,255,255];
+ var border = color ? 'solid' : 'dashed';
+ return '<div style="float:left; width: ' + size + 'px; height: ' + size +
+ 'px; background-color: ' + rgb(c) +
+ '; border: 1px ' + border + ' black; margin-right: 3px;"></div>';
+ }
+
+ function rgb(c) {
+ return 'rgb(' + c[0] + ',' + c[1] + ',' + c[2] +')';
+ }
+}
+
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html
new file mode 100644
index 0000000000..ef979d4c5a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot-video.html
@@ -0,0 +1,160 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = null;
+var textureLoc = null;
+var successfullyParsed = false;
+
+initTestingHarness();
+
+function logVisibility(isOnload)
+{
+ let prefix = '';
+ if (isOnload)
+ prefix = 'Upon load: ';
+ if (document.hidden) {
+ console.log(prefix + '*** Tab was backgrounded (if running in automated test harness, why?) ***');
+ } else {
+ console.log(prefix + 'Tab was foregrounded');
+ }
+}
+
+function init()
+{
+ description('Verify npot video');
+
+ document.addEventListener("visibilitychange", visibilityChanged, false);
+
+ logVisibility(true);
+
+ var canvas = document.getElementById("example");
+ gl = wtu.create3DContext(canvas);
+ var program = wtu.setupTexturedQuad(gl);
+
+ gl.clearColor(0,0,0,1);
+ gl.clearDepth(1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ // Disable any writes to the alpha channel
+ gl.colorMask(1, 1, 1, 0);
+
+ textureLoc = gl.getUniformLocation(program, "tex");
+
+ var video = document.getElementById("vid");
+ wtu.startPlayingAndWaitForVideo(video, runTest);
+}
+
+function visibilityChanged() {
+ logVisibility(false);
+}
+
+function runOneIteration(videoElement, useTexSubImage2D, flipY, topColor, bottomColor, badMinFilter, badClamp, genMips)
+{
+ debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') +
+ ' with flipY=' + flipY);
+ var texture = gl.createTexture();
+ // Bind the texture to texture unit 0
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ // Set up pixel store parameters
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ // Upload the videoElement into the texture
+ debug("size: " + videoElement.videoWidth + "x" + videoElement.videoHeight);
+ if (useTexSubImage2D) {
+ // Initialize the texture to black first
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,
+ videoElement.videoWidth, videoElement.videoHeight, 0,
+ gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, videoElement);
+ } else {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, videoElement);
+ }
+
+ // Set up texture parameters
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ if (badMinFilter) {
+ debug("bad min filter");
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+ } else {
+ debug("good min filter");
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ }
+ if (badClamp) {
+ debug("bad clamp");
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+ } else {
+ debug("good clamp");
+ 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);
+ }
+ if (genMips) {
+ debug("generate mips");
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "should be INVALID_OPERATION");
+ }
+
+// var c = document.createElement("canvas");
+// c.width = 16;
+// c.height = 16;
+// c.style.border = "1px solid black";
+// var ctx = c.getContext("2d");
+// ctx.drawImage(videoElement, 0, 0, 16, 16);
+// document.body.appendChild(c);
+
+ // Point the uniform sampler to texture unit 0
+ gl.uniform1i(textureLoc, 0);
+ // Draw the triangles
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ // Check a few pixels near the top and bottom and make sure they have
+ // the right color.
+ var tolerance = 5;
+ debug("Checking lower left corner");
+ wtu.checkCanvasRect(gl, 4, 4, 2, 2, bottomColor,
+ "shouldBe " + bottomColor, tolerance);
+ debug("Checking upper left corner");
+ wtu.checkCanvasRect(gl, 4, gl.canvas.height - 8, 2, 2, topColor,
+ "shouldBe " + topColor, tolerance);
+ debug("");
+}
+
+function runTest(videoElement)
+{
+ var red = [255, 0, 0];
+ var green = [0, 255, 0];
+ var black = [0, 0, 0];
+ runOneIteration(videoElement, false, true, black, black, true, true, true);
+ runOneIteration(videoElement, false, true, black, black, true, false, false);
+ runOneIteration(videoElement, false, true, black, black, false, true, false);
+ runOneIteration(videoElement, false, true, black, black, true, true, false);
+ runOneIteration(videoElement, false, true, green, red, false, false, false);
+ runOneIteration(videoElement, false, false, red, green, false, false, false);
+ runOneIteration(videoElement, true, true, green, red, false, false, false);
+ runOneIteration(videoElement, true, false, red, green, false, false, false);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+ finishTest();
+}
+</script>
+</head>
+<body onload="init()">
+<canvas id="example" width="64" height="48"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<video id="vid" style="display:none;" muted>
+ <source src="../../../resources/npot-video.mp4" type='video/mp4; codecs="avc1.42E01E"' />
+ <source src="../../../resources/npot-video.webmvp8.webm" type='video/webm; codecs="vp8"' />
+ <source src="../../../resources/npot-video.theora.ogv" type='video/ogg; codecs="theora"' />
+</video>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html
new file mode 100644
index 0000000000..73ea4011f1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-npot.html
@@ -0,0 +1,305 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Non-Power of 2 texture conformance 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>
+</head>
+<body>
+<canvas id="example" width="4" height="4" style="width: 40px; height: 30px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec2 texCoord0;
+varying vec2 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform samplerCube tex;
+varying vec2 texCoord;
+void main()
+{
+ gl_FragColor = textureCube(tex, normalize(vec3(texCoord, 1)));
+}
+</script>
+<script>
+"use strict";
+description(document.title);
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupTexturedQuad(gl);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+var tests = [
+ { format: gl.RGBA,
+ type: gl.UNSIGNED_BYTE,
+ color: [192, 0, 128, 64],
+ expected: [192, 0, 128, 64],
+ tolerance: 0,
+ },
+ { format: gl.RGB,
+ type: gl.UNSIGNED_BYTE,
+ color: [192, 0, 128],
+ expected: [192, 0, 128, 255],
+ tolerance: 0,
+ },
+ { format: gl.LUMINANCE,
+ type: gl.UNSIGNED_BYTE,
+ color: [192],
+ expected: [192, 192, 192, 255],
+ tolerance: 0,
+ },
+ { format: gl.ALPHA,
+ type: gl.UNSIGNED_BYTE,
+ color: [64],
+ expected: [0, 0, 0, 64],
+ tolerance: 0,
+ },
+ { format: gl.LUMINANCE_ALPHA,
+ type: gl.UNSIGNED_BYTE,
+ color: [192, 64],
+ expected: [192, 192, 192, 64],
+ tolerance: 0,
+ },
+ // { format: gl.RGBA,
+ // type: gl.UNSIGNED_SHORT_4_4_4_4,
+ // color: [0x48FC],
+ // expected: [0x44, 0x88, 0xFF, 0xCC],
+ // tolerance: 16,
+ // },
+ // { format: gl.RGBA,
+ // type: gl.UNSIGNED_SHORT_5_5_5_1,
+ // color: [0x8309], // 10000 01000 00100 1
+ // expected: [128, 64, 32, 255],
+ // tolerance: 16,
+ // },
+ // { format: gl.RGB,
+ // type: gl.UNSIGNED_SHORT_5_6_5,
+ // color: [0x8404], // 10000 010000 00100
+ // expected: [128, 64, 32],
+ // tolerance: 16,
+ // },
+];
+
+tests.forEach(function(test) {
+ debug("");
+ debug("test " + wtu.glEnumToString(gl, test.format) + "/" + wtu.glEnumToString(gl, test.type));
+ var tex = gl.createTexture();
+
+ // Check that an NPOT texture not on level 0 generates INVALID_VALUE
+ wtu.fillTexture(gl, tex, 5, 3, test.color, 1, test.format, test.type);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE");
+
+ // Check that an NPOT texture on level 0 succeeds
+ wtu.fillTexture(gl, tex, 5, 3, test.color, 0, test.format, test.type);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.texImage2D with NPOT texture at level 0 should succeed");
+
+ // Check that generateMipmap fails on NPOT
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "gl.generateMipmap with NPOT texture should return INVALID_OPERATION");
+
+ // Check that nothing is drawn if filtering is not correct for NPOT
+ 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.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, [0, 0, 0, 255],
+ "NPOT texture with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+ 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_MIPMAP_LINEAR);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, [0, 0, 0, 255],
+ "NPOT texture with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, test.expected,
+ "NPOT texture with TEXTURE_MIN_FILTER set to LINEAR should draw.");
+
+ gl.copyTexImage2D(gl.TEXTURE_2D, 1, test.format, 0, 0, 5, 3, 0);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "copyTexImage2D with NPOT texture with level > 0 should return INVALID_VALUE.");
+
+ // Check that generateMipmap for an POT texture succeeds
+ wtu.fillTexture(gl, tex, 4, 4, test.color, 0, test.format);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.texImage2D and gl.generateMipmap with POT texture at level 0 should succeed");
+
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, test.expected,
+ "POT texture with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+});
+
+var testCubemap = function(switchTextureUnitBeforeDraw) {
+ debug("");
+ var title = "check using cubemap";
+ if (switchTextureUnitBeforeDraw) {
+ title += " and switch texture unit before draw to check for Chromium bug";
+ }
+ debug(title);
+ var program = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition', 'texCoord0'], [0, 1]);
+ var tex = gl.createTexture();
+
+ // Check that an NPOT texture not on level 0 generates INVALID_VALUE
+ fillCubeTexture(gl, tex, 5, 3, [0, 192, 128, 255], 1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "gl.texImage2D with NPOT texture with level > 0 should return INVALID_VALUE");
+
+ // Check that an NPOT texture on level 0 succeeds
+ fillCubeTexture(gl, tex, 5, 5, [0, 192, 128, 255]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.texImage2D with NPOT texture at level 0 should succeed");
+
+ // Check that generateMipmap fails on NPOT
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "gl.generateMipmap with NPOT texture should return INVALID_OPERATION");
+
+ var loc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(loc, 0);
+
+ // Check that nothing is drawn if filtering is not correct for NPOT
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+ if (switchTextureUnitBeforeDraw) {
+ debug("Switching active texture unit to gl.TEXTURE1");
+ // Test for http://crbug.com/390514
+ gl.activeTexture(gl.TEXTURE1);
+ }
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, [0, 0, 0, 255],
+ "NPOT cubemap with TEXTURE_WRAP set to REPEAT should draw with 0,0,0,255");
+
+ if (switchTextureUnitBeforeDraw) {
+ var error = gl.getError();
+ if (error === gl.NO_ERROR) {
+ testPassed("getError was expected value: NO_ERROR : Should be no errors from draw.");
+ } else if (error === gl.INVALID_ENUM) {
+ testFailed("getError returned INVALID_ENUM. Possibly Chromium bug where texture unit is set to 0 instead of GL_TEXTURE0.");
+ } else {
+ testFailed("Drawing resulted in error: " + wtu.glEnumToString(gl, error));
+ }
+ gl.activeTexture(gl.TEXTURE0);
+ } else {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from draw.");
+ }
+
+ 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_MIPMAP_LINEAR);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, [0, 0, 0, 255],
+ "NPOT cubemap with TEXTURE_MIN_FILTER not NEAREST or LINEAR should draw with 0,0,0,255");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, [0, 192, 128, 255],
+ "NPOT cubemap with TEXTURE_MIN_FILTER set to LINEAR should draw.");
+
+ // Check that an POT texture on level 0 succeeds
+ fillCubeTexture(gl, tex, 4, 4, [0, 192, 128, 255]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.texImage2D with POT texture at level 0 should succeed");
+
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_WRAP_T, gl.REPEAT);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, [0, 0, 0, 255],
+ "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR but no mips draw with 0,0,0,255");
+
+ // Check that generateMipmap succeeds on POT
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "gl.generateMipmap with POT texture should return succeed");
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, [0, 192, 128, 255],
+ "POT cubemap with TEXTURE_MIN_FILTER set to LINEAR_MIPMAP_LINEAR should draw.");
+};
+
+testCubemap(false);
+testCubemap(true);
+
+var successfullyParsed = true;
+
+function fillCubeTexture(gl, tex, width, height, color, opt_level) {
+ opt_level = opt_level || 0;
+ var canvas = document.createElement('canvas');
+ canvas.width = width;
+ canvas.height = height;
+ var ctx2d = canvas.getContext('2d');
+ ctx2d.fillStyle = "rgba(" + color[0] + "," + color[1] + "," + color[2] + "," + color[3] + ")";
+ ctx2d.fillRect(0, 0, width, height);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ var targets = [
+ 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 tt = 0; tt < targets.length; ++tt) {
+ gl.texImage2D(
+ targets[tt], opt_level, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas);
+ }
+};
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html
new file mode 100644
index 0000000000..c38d897e18
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-cube-maps.html
@@ -0,0 +1,331 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture size cube map conformance 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>
+</head>
+<body>
+<canvas id="example" width="256" height="256" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+uniform mat4 rotation;
+varying vec3 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+ vec4 direction = vec4(vPosition.x * 0.5, vPosition.y * 0.5, 1, 1);
+ texCoord = normalize((rotation * direction).xyz);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform samplerCube tex;
+varying vec3 texCoord;
+void main()
+{
+ gl_FragColor = textureCube(tex, normalize(texCoord));
+}
+</script>
+<script>
+"use strict";
+var canvas;
+description("Checks issues with size of cube map textures");
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+
+var gl = wtu.create3DContext(canvas);
+wtu.setupUnitQuad(gl, 0, 1);
+var program = wtu.setupProgram(
+ gl,
+ ['vshader', 'fshader'],
+ ['vPosition', 'texCoord0'], [0, 1]);
+var rotLoc = gl.getUniformLocation(program, "rotation");
+
+gl.disable(gl.DEPTH_TEST);
+gl.disable(gl.BLEND);
+
+var maxSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);
+debug("max cube map size: " + maxSize);
+maxSize = Math.min(512, maxSize);
+
+// a cube map of 512x512 takes 6meg. I'm assuming it's not
+// unreasonable to expect to be able to allocate a 6meg texture
+
+var colors = [
+ {name: 'red', color: [255, 0, 0, 255]},
+ {name: 'green', color: [ 0, 255, 0, 255]},
+ {name: 'blue', color: [ 0, 0, 255, 255]},
+ {name: 'yellow', color: [255, 255, 0, 255]},
+ {name: 'cyan', color: [ 0, 255, 255, 255]},
+ {name: 'magenta', color: [255, 0, 255, 255]}
+];
+
+var targets = [
+ 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];
+
+var rotations = [
+ {axis: [0, 1, 0], angle: Math.PI / 2},
+ {axis: [0, 1, 0], angle: -Math.PI / 2},
+ {axis: [1, 0, 0], angle: -Math.PI / 2},
+ {axis: [1, 0, 0], angle: Math.PI / 2},
+ {axis: [0, 1, 0], angle: 0},
+ {axis: [0, 1, 0], angle: Math.PI},
+];
+
+var halfRotations = [
+ {colors: [3, 4], rotations: [{axis: [1, 0, 0], angle: Math.PI / 4}]},
+ {colors: [4, 2], rotations: [{axis: [1, 0, 0], angle: -Math.PI / 4}]},
+ {colors: [5, 3], rotations: [{axis: [1, 0, 0], angle: Math.PI / 4 * 3}]},
+ {colors: [2, 5], rotations: [{axis: [1, 0, 0], angle: -Math.PI / 4 * 3}]},
+ {colors: [3, 0], rotations: [{axis: [0, 1, 0], angle: Math.PI / 2},
+ {axis: [1, 0, 0], angle: Math.PI / 4}]},
+ {colors: [0, 2], rotations: [{axis: [0, 1, 0], angle: Math.PI / 2},
+ {axis: [1, 0, 0], angle: -Math.PI / 4}]},
+];
+
+var count = 0;
+var sizeCount = 0;
+
+test();
+
+function test() {
+ var size = Math.pow(2, sizeCount);
+ if (size > maxSize || !testSize(size)) {
+ finishTest();
+ } else {
+ ++sizeCount;
+ setTimeout(test, 0);
+ }
+}
+
+function testSize(size) {
+ debug("");
+ debug("testing size: " + size);
+ var canvasSize = Math.max(size / 4, 2);
+ canvas.width = canvasSize;
+ canvas.height = canvasSize;
+ gl.viewport(0, 0, canvasSize, canvasSize);
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+
+ // Seems like I should be using LINEAR here with some other math
+ // to make sure I get more mip coverage but that's easier said
+ // than done.
+
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+
+ for (var jj = 0; jj < 2; ++jj) {
+ for (var tt = 0; tt < targets.length; ++tt) {
+ var color = colors[(tt + count) % colors.length];
+ fillLevel(targets[tt], 0, size, color.color);
+ }
+ if (jj == 1) {
+ debug("use mipmap");
+ gl.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER,
+ gl.NEAREST_MIPMAP_NEAREST);
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ }
+
+ var err = gl.getError();
+ if (err == gl.OUT_OF_MEMORY) {
+ debug("out of memory");
+ return false;
+ }
+ if (err != gl.NO_ERROR) {
+ testFailed("unexpected gl error: " + wtu.glEnumToString(gl, err));
+ }
+
+
+ for (var rr = 0; rr < rotations.length; ++rr) {
+ var rot = rotations[rr];
+ var color = colors[(rr + count) % colors.length];
+ var rotMat = axisRotation(rot.axis, rot.angle);
+ gl.uniformMatrix4fv(rotLoc, false, rotMat);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, color.color,
+ wtu.glEnumToString(gl, targets[rr]) + " should be " + color.name);
+ }
+
+ for (var rr = 0; rr < halfRotations.length; ++rr) {
+ var h = halfRotations[rr];
+ var rots = h.rotations;
+ var rotMat = axisRotation(rots[0].axis, rots[0].angle);
+ for (var ii = 1; ii < rots.length; ++ii) {
+ var tmpMat = axisRotation(rots[ii].axis, rots[ii].angle);
+ var rotMat = mulMatrix(tmpMat, rotMat);
+ }
+ gl.uniformMatrix4fv(rotLoc, false, rotMat);
+ wtu.clearAndDrawUnitQuad(gl);
+
+ for (var ii = 0; ii < 2; ++ii) {
+ checkRect(
+ 0,
+ canvasSize / 2 * ii,
+ canvasSize,
+ canvasSize / 2,
+ colors[(h.colors[ii] + count) % colors.length]);
+ }
+ }
+ ++count;
+ }
+
+ gl.deleteTexture(tex);
+ return true;
+}
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+
+function checkRect(x, y, width, height, color) {
+ wtu.checkCanvasRect(
+ gl,
+ x,
+ y,
+ width,
+ height,
+ color.color,
+ "" + x + ", " + y + ", " + width + ", " + height +
+ " should be " + color.name);
+}
+
+function fillLevel(target, level, size, color) {
+ var numPixels = size * size;
+ var pixels = new Uint8Array(numPixels * 4);
+ var pixelRow = new Uint8Array(size * 4);
+ for (var jj = 0; jj < size; ++jj) {
+ var off = jj * 4;
+ pixelRow[off + 0] = color[0];
+ pixelRow[off + 1] = color[1];
+ pixelRow[off + 2] = color[2];
+ pixelRow[off + 3] = color[3];
+ }
+ for (var jj = 0; jj < size; ++jj) {
+ var off = jj * size * 4;
+ pixels.set(pixelRow, off);
+ }
+ gl.texImage2D(
+ target, level, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ pixels);
+}
+
+function printMat(mat) {
+ debug("" + mat[0] + ", " + mat[1] + ", " + mat[2] + ", " + mat[3] + ", ");
+ debug("" + mat[4] + ", " + mat[5] + ", " + mat[6] + ", " + mat[7] + ", ");
+ debug("" + mat[8] + ", " + mat[9] + ", " + mat[10] + ", " + mat[11] + ", ");
+ debug("" + mat[12] + ", " + mat[13] + ", " + mat[14] + ", " + mat[15] + ", ");
+}
+
+function axisRotation(axis, angle) {
+ var dst = new Float32Array(16);
+ var x = axis[0];
+ var y = axis[1];
+ var z = axis[2];
+ var n = Math.sqrt(x * x + y * y + z * z);
+ x /= n;
+ y /= n;
+ z /= n;
+ var xx = x * x;
+ var yy = y * y;
+ var zz = z * z;
+ var c = Math.cos(angle);
+ var s = Math.sin(angle);
+ var oneMinusCosine = 1 - c;
+
+ dst[ 0] = xx + (1 - xx) * c;
+ dst[ 1] = x * y * oneMinusCosine + z * s;
+ dst[ 2] = x * z * oneMinusCosine - y * s;
+ dst[ 3] = 0;
+ dst[ 4] = x * y * oneMinusCosine - z * s;
+ dst[ 5] = yy + (1 - yy) * c;
+ dst[ 6] = y * z * oneMinusCosine + x * s;
+ dst[ 7] = 0;
+ dst[ 8] = x * z * oneMinusCosine + y * s;
+ dst[ 9] = y * z * oneMinusCosine - x * s;
+ dst[10] = zz + (1 - zz) * c;
+ dst[11] = 0;
+ dst[12] = 0;
+ dst[13] = 0;
+ dst[14] = 0;
+ dst[15] = 1;
+
+ return dst;
+};
+
+function mulMatrix(a, b) {
+ var dst = new Float32Array(16);
+ var a00 = a[0];
+ var a01 = a[1];
+ var a02 = a[2];
+ var a03 = a[3];
+ var a10 = a[ 4 + 0];
+ var a11 = a[ 4 + 1];
+ var a12 = a[ 4 + 2];
+ var a13 = a[ 4 + 3];
+ var a20 = a[ 8 + 0];
+ var a21 = a[ 8 + 1];
+ var a22 = a[ 8 + 2];
+ var a23 = a[ 8 + 3];
+ var a30 = a[12 + 0];
+ var a31 = a[12 + 1];
+ var a32 = a[12 + 2];
+ var a33 = a[12 + 3];
+ var b00 = b[0];
+ var b01 = b[1];
+ var b02 = b[2];
+ var b03 = b[3];
+ var b10 = b[ 4 + 0];
+ var b11 = b[ 4 + 1];
+ var b12 = b[ 4 + 2];
+ var b13 = b[ 4 + 3];
+ var b20 = b[ 8 + 0];
+ var b21 = b[ 8 + 1];
+ var b22 = b[ 8 + 2];
+ var b23 = b[ 8 + 3];
+ var b30 = b[12 + 0];
+ var b31 = b[12 + 1];
+ var b32 = b[12 + 2];
+ var b33 = b[12 + 3];
+ dst[ 0] = a00 * b00 + a01 * b10 + a02 * b20 + a03 * b30;
+ dst[ 1] = a00 * b01 + a01 * b11 + a02 * b21 + a03 * b31;
+ dst[ 2] = a00 * b02 + a01 * b12 + a02 * b22 + a03 * b32;
+ dst[ 3] = a00 * b03 + a01 * b13 + a02 * b23 + a03 * b33;
+ dst[ 4] = a10 * b00 + a11 * b10 + a12 * b20 + a13 * b30;
+ dst[ 5] = a10 * b01 + a11 * b11 + a12 * b21 + a13 * b31;
+ dst[ 6] = a10 * b02 + a11 * b12 + a12 * b22 + a13 * b32;
+ dst[ 7] = a10 * b03 + a11 * b13 + a12 * b23 + a13 * b33;
+ dst[ 8] = a20 * b00 + a21 * b10 + a22 * b20 + a23 * b30;
+ dst[ 9] = a20 * b01 + a21 * b11 + a22 * b21 + a23 * b31;
+ dst[10] = a20 * b02 + a21 * b12 + a22 * b22 + a23 * b32;
+ dst[11] = a20 * b03 + a21 * b13 + a22 * b23 + a23 * b33;
+ dst[12] = a30 * b00 + a31 * b10 + a32 * b20 + a33 * b30;
+ dst[13] = a30 * b01 + a31 * b11 + a32 * b21 + a33 * b31;
+ dst[14] = a30 * b02 + a31 * b12 + a32 * b22 + a33 * b32;
+ dst[15] = a30 * b03 + a31 * b13 + a32 * b23 + a33 * b33;
+ return dst;
+};
+</script>
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html
new file mode 100644
index 0000000000..3e093b3a53
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size-limit.html
@@ -0,0 +1,167 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture size limit conformance 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>
+</head>
+<body>
+<canvas id="example" width="32" height="32" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description("Checks various size limits of textures")
+var canvas;
+
+function numLevelsFromSize(size) {
+ var levels = 0;
+ while ((size >> levels) > 0) {
+ ++levels;
+ }
+ return levels;
+}
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var tests = [
+ { format: gl.ALPHA, type: gl.UNSIGNED_BYTE, size: 1, dataType: Uint8Array },
+ { format: gl.LUMINANCE, type: gl.UNSIGNED_BYTE, size: 1, dataType: Uint8Array },
+ { format: gl.LUMINANCE_ALPHA, type: gl.UNSIGNED_BYTE, size: 2, dataType: Uint8Array },
+ { format: gl.RGB, type: gl.UNSIGNED_BYTE, size: 3, dataType: Uint8Array },
+ { format: gl.RGB, type: gl.UNSIGNED_SHORT_5_6_5, size: 1, dataType: Uint16Array },
+ { format: gl.RGBA, type: gl.UNSIGNED_BYTE, size: 4, dataType: Uint8Array },
+ { format: gl.RGBA, type: gl.UNSIGNED_SHORT_4_4_4_4, size: 1, dataType: Uint16Array },
+ { format: gl.RGBA, type: gl.UNSIGNED_SHORT_5_5_5_1, size: 1, dataType: Uint16Array }
+];
+
+// Note: We expressly only use 2 textures because first a texture will be defined
+// using all mip levels of 1 format, then for a moment it will have mixed formats which
+// may uncover bugs.
+var targets = [
+ { target: gl.TEXTURE_2D,
+ maxSize: gl.getParameter(gl.MAX_TEXTURE_SIZE),
+ maxLevel: 1000,
+ targets: [gl.TEXTURE_2D]
+ },
+ { target: gl.TEXTURE_CUBE_MAP,
+ maxSize: gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE),
+ maxLevel: 5,
+ targets: [
+ 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
+ ]
+ }
+];
+
+gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1);
+
+var trg = 0;
+var tt = 0;
+var tex = null;
+runNextTest();
+
+function runNextTest() {
+ var t = targets[trg];
+
+ if (tt == 0) {
+ gl.deleteTexture(tex);
+ tex = gl.createTexture();
+ gl.bindTexture(t.target, tex);
+
+ debug("");
+ debug("max size for " + wtu.glEnumToString(gl, t.target) + ": " + t.maxSize);
+ var numLevels = numLevelsFromSize(t.maxSize);
+ debug("num levels " + numLevels);
+ }
+
+ var test = tests[tt];
+ testFormatType(t, test);
+ ++tt;
+ if (tt == tests.length) {
+ tt = 0;
+ ++trg;
+ if (trg == targets.length) {
+ finishTest();
+ return;
+ }
+ }
+ wtu.dispatchPromise(runNextTest);
+}
+
+function testFormatType(t, test) {
+ debug("");
+ debug("testing: " + wtu.glEnumToString(gl, test.format) + ", " + wtu.glEnumToString(gl, test.type));
+
+ for (var j = 0; j < t.targets.length; ++j) {
+ var target = t.targets[j];
+ debug("");
+ debug(wtu.glEnumToString(gl, target));
+ var numLevels = numLevelsFromSize(t.maxSize);
+
+ // out of bounds tests
+ for (var i = 0; i < numLevels; i++) {
+ // width and height out of bounds
+ var size = t.maxSize >> i;
+ gl.texImage2D(target, i, test.format, size + 1, size + 1, 0, test.format, test.type, null);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "width or height out of bounds: should generate INVALID_VALUE: level is " + i + ", size is "
+ + (size + 1) + "x" + (size + 1));
+ }
+ // level out of bounds
+ gl.texImage2D(target, numLevels, test.format, 1, 1, 0, test.format, test.type, null);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "level out of bounds: should generate INVALID_VALUE: level is: "
+ + numLevels + ", size is 1x1.");
+
+ // Probe to discover the max non-OOM level.
+ // For instance, on some drivers (at least Intel+Mesa) we can create
+ // a maxLevel L8 texture, but only a maxLevel-1 RGB8 texture.
+ var maxLevelsForFormat = numLevels;
+ while (true) {
+ gl.texImage2D(target, maxLevelsForFormat-1, test.format, 1, 1, 0, test.format, test.type, null);
+ var err = gl.getError();
+ if (err == gl.OUT_OF_MEMORY) {
+ debug("Probe failed for level=" + (maxLevelsForFormat-1) + ", reducing...");
+ maxLevelsForFormat -= 1;
+ if (!maxLevelsForFormat) {
+ testFailed("Failed to allocate any levels for format " + test.format);
+ return;
+ }
+ continue;
+ }
+ if (err) {
+ testFailed("Should not hit non-OOM errors during max level probing.");
+ return;
+ }
+ break;
+ }
+ var numTestLevels = Math.min(maxLevelsForFormat, t.maxLevel);
+ for (var l = 0; l < numTestLevels; ++l) {
+ // Do bottom levels first;
+ var size = 1 << l;
+ var level = maxLevelsForFormat - l - 1;
+ var otherDimension = t.target == gl.TEXTURE_2D ? 1 : size;
+ gl.texImage2D(target, level, test.format, size, otherDimension, 0, test.format, test.type, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + size + "x" + otherDimension);
+ if (otherDimension != size) {
+ gl.texImage2D(target, level, test.format, otherDimension, size, 0, test.format, test.type, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no error for level: " + level + " " + otherDimension + "x" + size);
+ }
+ }
+ }
+}
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html
new file mode 100644
index 0000000000..12d99ac89f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-size.html
@@ -0,0 +1,217 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture size conformance 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>
+</head>
+<body>
+<canvas id="example" width="32" height="32" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+attribute vec3 texCoord0;
+varying vec3 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+ texCoord = texCoord0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform samplerCube tex;
+varying vec3 texCoord;
+void main()
+{
+ gl_FragColor = textureCube(tex, normalize(texCoord));
+}
+</script>
+<script>
+"use strict";
+description("Checks that various sizes of textures render")
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program2D = wtu.setupTexturedQuad(gl);
+var programCubeMap = wtu.setupProgram(
+ gl, ['vshader', 'fshader'], ['vPosition', 'texCoord0'], [0, 1]);
+gl.disable(gl.DEPTH_TEST);
+gl.disable(gl.BLEND);
+var tex = gl.createTexture();
+var max2DSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
+var maxCubeMapSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);
+debug("MAX_TEXTURE_SIZE:" + max2DSize);
+debug("MAX_CUBE_MAP_TEXTURE_SIZE:" + maxCubeMapSize);
+// Assuming 2048x2048xRGBA (22meg with mips) will run on all WebGL platforms
+var max2DSquareSize = Math.min(max2DSize, 2048);
+// I'd prefer this to be 2048 but that's 16meg x 6 faces or 128meg (with mips)
+// 1024 is 33.5 meg (with mips)
+var maxCubeMapSize = Math.min(maxCubeMapSize, 1024);
+
+var colors = [
+ { name: "green", rgba: [0, 0, 255, 255] },
+ { name: "red", rgba: [255, 0, 0, 255] },
+ { name: "blue", rgba: [0, 255, 0, 255] },
+ { name: "yellow", rgba: [255, 255, 0, 255] },
+ { name: "magenta", rgba: [255, 0, 255, 255] },
+ { name: "cyan", rgba: [0, 255, 255, 255] }
+];
+
+var count = 0;
+var power = 0;
+runTest();
+
+function runTest() {
+ function doTest() {
+ var size = Math.pow(2, power);
+ if (size > max2DSize) {
+ return false;
+ }
+ gl.useProgram(program2D);
+ if (!checkTexture(size, 1, false)) return false;
+ if (!checkTexture(1, size, false)) return false;
+ if (size <= max2DSquareSize) {
+ if (!checkTexture(size, size, false)) {
+ return false;
+ }
+ }
+ if (size <= maxCubeMapSize) {
+ gl.useProgram(programCubeMap);
+ if (!checkTexture(size, size, true)) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ if (doTest()) {
+ ++power;
+ setTimeout(runTest, 0);
+ } else {
+ finishTest();
+ }
+}
+
+function checkTexture(width, height, cubeMap) {
+ debug("");
+ count = (count + 1) % colors.length;
+ var color = colors[count];
+ var tex = gl.createTexture();
+ var target = cubeMap ? gl.TEXTURE_CUBE_MAP : gl.TEXTURE_2D;
+ var type = cubeMap ? "cube map" : "2D texture";
+ debug("check " + width + ", " + height + " " + type);
+ gl.bindTexture(target, tex);
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ fillLevel(0, width, height, color.rgba, cubeMap);
+ var err = gl.getError();
+ if (err == gl.OUT_OF_MEMORY) {
+ debug("out of memory");
+ return false;
+ }
+ if (err != gl.NO_ERROR) {
+ testFailed("unexpected gl error: " + wtu.glEnumToString(gl, err));
+ }
+ wtu.clearAndDrawUnitQuad(gl);
+ var tolerance = 3;
+ wtu.checkCanvas(gl, color.rgba,
+ type + " of size " + width + "x" + height + " with no mips should draw with " + color.name,
+ tolerance);
+ count = (count + 1) % colors.length;
+ color = colors[count];
+ fillLevel(0, width, height, color.rgba, cubeMap);
+ gl.generateMipmap(target);
+ var err = gl.getError();
+ if (err == gl.OUT_OF_MEMORY) {
+ debug("out of memory");
+ return false;
+ }
+ if (err != gl.NO_ERROR) {
+ testFailed("unexpected gl error: " + wtu.glEnumToString(gl, err));
+ }
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, color.rgba,
+ type + " of size " + width + "x" + height + " with mips should draw with " + color.name,
+ tolerance);
+
+ count = (count + 1) % colors.length;
+ color = colors[count];
+ fillLevel(0, width, height, color.rgba, cubeMap, true);
+ gl.generateMipmap(target);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, color.rgba,
+ type + " of size " + width + "x" + height + " with mips should draw with " + color.name,
+ tolerance);
+
+ gl.deleteTexture(tex);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+ return true;
+}
+
+function fillLevel(level, width, height, color, opt_cubemap, opt_subTex) {
+ var numPixels = width * height;
+ var pixels = null;
+ var largeDim = Math.max(width, height);
+ var smallDim = Math.min(width, height);
+
+ var pixelRow = new Uint8Array(largeDim * 4);
+ for (var jj = 0; jj < largeDim; ++jj) {
+ var off = jj * 4;
+ pixelRow[off + 0] = color[0];
+ pixelRow[off + 1] = color[1];
+ pixelRow[off + 2] = color[2];
+ pixelRow[off + 3] = color[3];
+ }
+
+ if (largeDim == numPixels) {
+ pixels = pixelRow;
+ } else {
+ var pixels = new Uint8Array(numPixels * 4);
+ for (var jj = 0; jj < smallDim; ++jj) {
+ var off = jj * largeDim * 4;
+ pixels.set(pixelRow, off);
+ }
+ }
+
+ var targets = opt_cubemap ? [
+ 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] :
+ [gl.TEXTURE_2D];
+
+ for (var ii = 0; ii < targets.length; ++ii) {
+ // debug(wtu.glEnumToString(gl, targets[ii]));
+ var index = (ii + power) % targets.length;
+ var target = targets[index];
+ if (opt_subTex) {
+ gl.texSubImage2D(
+ target, level, 0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE,
+ pixels);
+ } else {
+ gl.texImage2D(
+ target, level, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ pixels);
+ }
+ }
+}
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html
new file mode 100644
index 0000000000..3508670563
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-srgb-upload.html
@@ -0,0 +1,253 @@
+<!--
+Copyright (c) 2022 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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Upload texture from video into srgb internalformats</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+ <div id="description"></div>
+ <div id="console"></div>
+ <div>
+ Video:
+ <canvas id="e_rgba" width="300" height="200"></canvas>
+ 0x7f: <canvas id="e_rgba_color" width="30" height="200"></canvas>
+ <div>GL.RGBA</div>
+ </div>
+ <hr>
+ <div>
+ Video:
+ <canvas id="e_srgb8" width="300" height="200"></canvas>
+ 0x7f: <canvas id="e_srgb8_color" width="30" height="200"></canvas>
+ <div>GL.SRGB8</div>
+ </div>
+ <hr>
+ <div>
+ Video:
+ <canvas id="e_srgb8_alpha8" width="300" height="200"></canvas>
+ 0x7f: <canvas id="e_srgb8_alpha8_color" width="30" height="200"></canvas>
+ <div>GL.SRGB8_ALPHA8</div>
+ </div>
+<script>
+"use strict";
+const wtu = WebGLTestUtils;
+description();
+
+const DATA_URL_FOR_720p_png_bt709_bt709_tv_yuv420p_vp9_webm = '\
+data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEA\
+AAAAAAMBEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggElTbuMU6u\
+EHFO7a1OsggLr7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQ\
+kBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua9quAQAAAAAAAFHXgQFzxYgAAAAAAAAAAZyBACK1\
+nIN1bmSGhVZfVlA5g4EBI+ODhAJiWgDgAQAAAAAAAB6wggUAuoIC0JqBAlWwkFW6gQFVsYEBVbuBAVW\
+5gQESVMNn43NzAQAAAAAAAFljwItjxYgAAAAAAAAAAWfIAQAAAAAAABxFo4dFTkNPREVSRIePTGF2Yy\
+BsaWJ2cHgtdnA5Z8iiRaOIRFVSQVRJT05Eh5QwMDowMDowMC4wNDAwMDAwMDAAAB9DtnVBWOeBAKNBU\
+oEAAICCSYNCQE/wLPYAOCQcGAAYAFB/N9H/HZUjnnscu9GvIJt3936AAAAAACh4E4g/fJ8GmILlgmQ6\
+iUMwWlrCvdZpJAjY24ONeWCZEIrug5k4YTeAAAAAaXgTiD98nwaYguWCZDq6Zy9PLtRqFgTRRWpDzEC\
+RrKr8wtgzCibnQJwWtOOaHH9ZRjl4+aOQHHoHk/YUdplRSYiwuJO6LIyUXumq92uzm/wLAqBN0N9kRR\
+evcxyTv6VcsFqLJ5W5INE4AAAAAGN4E3vgaWsaGceNeWlTmlA/W7BnrSNUEx9X/o/hlK8PPDCgN5Kpw\
+0gRJkKtiMQMtYO7DQAUWLnf3+GjIUUj4hiAGdY+FNLJIdswhZLCeSDQfqV1btKL/ns57OfXQc0R3HFz\
+YyB4E3vgaWsaGceNeWjppQzBaWtIcWVNbYO5ARh7kHkq6WBosnlbkfoAHFO7a5G7j7OBALeK94EB8YI\
+BjfCBAw==';
+
+function invoke(fn) { return fn(); }
+
+invoke(async () => {
+ const video = document.createElement("video");
+ video.src = DATA_URL_FOR_720p_png_bt709_bt709_tv_yuv420p_vp9_webm;
+ //video.src = "Big_Buck_Bunny_360_10s_1MB.mp4";
+ //video.src = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
+ video.muted = true;
+ video.loop = true;
+ video.crossOrigin = "anonymous";
+ await video.play();
+
+ function renderTex(canvas, fn_tex_image) {
+ const gl = canvas.gl = wtu.create3DContext(canvas);
+
+ const vs = `
+attribute float a_VertexID;
+varying vec2 v_uv;
+void main() {
+ float id = a_VertexID;
+ v_uv.x = mod(id, 2.0);
+ id -= v_uv.x;
+ id /= 2.0;
+ v_uv.y = mod(id, 2.0);
+ gl_Position = vec4(2.0 * v_uv - 1.0, 0, 1);
+}`;
+
+ const fs = `
+precision mediump float;
+uniform sampler2D tex;
+varying vec2 v_uv;
+void main() {
+ gl_FragColor = texture2D(tex, v_uv);
+}`;
+
+ const program = gl.createProgram();
+ let shader = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(shader, vs);
+ gl.compileShader(shader);
+ gl.attachShader(program, shader);
+ shader = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(shader, fs);
+ gl.compileShader(shader);
+ gl.attachShader(program, shader);
+ gl.bindAttribLocation(program, 0, 'a_VertexID');
+ gl.linkProgram(program);
+ gl.useProgram(program);
+ if (gl.getError()) throw 'Error during linking';
+
+ const vbuf = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbuf);
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0,1,2,3]), gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 1, gl.FLOAT, false, 0, 0);
+
+ const texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ 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);
+
+ const draw = function() {
+ //requestAnimationFrame(draw);
+ fn_tex_image(gl);
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+ };
+ draw();
+
+ if (gl.getError()) throw 'Error during drawing';
+ }
+
+ const GL = WebGL2RenderingContext;
+ const COLOR_DATA = new Uint8Array([127, 127, 127, 255]);
+
+ function internalformat_webgl1or2(gl, internalformat_name) {
+ let internalformat = gl[internalformat_name];
+ if (!internalformat) {
+ const ext = gl.getExtension('EXT_srgb');
+ if (!ext) {
+ testPassed('EXT_srgb not supported. (ok!)');
+ return;
+ }
+ switch (internalformat_name) {
+ case 'SRGB8':
+ internalformat = ext.SRGB_EXT;
+ break;
+ case 'SRGB8_ALPHA8':
+ internalformat = ext.SRGB_ALPHA_EXT;
+ break;
+ default:
+ throw internalformat_name;
+ }
+ }
+ return internalformat;
+ }
+
+ function begin(e_video, e_color, internalformat_name, unpackformat) {
+ renderTex(e_video, gl => {
+ const internalformat = internalformat_webgl1or2(gl, internalformat_name);
+ if (!gl.SRGB8) {
+ unpackformat = internalformat; // Must match in webgl1.
+ }
+ gl.texImage2D(GL.TEXTURE_2D, 0, internalformat,
+ unpackformat, GL.UNSIGNED_BYTE, video);
+ });
+ renderTex(e_color, gl => {
+ const internalformat = internalformat_webgl1or2(gl, internalformat_name);
+ if (!gl.SRGB8) {
+ unpackformat = internalformat; // Must match in webgl1.
+ }
+ gl.texImage2D(GL.TEXTURE_2D, 0, internalformat, 1, 1, 0,
+ unpackformat, GL.UNSIGNED_BYTE, COLOR_DATA);
+ });
+ }
+
+ begin(e_rgba, e_rgba_color, 'RGBA', GL.RGBA);
+ begin(e_srgb8, e_srgb8_color, 'SRGB8', GL.RGB);
+ begin(e_srgb8_alpha8, e_srgb8_alpha8_color, 'SRGB8_ALPHA8', GL.RGBA);
+
+ // -
+
+ const GREY50_COLOR_COORD = {
+ x: 0,
+ y: 0,
+ };
+ const GREY50_TEX_COORD = {
+ x: e_rgba.width/2 + 1,
+ y: e_rgba.height/2 + 1,
+ };
+ const fn_test = (canvas, coord, data) => {
+ wtu.checkCanvasRect(canvas.gl, coord.x, coord.y, 1, 1, data,
+ `${canvas.id} @${JSON.stringify(coord)}`);
+ }
+
+ debug('');
+ debug('e_rgba');
+ fn_test(e_rgba_color, GREY50_COLOR_COORD, [0x7f, 0x7f, 0x7f, 0xff]);
+ fn_test(e_rgba, GREY50_TEX_COORD, [0x7f, 0x7f, 0x7f, 0xff]);
+
+ debug('');
+ debug('e_srgb8');
+ fn_test(e_srgb8_color, GREY50_COLOR_COORD, [0x36, 0x36, 0x36, 0xff]);
+ fn_test(e_srgb8, GREY50_TEX_COORD, [0x36, 0x36, 0x36, 0xff]);
+
+ debug('');
+ debug('e_srgb8_alpha8');
+ fn_test(e_srgb8_alpha8_color, GREY50_COLOR_COORD, [0x36, 0x36, 0x36, 0xff]);
+ fn_test(e_srgb8_alpha8, GREY50_TEX_COORD, [0x36, 0x36, 0x36, 0xff]);
+
+ finishTest();
+});
+
+/*
+async function blobToDataURL(blob) {
+ const fr = new FileReader();
+ return await new Promise((yes, no) => {
+ fr.addEventListener('loadend', ev => {
+ if (fr.result) {
+ return yes(fr.result);
+ }
+ return no(fr.error);
+ });
+ fr.readAsDataURL(blob);
+ });
+}
+
+async function fetchDataUrl(url, wrapAt) {
+ const r = await fetch(url);
+ const b = await r.blob();
+ const durl = await blobToDataURL(b);
+ return durl;
+}
+
+function wrapLines(str, wrapAt) {
+ const lines = [];
+ let remaining = str;
+ while (remaining) {
+ lines.push(remaining.slice(0, wrapAt));
+ remaining = remaining.slice(wrapAt);
+ }
+ return lines;
+}
+
+(async () => {
+ const url = '720p.png.bt709.bt709.tv.yuv420p.vp9.webm';
+ const ident = 'DATA_URL_FOR_' + url.replaceAll('.', '_');
+ const durl = await fetchDataUrl(url);
+ const lines = wrapLines(durl, 79);
+ console.log(ident, '= \'\\\n' + lines.join('\\\n') + '\';');
+})();
+*/
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html
new file mode 100644
index 0000000000..ca5740766a
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-sub-image-cube-maps.html
@@ -0,0 +1,316 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture texSubImage2Ds cube map conformance 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>
+</head>
+<body>
+<canvas id="example" width="256" height="256" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+uniform mat4 rotation;
+varying vec3 texCoord;
+void main()
+{
+ gl_Position = vPosition;
+ vec4 direction = vec4(vPosition.x * 0.5, vPosition.y * 0.5, 1, 1);
+ texCoord = normalize((rotation * direction).xyz);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+uniform samplerCube tex;
+varying vec3 texCoord;
+void main()
+{
+ gl_FragColor = textureCube(tex, normalize(texCoord));
+}
+</script>
+<script>
+"use strict";
+var canvas;
+description("Checks issues with size of cube map textures");
+debug("");
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+
+var gl = wtu.create3DContext(canvas);
+wtu.setupUnitQuad(gl, 0, 1);
+var program = wtu.setupProgram(
+ gl,
+ ['vshader', 'fshader'],
+ ['vPosition', 'texCoord0'], [0, 1]);
+var rotLoc = gl.getUniformLocation(program, "rotation");
+
+var size = 16;
+
+var colors = [
+ {name: 'red', color: [255, 0, 0, 255]},
+ {name: 'green', color: [ 0, 255, 0, 255]},
+ {name: 'blue', color: [ 0, 0, 255, 255]},
+ {name: 'yellow', color: [255, 255, 0, 255]},
+ {name: 'cyan', color: [ 0, 255, 255, 255]},
+ {name: 'magenta', color: [255, 0, 255, 255]}
+];
+
+var targets = [
+ 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];
+
+var rotations = [
+ {axis: [0, 1, 0], angle: Math.PI / 2},
+ {axis: [0, 1, 0], angle: -Math.PI / 2},
+ {axis: [1, 0, 0], angle: -Math.PI / 2},
+ {axis: [1, 0, 0], angle: Math.PI / 2},
+ {axis: [0, 1, 0], angle: 0},
+ {axis: [0, 1, 0], angle: Math.PI},
+];
+
+var halfRotations = [
+ {colors: [3, 4], rotations: [{axis: [1, 0, 0], angle: Math.PI / 4}]},
+ {colors: [4, 2], rotations: [{axis: [1, 0, 0], angle: -Math.PI / 4}]},
+ {colors: [5, 3], rotations: [{axis: [1, 0, 0], angle: Math.PI / 4 * 3}]},
+ {colors: [2, 5], rotations: [{axis: [1, 0, 0], angle: -Math.PI / 4 * 3}]},
+ {colors: [3, 0], rotations: [{axis: [0, 1, 0], angle: Math.PI / 2},
+ {axis: [1, 0, 0], angle: Math.PI / 4}]},
+ {colors: [0, 2], rotations: [{axis: [0, 1, 0], angle: Math.PI / 2},
+ {axis: [1, 0, 0], angle: -Math.PI / 4}]},
+];
+
+var count = 0;
+testSize(size);
+
+function testSize(size) {
+ debug("");
+ debug("testing size: " + size);
+ var canvasSize = Math.max(size / 4, 2);
+ canvas.width = canvasSize;
+ canvas.height = canvasSize;
+ gl.viewport(0, 0, canvasSize, canvasSize);
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+
+ // Seems like I should be using LINEAR here with some other math
+ // to make sure I get more mip coverage but that's easier said
+ // than done.
+
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER, gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MAG_FILTER, gl.NEAREST);
+
+ for (var jj = 0; jj < 2; ++jj) {
+ for (var tt = 0; tt < targets.length; ++tt) {
+ var color = colors[(tt + count) % colors.length];
+ fillLevel(targets[tt], 0, size, color.color);
+ }
+ if (jj == 1) {
+ debug("use mipmap");
+ gl.texParameteri(
+ gl.TEXTURE_CUBE_MAP, gl.TEXTURE_MIN_FILTER,
+ gl.NEAREST_MIPMAP_NEAREST);
+ gl.generateMipmap(gl.TEXTURE_CUBE_MAP);
+ }
+
+ var err = gl.getError();
+ if (err == gl.OUT_OF_MEMORY) {
+ debug("out of memory");
+ return false;
+ }
+ if (err != gl.NO_ERROR) {
+ testFailed("unexpected gl error: " + wtu.glEnumToString(gl, err));
+ }
+
+
+ for (var rr = 0; rr < rotations.length; ++rr) {
+ var rot = rotations[rr];
+ var color = colors[(rr + count) % colors.length];
+ var rotMat = axisRotation(rot.axis, rot.angle);
+ gl.uniformMatrix4fv(rotLoc, false, rotMat);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(
+ gl, color.color,
+ wtu.glEnumToString(gl, targets[rr]) + " should be " + color.name);
+ }
+
+ for (var rr = 0; rr < halfRotations.length; ++rr) {
+ var h = halfRotations[rr];
+ var rots = h.rotations;
+ var rotMat = axisRotation(rots[0].axis, rots[0].angle);
+ for (var ii = 1; ii < rots.length; ++ii) {
+ var tmpMat = axisRotation(rots[ii].axis, rots[ii].angle);
+ var rotMat = mulMatrix(tmpMat, rotMat);
+ }
+ gl.uniformMatrix4fv(rotLoc, false, rotMat);
+ wtu.clearAndDrawUnitQuad(gl);
+
+ for (var ii = 0; ii < 2; ++ii) {
+ checkRect(
+ 0,
+ canvasSize / 2 * ii,
+ canvasSize,
+ canvasSize / 2,
+ colors[(h.colors[ii] + count) % colors.length]);
+ }
+ }
+ ++count;
+ }
+
+ gl.deleteTexture(tex);
+ return true;
+}
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors.");
+
+function checkRect(x, y, width, height, color) {
+ wtu.checkCanvasRect(
+ gl,
+ x,
+ y,
+ width,
+ height,
+ color.color,
+ "" + x + ", " + y + ", " + width + ", " + height +
+ " should be " + color.name);
+}
+
+function fillLevel(target, level, size, color) {
+ var numPixels = size * size;
+ var halfPixelRow = new Uint8Array(size * 2);
+ for (var jj = 0; jj < size; ++jj) {
+ var off = jj * 4;
+ halfPixelRow[off + 0] = color[0];
+ halfPixelRow[off + 1] = color[1];
+ halfPixelRow[off + 2] = color[2];
+ halfPixelRow[off + 3] = color[3];
+ }
+ gl.texImage2D(
+ target, level, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE,
+ null);
+ for (var jj = 0; jj < size; ++jj) {
+ gl.texSubImage2D(
+ target, level, 0, jj, size / 2, 1, gl.RGBA, gl.UNSIGNED_BYTE, halfPixelRow);
+ gl.texSubImage2D(
+ target, level, size / 2, jj, size / 2, 1, gl.RGBA, gl.UNSIGNED_BYTE, halfPixelRow);
+ }
+}
+
+function printMat(mat) {
+ debug("" + mat[0] + ", " + mat[1] + ", " + mat[2] + ", " + mat[3] + ", ");
+ debug("" + mat[4] + ", " + mat[5] + ", " + mat[6] + ", " + mat[7] + ", ");
+ debug("" + mat[8] + ", " + mat[9] + ", " + mat[10] + ", " + mat[11] + ", ");
+ debug("" + mat[12] + ", " + mat[13] + ", " + mat[14] + ", " + mat[15] + ", ");
+}
+
+function axisRotation(axis, angle) {
+ var dst = new Float32Array(16);
+ var x = axis[0];
+ var y = axis[1];
+ var z = axis[2];
+ var n = Math.sqrt(x * x + y * y + z * z);
+ x /= n;
+ y /= n;
+ z /= n;
+ var xx = x * x;
+ var yy = y * y;
+ var zz = z * z;
+ var c = Math.cos(angle);
+ var s = Math.sin(angle);
+ var oneMinusCosine = 1 - c;
+
+ dst[ 0] = xx + (1 - xx) * c;
+ dst[ 1] = x * y * oneMinusCosine + z * s;
+ dst[ 2] = x * z * oneMinusCosine - y * s;
+ dst[ 3] = 0;
+ dst[ 4] = x * y * oneMinusCosine - z * s;
+ dst[ 5] = yy + (1 - yy) * c;
+ dst[ 6] = y * z * oneMinusCosine + x * s;
+ dst[ 7] = 0;
+ dst[ 8] = x * z * oneMinusCosine + y * s;
+ dst[ 9] = y * z * oneMinusCosine - x * s;
+ dst[10] = zz + (1 - zz) * c;
+ dst[11] = 0;
+ dst[12] = 0;
+ dst[13] = 0;
+ dst[14] = 0;
+ dst[15] = 1;
+
+ return dst;
+};
+
+function mulMatrix(a, b) {
+ var dst = new Float32Array(16);
+ var a00 = a[0];
+ var a01 = a[1];
+ var a02 = a[2];
+ var a03 = a[3];
+ var a10 = a[ 4 + 0];
+ var a11 = a[ 4 + 1];
+ var a12 = a[ 4 + 2];
+ var a13 = a[ 4 + 3];
+ var a20 = a[ 8 + 0];
+ var a21 = a[ 8 + 1];
+ var a22 = a[ 8 + 2];
+ var a23 = a[ 8 + 3];
+ var a30 = a[12 + 0];
+ var a31 = a[12 + 1];
+ var a32 = a[12 + 2];
+ var a33 = a[12 + 3];
+ var b00 = b[0];
+ var b01 = b[1];
+ var b02 = b[2];
+ var b03 = b[3];
+ var b10 = b[ 4 + 0];
+ var b11 = b[ 4 + 1];
+ var b12 = b[ 4 + 2];
+ var b13 = b[ 4 + 3];
+ var b20 = b[ 8 + 0];
+ var b21 = b[ 8 + 1];
+ var b22 = b[ 8 + 2];
+ var b23 = b[ 8 + 3];
+ var b30 = b[12 + 0];
+ var b31 = b[12 + 1];
+ var b32 = b[12 + 2];
+ var b33 = b[12 + 3];
+ dst[ 0] = a00 * b00 + a01 * b10 + a02 * b20 + a03 * b30;
+ dst[ 1] = a00 * b01 + a01 * b11 + a02 * b21 + a03 * b31;
+ dst[ 2] = a00 * b02 + a01 * b12 + a02 * b22 + a03 * b32;
+ dst[ 3] = a00 * b03 + a01 * b13 + a02 * b23 + a03 * b33;
+ dst[ 4] = a10 * b00 + a11 * b10 + a12 * b20 + a13 * b30;
+ dst[ 5] = a10 * b01 + a11 * b11 + a12 * b21 + a13 * b31;
+ dst[ 6] = a10 * b02 + a11 * b12 + a12 * b22 + a13 * b32;
+ dst[ 7] = a10 * b03 + a11 * b13 + a12 * b23 + a13 * b33;
+ dst[ 8] = a20 * b00 + a21 * b10 + a22 * b20 + a23 * b30;
+ dst[ 9] = a20 * b01 + a21 * b11 + a22 * b21 + a23 * b31;
+ dst[10] = a20 * b02 + a21 * b12 + a22 * b22 + a23 * b32;
+ dst[11] = a20 * b03 + a21 * b13 + a22 * b23 + a23 * b33;
+ dst[12] = a30 * b00 + a31 * b10 + a32 * b20 + a33 * b30;
+ dst[13] = a30 * b01 + a31 * b11 + a32 * b21 + a33 * b31;
+ dst[14] = a30 * b02 + a31 * b12 + a32 * b22 + a33 * b32;
+ dst[15] = a30 * b03 + a31 * b13 + a32 * b23 + a33 * b33;
+ return dst;
+};
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html
new file mode 100644
index 0000000000..7fcf384edc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-transparent-pixels-initialized.html
@@ -0,0 +1,87 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = null;
+var texture;
+var textureLoc = null;
+var successfullyParsed = false;
+
+function init()
+{
+ description('Tests there is no garbage in transparent regions of images uploaded as textures');
+
+ wtu = WebGLTestUtils;
+ gl = wtu.create3DContext("example");
+ var program = wtu.setupTexturedQuad(gl);
+ gl.clearColor(0.5,0.5,0.5,1);
+ gl.clearDepth(1);
+
+ textureLoc = gl.getUniformLocation(program, "tex");
+
+ // The input texture has 8 characters; take the leftmost one
+ var coeff = 1.0 / 8.0;
+ var texCoords = new Float32Array([
+ coeff, 1.0,
+ 0.0, 1.0,
+ 0.0, 0.0,
+ coeff, 1.0,
+ 0.0, 0.0,
+ coeff, 0.0]);
+
+ var vbo = gl.createBuffer();
+ gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
+ gl.bufferData(gl.ARRAY_BUFFER, texCoords, gl.STATIC_DRAW);
+ gl.enableVertexAttribArray(1);
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+
+ texture = wtu.loadTexture(gl, "../../../resources/bug-32888-texture.png", runTest);
+}
+
+// These two declarations need to be global for "shouldBe" to see them
+var buf = null;
+var idx = 0;
+
+function runTest()
+{
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
+ // Bind the texture to texture unit 0
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ // Point the uniform sampler to texture unit 0
+ gl.uniform1i(textureLoc, 0);
+ // Draw the triangles
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+
+ // Spot check a couple of 2x2 regions in the upper and lower left
+ // corners; they should be the rgb values in the texture.
+ var color = [0, 0, 0];
+ debug("Checking lower left corner");
+ wtu.checkCanvasRect(gl, 1, gl.canvas.height - 3, 2, 2, color,
+ "shouldBe " + color);
+ debug("Checking upper left corner");
+ wtu.checkCanvasRect(gl, 1, 1, 2, 2, color,
+ "shouldBe " + color);
+
+ finishTest();
+}
+</script>
+</head>
+<body onload="init()">
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html
new file mode 100644
index 0000000000..c0104fe127
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-cube-maps.html
@@ -0,0 +1,52 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="2" height="2"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+description('Tests texImage2D and texSubImage2D upload path for TEXTURE_CUBE_MAP');
+
+var wtu = WebGLTestUtils;
+var canvas = document.getElementById("example");
+var gl = wtu.create3DContext(canvas);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup.");
+
+function testOneTarget(target, width, height) {
+ var tex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, tex);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from bindTexture(TEXTURE_CUBE_MAP).");
+
+ gl.texImage2D(target, 0, gl.RGB, width, height, 0, gl.RGB, gl.UNSIGNED_BYTE, null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from texImage2D.");
+
+ var buf = new Uint8Array(width * height * 3);
+ gl.texSubImage2D(target, 0, 0, 0, width, height, gl.RGB, gl.UNSIGNED_BYTE, buf);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from texSubImage2D.");
+}
+
+testOneTarget(gl.TEXTURE_CUBE_MAP_POSITIVE_X, 16, 16);
+testOneTarget(gl.TEXTURE_CUBE_MAP_POSITIVE_Y, 16, 16);
+testOneTarget(gl.TEXTURE_CUBE_MAP_POSITIVE_Z, 16, 16);
+testOneTarget(gl.TEXTURE_CUBE_MAP_NEGATIVE_X, 16, 16);
+testOneTarget(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, 16, 16);
+testOneTarget(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, 16, 16);
+
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html
new file mode 100644
index 0000000000..a0f30dc89f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-upload-size.html
@@ -0,0 +1,151 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture upload size conformance 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>
+</head>
+<body>
+<canvas id="canvas"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+enableJSTestPreVerboseLogging();
+description("Checks that the size of a texture uploaded from an element is set correctly.");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+
+var testUpload = function(upload, expectedWidth, expectedHeight) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, upload);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "when calling texImage2D");
+ wtu.checkTextureSize(gl, expectedWidth, expectedHeight);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, upload);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "when calling texSubImage2D with the same texture upload");
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, upload);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "when calling texSubImage2D with the same texture upload with offset 1, 1");
+};
+
+var testImage = function(test, img) {
+ var width = img.width;
+ var height = img.height;
+ testUpload(img, width, height);
+
+ debug("Testing changing the width and height attributes of the image");
+ img.width *= 2;
+ img.height *= 2;
+ if (test.isSVG) {
+ testUpload(img, img.width, img.height);
+ } else {
+ testUpload(img, width, height);
+ }
+};
+
+var testVideo = function(test, video) {
+ // Assuming that the video is not anamorphic, nor has clean aperture data
+ // that would make the frame size in pixels different.
+ var width = video.videoWidth;
+ var height = video.videoHeight;
+ testUpload(video, width, height);
+
+ debug("Testing changing the width and height attributes of the video");
+ video.width *= 2;
+ video.height *= 2;
+ testUpload(video, width, height);
+};
+
+var createCanvas2DContext = function(width, height) {
+ var canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ var ctx = canvas.getContext("2d");
+ ctx.fillRect(0, 0, width, height);
+ return ctx;
+};
+
+var testImageData = function(test) {
+ var ctx = createCanvas2DContext(test.width, test.height);
+ var imageData = ctx.getImageData(0, 0, test.width, test.height);
+ testUpload(imageData, test.width, test.height);
+};
+
+var testCanvas = function(test) {
+ var ctx = createCanvas2DContext(test.width, test.height);
+ testUpload(ctx.canvas, test.width, test.height);
+
+ debug("Testing changing the dimensions of the same canvas");
+ ctx.canvas.width = test.width + 1;
+ ctx.canvas.height = test.height + 1;
+ testUpload(ctx.canvas, ctx.canvas.width, ctx.canvas.height);
+};
+
+var tests = [
+ {type: "ImageData", width: 123, height: 456},
+ {type: "canvas", width: 123, height: 456},
+ {type: "img", isSVG: false, src: "../../../resources/red-green.png"},
+ {type: "img", isSVG: true, src: "../../../resources/red-green.svg"},
+ {type: "video", src: "../../../resources/red-green.mp4", videoType: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"'},
+ {type: "video", src: "../../../resources/red-green.bt601.vp9.webm", videoType: 'video/webm; codecs="vp9"'},
+ {type: "video", src: "../../../resources/red-green.webmvp8.webm", videoType: 'video/webm; codecs="vp8, vorbis"'},
+ {type: "video", src: "../../../resources/red-green.theora.ogv", videoType: 'video/ogg; codecs="theora, vorbis"'},
+];
+
+var testIndex = 0;
+
+var runNextTest = function() {
+ if (testIndex < tests.length) {
+ debug("");
+ var test = tests[testIndex];
+ ++testIndex;
+ if (test.type == "img") {
+ debug("HTMLImageElement" + (test.isSVG ? " (SVG)" : ""));
+ var img = wtu.makeImage(test.src, function() {
+ testImage(test, img);
+ setTimeout(runNextTest, 0);
+ }, function () {
+ testFailed("could not create image" + (test.isSVG ? " (SVG)" : ""));
+ setTimeout(runNextTest, 0);
+ });
+ } else if (test.type == "video") {
+ debug("HTMLVideoElement (" + test.videoType + ")");
+ var video = wtu.makeVideo(test.src);
+ if(!video.canPlayType(test.videoType).replace(/no/, '')) {
+ debug(test.videoType + " unsupported");
+ setTimeout(runNextTest, 0);
+ return;
+ }
+ wtu.startPlayingAndWaitForVideo(video, function() {
+ testVideo(test, video);
+ setTimeout(runNextTest, 0);
+ });
+ } else if (test.type == "ImageData") {
+ debug("ImageData");
+ testImageData(test);
+ setTimeout(runNextTest, 0);
+ } else if (test.type == "canvas") {
+ debug("HTMLCanvasElement");
+ testCanvas(test);
+ setTimeout(runNextTest, 0);
+ }
+ } else {
+ finishTest();
+ }
+};
+
+runNextTest();
+</script>
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-video-transparent.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-video-transparent.html
new file mode 100644
index 0000000000..9cc34debb8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-video-transparent.html
@@ -0,0 +1,164 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Upload texture from animating transparent WebM or HEVC</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script>
+"use strict";
+const wtu = WebGLTestUtils;
+let gl;
+let successfullyParsed;
+let video;
+
+initTestingHarness();
+
+function logVisibility(isOnload)
+{
+ let prefix = '';
+ if (isOnload)
+ prefix = 'Upon load: ';
+ if (document.hidden) {
+ console.log(prefix + '*** Tab was backgrounded (if running in automated test harness, why?) ***');
+ } else {
+ console.log(prefix + 'Tab was foregrounded');
+ }
+}
+
+function init()
+{
+ description("Upload texture from animating transparent WebM or HEVC");
+
+ document.addEventListener("visibilitychange", visibilityChanged, false);
+
+ logVisibility(true);
+
+ const canvas = document.getElementById("example");
+ gl = wtu.create3DContext(canvas);
+
+ const program = wtu.setupTexturedQuad(gl);
+ const texture = gl.createTexture();
+ // Bind the texture to texture unit 0
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ const textureLoc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(textureLoc, 0);
+
+ gl.enable(gl.BLEND);
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
+
+ video = document.getElementById("vid");
+ const typeWebM = 'video/webm; codecs="vp8"';
+ const typeHEVC = 'video/mp4; codecs="hvc1"';
+ if (!video.canPlayType) {
+ testFailed("video.canPlayType required method missing");
+ finishTest();
+ return;
+ }
+ if (!video.canPlayType(typeWebM).replace(/no/, '') && !video.canPlayType(typeHEVC).replace(/no/, '')) {
+ debug(typeWebM + " unsupported");
+ debug(typeHEVC + " unsupported");
+ finishTest();
+ return;
+ };
+ wtu.startPlayingAndWaitForVideo(video, runTest);
+}
+
+function visibilityChanged() {
+ logVisibility(false);
+}
+
+function runTest(videoElement)
+{
+ let i = 0;
+ requestAnimationFrame(function frame() {
+ runOneIteration(videoElement, false);
+ runOneIteration(videoElement, true);
+
+ ++i;
+ if (i < 120) {
+ requestAnimationFrame(frame);
+ } else {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+ finishTest();
+ }
+ });
+
+}
+
+function runOneIteration(videoElement, useTexSubImage2D)
+{
+ // Upload the videoElement into the texture
+ if (useTexSubImage2D) {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, videoElement);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, videoElement);
+ } else {
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, videoElement);
+ }
+
+ // Set up texture parameters
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
+ 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);
+
+ // Draw the triangles
+ wtu.clearAndDrawUnitQuad(gl, [255, 0, 0, 255]);
+
+ const tolerance = 20;
+ const red = [255, 0, 0];
+ const green = [0, 255, 0];
+ const blue = [0, 0, 255];
+
+ // Check the left and right sides. Make sure that EITHER:
+
+ // - Left is green and right is transparent-blended-with-red
+ let leftIsGreen = false, leftIsRed = false, rightIsBlue = false, rightIsRed = false;
+ let greenRedError = "", redBlueError = "";
+ let leftGreenError = "", rightBlueError = "";
+ let bufLeft, bufRight;
+ wtu.checkCanvasRectColor(gl, 4, 4, 8, 24, green, tolerance,
+ /* sameFn */ () => { leftIsGreen = true; }, /* differentFn */ (m, b) => { leftGreenError = m; bufLeft = b;}, debug);
+ wtu.checkCanvasRectColor(gl, 20, 4, 8, 24, red, tolerance,
+ /* sameFn */ () => { rightIsRed = true; }, /* differentFn */ (m, b) => { greenRedError = m; bufRight = b;}, debug);
+
+ // - Right is blue and left is transparent-blended-with-red
+ wtu.checkCanvasRectColor(gl, 20, 4, 8, 24, blue, tolerance,
+ /* sameFn */ () => { rightIsBlue = true; }, /* differentFn */ (m, b) => { rightBlueError = m; bufRight = b;}, debug);
+ wtu.checkCanvasRectColor(gl, 4, 4, 8, 24, red, tolerance,
+ /* sameFn */ () => { leftIsRed = true; }, /* differentFn */ (m, b) => { redBlueError = m; bufLeft = b;}, debug);
+
+ if (leftIsGreen) {
+ if (rightIsRed) {
+ testPassed("left is green, right is transparent-blended-with-red");
+ } else {
+ testFailed("left is green, but: " + greenRedError + "\n" + bufRight);
+ }
+ } else if (rightIsBlue) {
+ if (leftIsRed) {
+ testPassed("right is blue, left is transparent-blended-with-red");
+ } else {
+ testFailed("right is blue, but: " + redBlueError + "\n" + bufLeft);
+ }
+ } else {
+ testFailed("neither left is green nor right is blue \n" + leftGreenError + "\n" + rightBlueError + "\n" + bufLeft + "\n" + bufRight);
+ }
+}
+</script>
+</head>
+<body onload="init()">
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<video id="vid" style="display:none;">
+ <source src="../../../resources/transparent-2frames.mp4" type='video/mp4; codecs="hvc1"' />
+ <source src="../../../resources/transparent-2frames.webm" type='video/webm; codecs="vp8"' />
+</video>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-with-flip-y-and-premultiply-alpha.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-with-flip-y-and-premultiply-alpha.html
new file mode 100644
index 0000000000..6f080f0eea
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/texture-with-flip-y-and-premultiply-alpha.html
@@ -0,0 +1,72 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL texture upload with FlipY and PremultiplyAlpha.</title>
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+// Regression test for crbug.com/765469
+"use strict";
+description("Checks uploading textures with FlipY and PremultiplyAlpha generates INVALID_OPERATION with invalid format/type");
+
+var canvas;
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+var tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+
+function testUpload() {
+ // Because WEBGL_depth_texture is enabled, UNSIGNED_SHORT becomes a valid type, but RGBA/UNSIGNED_SHORT is invalid.
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 2, 2, 0, gl.RGBA, gl.UNSIGNED_SHORT, new Uint16Array(2*2*4));
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION, "texImage2D() with invalid format/type combination");
+}
+
+var ext = gl.getExtension('WEBGL_depth_texture');
+if (ext) {
+ debug("");
+ debug("Testing with FlipY = false, PremultiplyAlpha = false");
+ testUpload();
+
+ debug("");
+ debug("Testing with FlipY = true, PremultiplyAlpha = false");
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 1);
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0);
+ testUpload();
+
+ debug("");
+ debug("Testing with FlipY = false, PremultiplyAlpha = true");
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 0);
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
+ testUpload();
+
+ debug("");
+ debug("Testing with FlipY = true, PremultiplyAlpha = true");
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 1);
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
+ testUpload();
+} else {
+ testPassed("WEBGL_depth_texture not supported, skipping tests.");
+}
+
+gl.deleteTexture(tex);
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/upload-from-srcset-with-empty-data.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/upload-from-srcset-with-empty-data.html
new file mode 100644
index 0000000000..6899e31334
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/upload-from-srcset-with-empty-data.html
@@ -0,0 +1,44 @@
+<!--
+Copyright (c) 2020 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<title>Upload From Srcset With Empty Data</title>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<img srcset="data:,a 1x, data:,b 1w" id="i">
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+
+var successfullyParsed;
+
+description("This test ensures WebGL implementations handle srcsets with empty data.");
+debug("Regression test for <a href='http://crbug.com/1085044'>http://crbug.com/1085044</a>");
+
+let gl = wtu.create3DContext();
+
+// Note we run this test synchronously, rather than running it in an async
+// function called after "wtu.awaitOrTimeout(img.decode());". This reproduces
+// the bug more reliably.
+let img = document.getElementById("i");
+let tex = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex);
+// Implementations can decide how to respond to these kinds of bad
+// inputs, as long as they don't crash.
+gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img);
+
+finishTest();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/video-rotation.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/video-rotation.html
new file mode 100644
index 0000000000..b336ed6ede
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/misc/video-rotation.html
@@ -0,0 +1,167 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="utf-8">
+ <title>Verifies rotation metadata tag is respected when uploading videos to WebGL textures.</title>
+ <link rel="stylesheet" href="../../../resources/js-test-style.css" />
+ <script src="../../../js/js-test-pre.js"></script>
+ <script src="../../../js/webgl-test-utils.js"></script>
+ <script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+</head>
+
+<body onload="run()">
+ <canvas id="c" width="256" height="256"></canvas>
+ <div id="description"></div>
+ <div id="console"></div>
+ <script>
+ "use strict";
+ description();
+ let wtu = WebGLTestUtils;
+ let tiu = TexImageUtils;
+ let canvas = document.getElementById("c");
+ let gl = wtu.create3DContext(canvas);
+ let program = tiu.setupTexturedQuad(gl, gl.RGBA);
+ const resourcePath = "../../../resources/";
+ const mp4Tolerance = 10;
+ // Significantly higher tolerance needed for VP9 tests. http://crbug.com/1219015 .
+ const vp9Tolerance = 45;
+
+ const expectedColors = {
+ top: { location: [0.5, 0.25], color: [255, 0, 0] },
+ left: { location: [0.4, 0.5], color: [0, 0, 255] },
+ right: { location: [0.6, 0.5], color: [255, 255, 0] },
+ bottom: { location: [0.5, 0.75], color: [0, 255, 0] },
+ }
+
+ function output(str) {
+ debug(str);
+ bufferedLogToConsole(str);
+ }
+
+ function checkPixels(tolerance) {
+ for (let place in expectedColors) {
+ let color = expectedColors[place];
+ let loc = color.location;
+ let x = loc[0];
+ let y = loc[1];
+ output(" Checking " + place);
+ wtu.checkCanvasRect(gl, Math.floor(canvas.width * x), Math.floor(canvas.height * y), 1, 1,
+ color.color, "shouldBe " + color.color + " +/-" + tolerance, tolerance);
+ }
+ }
+
+ function loadVideoElement(filename) {
+ return new Promise((resolve) => {
+ const video = document.createElement('video');
+ video.crossOrigin = 'anonymous';
+ video.src = resourcePath + filename;
+ wtu.startPlayingAndWaitForVideo(video, resolve);
+ });
+ }
+
+ async function testVideoElement(filename, isVP9) {
+ const video = await loadVideoElement(filename);
+
+ output("----------------------------------------------------------------");
+ output("Testing " + filename + " via HTMLVideoElement");
+
+ output(" Testing texImage2D");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ const localTolerance = isVP9 ? vp9Tolerance : mp4Tolerance;
+ checkPixels(localTolerance);
+
+ output(" Testing texSubImage2D");
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, video.videoWidth, video.videoHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, video);
+ wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]);
+ checkPixels(localTolerance);
+ }
+
+ async function run() {
+ await (async () => {
+ const video = document.createElement('video');
+ if (!video.canPlayType) {
+ testFailed("video.canPlayType required method missing");
+ return;
+ }
+
+ let supports_h264 = !!video.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/no/, '');
+ let supports_vp9 = !!video.canPlayType('video/mp4; codecs="vp09.00.10.08"').replace(/no/, '');
+ if (!supports_h264 && !supports_vp9) {
+ testFailed("No supported video types.");
+ return;
+ }
+
+ let tex = gl.createTexture();
+ // Bind the texture to the default texture unit 0
+ gl.bindTexture(gl.TEXTURE_2D, tex);
+ // Set up texture parameters
+ 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);
+
+ // These files were created by converting exif-orientation-test.psd to mp4
+ // files, rotating them using the transpose filter, and adding rotate metadata, all
+ // using the ffmpeg command-line tool.
+ //
+ // From sdk/tests/resources/ directory:
+ //
+ // 0:
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96 -pix_fmt yuv420p -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=0 video-rotation-0.mp4
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96 -pix_fmt yuv420p -crf 0 -vcodec libvpx-vp9 -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=0 video-rotation-0.vp9.mp4
+ //
+ // 90:
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96,transpose=2 -pix_fmt yuv420p -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=270 video-rotation-90.mp4
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96,transpose=2 -pix_fmt yuv420p -crf 0 -vcodec libvpx-vp9 -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=270 video-rotation-90.vp9.mp4
+ //
+ // 180:
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96,transpose=2,transpose=2 -pix_fmt yuv420p -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=180 video-rotation-180.mp4
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96,transpose=2,transpose=2 -pix_fmt yuv420p -crf 0 -vcodec libvpx-vp9 -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=180 video-rotation-180.vp9.mp4
+ //
+ // 270:
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96,transpose=1 -pix_fmt yuv420p -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=90 video-rotation-270.mp4
+ // ffmpeg -noautorotate -i exif-orientation-originals\exif-orientation-test.psd -vf scale=128x96,transpose=1 -pix_fmt yuv420p -crf 0 -vcodec libvpx-vp9 -y temp.mp4
+ // ffmpeg -i temp.mp4 -c copy -metadata:s:v:0 rotate=90 video-rotation-270.vp9.mp4
+
+ const filenames = [
+ "video-rotation-0",
+ "video-rotation-90",
+ "video-rotation-180",
+ "video-rotation-270",
+ ];
+
+ if (supports_h264) {
+ for (let fn of filenames)
+ await testVideoElement(fn + ".mp4", false);
+ }
+
+ if (supports_vp9) {
+ for (let fn of filenames)
+ await testVideoElement(fn + ".vp9.mp4", true);
+ }
+ })();
+
+ finishTest();
+ }
+
+ var successfullyParsed = true;
+ </script>
+</body>
+
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..549e0808ac
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..3bdd311bde
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..27ace886fe
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..38b37c8422
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..fd87fd2053
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..f8955c891d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..b9491232cb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..cee000e426
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/svg_image/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-svg-image.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..c2f1c72e7e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..d985f3875d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..4c6e263474
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..6eaf2065d5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..a4675599ee
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..b07d911e1f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..df27fd9932
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..de35a7b355
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/video/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-video.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt
new file mode 100644
index 0000000000..66a3a84456
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/00_test_list.txt
@@ -0,0 +1,8 @@
+tex-2d-rgb-rgb-unsigned_byte.html
+tex-2d-rgb-rgb-unsigned_short_5_6_5.html
+tex-2d-rgba-rgba-unsigned_byte.html
+tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
+tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
+tex-2d-luminance-luminance-unsigned_byte.html
+tex-2d-alpha-alpha-unsigned_byte.html
+tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-alpha-alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-alpha-alpha-unsigned_byte.html
new file mode 100644
index 0000000000..5870ebaba7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-alpha-alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("ALPHA", "ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance-luminance-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance-luminance-unsigned_byte.html
new file mode 100644
index 0000000000..9c551d0232
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance-luminance-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE", "LUMINANCE", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
new file mode 100644
index 0000000000..d25216cb87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-luminance_alpha-luminance_alpha-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("LUMINANCE_ALPHA", "LUMINANCE_ALPHA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html
new file mode 100644
index 0000000000..889b5f1fe5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
new file mode 100644
index 0000000000..ceb0f09ff9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGB", "RGB", "UNSIGNED_SHORT_5_6_5", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html
new file mode 100644
index 0000000000..20711c46dc
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_byte.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_BYTE", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
new file mode 100644
index 0000000000..bebf83cd01
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_4_4_4_4", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
new file mode 100644
index 0000000000..0d448009eb
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/textures/webgl_canvas/tex-2d-rgba-rgba-unsigned_short_5_5_5_1.html
@@ -0,0 +1,38 @@
+<!--
+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 file is auto-generated from py/tex_image_test_generator.py
+DO NOT EDIT!
+
+-->
+
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../../resources/js-test-style.css"/>
+<script src="../../../js/js-test-pre.js"></script>
+<script src="../../../js/webgl-test-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>
+<script src="../../../js/tests/tex-image-and-sub-image-2d-with-webgl-canvas.js"></script>
+</head>
+<body>
+<canvas id="example" width="32" height="32"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function testPrologue(gl) {
+ return true;
+}
+
+generateTest("RGBA", "RGBA", "UNSIGNED_SHORT_5_5_5_1", testPrologue, "../../../resources/", 1)();
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt
new file mode 100644
index 0000000000..732aad646c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/00_test_list.txt
@@ -0,0 +1,7 @@
+array-buffer-crash.html
+array-buffer-view-crash.html
+array-unit-tests.html
+data-view-crash.html
+data-view-test.html
+--min-version 1.0.2 typed-arrays-in-workers.html
+--min-version 1.0.3 array-large-array-tests.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html
new file mode 100644
index 0000000000..59348727e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-crash.html
@@ -0,0 +1,40 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+description('Test ArrayBuffer.byteLength');
+
+// The following used to cause a crash in Chrome.
+
+// Note that because the argument to ArrayBuffer's constructor is not
+// optional, an implementation might throw an exception on the expression
+// below rather than implicitly passing undefined. Either way is acceptable
+// from the point of view of this test, but implementations must not crash.
+try {
+ new ArrayBuffer().byteLength;
+} catch (e) {
+}
+
+testPassed("new ArrayBuffer().byteLength did not crash");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html
new file mode 100644
index 0000000000..cecb8138c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-buffer-view-crash.html
@@ -0,0 +1,41 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+description('Verify that constructing a typed array view with no arguments and fetching its length does not crash');
+
+
+// The following used to cause a crash in both Safari and Chrome.
+
+// Note that because the argument to ArrayBuffer's constructor is not
+// optional, an implementation might throw an exception on the expression
+// below rather than implicitly passing undefined. Either way is acceptable
+// from the point of view of this test, but implementations must not crash.
+try {
+ new Uint32Array().length;
+} catch (e) {
+}
+
+testPassed("new Uint32Array().length did not crash");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html
new file mode 100644
index 0000000000..8af76136aa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-large-array-tests.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/tests/typed-array-test-cases.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+description("Verifies allocation of large array buffers");
+
+var currentlyRunning = '';
+var allPassed = true;
+function running(str) {
+ currentlyRunning = str;
+}
+
+function output(str) {
+ debug(str);
+}
+
+function pass() {
+ testPassed(currentlyRunning);
+}
+
+function fail(str) {
+ allPassed = false;
+ var exc;
+ if (str)
+ exc = currentlyRunning + ': ' + str;
+ else
+ exc = currentlyRunning;
+ testFailed(exc);
+}
+
+function assertEq(prefix, expected, val) {
+ if (expected != val) {
+ var str = prefix + ': expected ' + expected + ', got ' + val;
+ throw str;
+ }
+}
+
+function assert(prefix, expected) {
+ if (!expected) {
+ var str = prefix + ': expected value / true';
+ throw str;
+ }
+}
+
+function printSummary() {
+ if (allPassed) {
+ debug("Test passed.");
+ } else {
+ debug("TEST FAILED");
+ }
+}
+
+
+function testConstructionOfHugeArray(type, name, sz) {
+ if (sz == 1)
+ return;
+ try {
+ // Construction of huge arrays must fail because byteLength is
+ // an unsigned long
+ array = new type(3000000000);
+ testFailed("Construction of huge " + name + " should throw exception");
+ } catch (e) {
+ testPassed("Construction of huge " + name + " threw exception");
+ }
+}
+
+function runTests() {
+ allPassed = true;
+
+ for (var i = 0; i < testCases.length; i++) {
+ var testCase = testCases[i];
+ running(testCase.name);
+ if (!(testCase.name in window)) {
+ fail("does not exist");
+ continue;
+ }
+ var type = window[testCase.name];
+ var name = testCase.name;
+ testConstructionOfHugeArray(type, name, testCase.elementSizeInBytes);
+ }
+}
+
+runTests();
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
+
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html
new file mode 100644
index 0000000000..22f0e452ed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/array-unit-tests.html
@@ -0,0 +1,1103 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/test-eval.js"></script>
+<script src="../../js/tests/typed-array-test-cases.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+description("Verifies the functionality of the new array-like objects in the TypedArray spec");
+
+var currentlyRunning = '';
+var allPassed = true;
+function running(str) {
+ currentlyRunning = str;
+}
+
+function output(str) {
+ debug(str);
+}
+
+function pass() {
+ testPassed(currentlyRunning);
+}
+
+function fail(str) {
+ allPassed = false;
+ var exc;
+ if (str)
+ exc = currentlyRunning + ': ' + str;
+ else
+ exc = currentlyRunning;
+ testFailed(exc);
+}
+
+function assertEq(prefix, expected, val) {
+ if (expected != val) {
+ var str = prefix + ': expected ' + expected + ', got ' + val;
+ throw str;
+ }
+}
+
+function assert(prefix, expected) {
+ if (!expected) {
+ var str = prefix + ': expected value / true';
+ throw str;
+ }
+}
+
+function printSummary() {
+ if (allPassed) {
+ debug("Test passed.");
+ } else {
+ debug("TEST FAILED");
+ }
+}
+
+var buffer;
+var byteLength;
+var subBuffer;
+var subArray;
+function testSlice() {
+ function test(subBuf, starts, size) {
+ byteLength = size;
+ subBuffer = TestEval(subBuf);
+ subArray = new Int8Array(subBuffer);
+ assertEq(subBuf, subBuffer.byteLength, byteLength);
+ for (var i = 0; i < size; ++i)
+ assertEq('Element ' + i, starts + i, subArray[i]);
+ }
+
+ try {
+ running('testSlice');
+ buffer = new ArrayBuffer(32);
+ var array = new Int8Array(buffer);
+ for (var i = 0; i < 32; ++i)
+ array[i] = i;
+
+ test("buffer.slice(0)", 0, 32);
+ test("buffer.slice(16)", 16, 16);
+ test("buffer.slice(24)", 24, 8);
+ test("buffer.slice(32)", 32, 0);
+ test("buffer.slice(40)", 32, 0);
+ test("buffer.slice(80)", 32, 0);
+
+ test("buffer.slice(-8)", 24, 8);
+ test("buffer.slice(-16)", 16, 16);
+ test("buffer.slice(-24)", 8, 24);
+ test("buffer.slice(-32)", 0, 32);
+ test("buffer.slice(-40)", 0, 32);
+ test("buffer.slice(-80)", 0, 32);
+
+ test("buffer.slice(0, 32)", 0, 32);
+ test("buffer.slice(0, 16)", 0, 16);
+ test("buffer.slice(8, 24)", 8, 16);
+ test("buffer.slice(16, 32)", 16, 16);
+ test("buffer.slice(24, 16)", 24, 0);
+
+ test("buffer.slice(16, -8)", 16, 8);
+ test("buffer.slice(-20, 30)", 12, 18);
+
+ test("buffer.slice(-8, -20)", 24, 0);
+ test("buffer.slice(-20, -8)", 12, 12);
+ test("buffer.slice(-40, 16)", 0, 16);
+ test("buffer.slice(-40, 40)", 0, 32);
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testArrayBufferIsViewMethod() {
+ debug('test ArrayBuffer.isView() with various values');
+
+ try {
+ if (!ArrayBuffer.isView) {
+ testFailed('ArrayBuffer.isView() method does not exist');
+ } else {
+ testPassed('ArrayBuffer.isView() method exists');
+
+ shouldBe('ArrayBuffer.isView(new Int8Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Uint8Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Uint8ClampedArray(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Int16Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Uint16Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Int32Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Uint32Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Float32Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new Float64Array(1))', 'true');
+ shouldBe('ArrayBuffer.isView(new DataView(new ArrayBuffer(8)))', 'true');
+
+ shouldBe('ArrayBuffer.isView(undefined)', 'false');
+ shouldBe('ArrayBuffer.isView(null)', 'false');
+ shouldBe('ArrayBuffer.isView(true)', 'false');
+ shouldBe('ArrayBuffer.isView(false)', 'false');
+ shouldBe('ArrayBuffer.isView(0)', 'false');
+ shouldBe('ArrayBuffer.isView(1)', 'false');
+ shouldBe('ArrayBuffer.isView(1.0)', 'false');
+ shouldBe('ArrayBuffer.isView("hello")', 'false');
+ shouldBe('ArrayBuffer.isView({})', 'false');
+ shouldBe('ArrayBuffer.isView(function() {})', 'false');
+ shouldBe('ArrayBuffer.isView(new Array(1))', 'false');
+ }
+ } catch (e) {
+ testFailed('Exception thrown while testing ArrayBuffer.isView method: ' + e);
+ }
+}
+
+function testInheritanceHierarchy() {
+ debug('test inheritance hierarchy of typed array views');
+
+ try {
+ var foo = ArrayBufferView;
+ testFailed('ArrayBufferView is a typedef and should not be defined');
+ } catch (e) {
+ testPassed('ArrayBufferView is a typedef and was (correctly) not defined');
+ }
+
+ // Uint8ClampedArray inherited from Uint8Array in earlier versions
+ // of the typed array specification. Since this is no longer the
+ // case, assert the new behavior.
+ shouldBe('new Uint8ClampedArray(1) instanceof Uint8Array', 'false');
+
+ if (Object.getPrototypeOf(Int8Array.prototype) == Object.prototype) {
+ // ES5 behavior.
+ shouldBe('Object.getPrototypeOf(Int8Array.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Uint8Array.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Uint8ClampedArray.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Int16Array.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Uint16Array.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Int32Array.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Uint32Array.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Float32Array.prototype)', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Float64Array.prototype)', 'Object.prototype');
+ } else {
+ // As of ES6, the prototypes for typed array constructors point to an intrinsic object whose internal
+ // prototype is Object.prototype. Relevant spec section is 22.2.5.2: TypedArray.prototype.
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Int8Array.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Uint8Array.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Uint8ClampedArray.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Int16Array.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Uint16Array.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Int32Array.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Uint32Array.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Float32Array.prototype))', 'Object.prototype');
+ shouldBe('Object.getPrototypeOf(Object.getPrototypeOf(Float64Array.prototype))', 'Object.prototype');
+ }
+
+ shouldBe('Object.getPrototypeOf(DataView.prototype)', 'Object.prototype');
+}
+
+//
+// Tests for unsigned array variants
+//
+
+function testSetAndGet10To1(type, name) {
+ running('test ' + name + ' SetAndGet10To1');
+ try {
+ var array = new type(10);
+ for (var i = 0; i < 10; i++) {
+ array[i] = 10 - i;
+ }
+ for (var i = 0; i < 10; i++) {
+ assertEq('Element ' + i, 10 - i, array[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testConstructWithArrayOfUnsignedValues(type, name) {
+ running('test ' + name + ' ConstructWithArrayOfUnsignedValues');
+ try {
+ var array = new type([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);
+ assertEq('Array length', 10, array.length);
+ for (var i = 0; i < 10; i++) {
+ assertEq('Element ' + i, 10 - i, array[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testConstructWithTypedArrayOfUnsignedValues(type, name) {
+ running('test ' + name + ' ConstructWithTypedArrayOfUnsignedValues');
+ try {
+ var tmp = new type([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);
+ var array = new type(tmp);
+ assertEq('Array length', 10, array.length);
+ for (var i = 0; i < 10; i++) {
+ assertEq('Element ' + i, 10 - i, array[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+//
+// Tests for signed array variants
+//
+
+function testSetAndGetPos10ToNeg10(type, name) {
+ running('test ' + name + ' SetAndGetPos10ToNeg10');
+ try {
+ var array = new type(21);
+ for (var i = 0; i < 21; i++) {
+ array[i] = 10 - i;
+ }
+ for (var i = 0; i < 21; i++) {
+ assertEq('Element ' + i, 10 - i, array[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testConstructWithArrayOfSignedValues(type, name) {
+ running('test ' + name + ' ConstructWithArrayOfSignedValues');
+ try {
+ var array = new type([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10]);
+ assertEq('Array length', 21, array.length);
+ for (var i = 0; i < 21; i++) {
+ assertEq('Element ' + i, 10 - i, array[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testConstructWithTypedArrayOfSignedValues(type, name) {
+ running('test ' + name + ' ConstructWithTypedArrayOfSignedValues');
+ try {
+ var tmp = new type([10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10]);
+ var array = new type(tmp);
+ assertEq('Array length', 21, array.length);
+ for (var i = 0; i < 21; i++) {
+ assertEq('Element ' + i, 10 - i, array[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+//
+// Test cases for integral types.
+// Some JavaScript engines need separate copies of this code in order
+// to exercise all of their optimized code paths.
+//
+
+function testIntegralArrayTruncationBehavior(type, name, unsigned) {
+ running('test integral array truncation behavior for ' + name);
+
+ var sourceData;
+ var expectedResults;
+
+ if (unsigned) {
+ sourceData = [0.6, 10.6, 0.2, 10.2, 10.5, 11.5];
+ if (type === Uint8ClampedArray) {
+ expectedResults = [1, 11, 0, 10, 10, 12];
+ } else {
+ expectedResults = [0, 10, 0, 10, 10, 11];
+ }
+ } else {
+ sourceData = [0.6, 10.6, -0.6, -10.6];
+ expectedResults = [0, 10, 0, -10];
+ }
+
+ var numIterations = 10;
+ var array = new type(numIterations);
+
+ // The code block in each of the case statements below is identical, but some
+ // JavaScript engines need separate copies in order to exercise all of
+ // their optimized code paths.
+
+ try {
+ switch (type) {
+ case Int8Array:
+ for (var ii = 0; ii < sourceData.length; ++ii) {
+ for (var jj = 0; jj < numIterations; ++jj) {
+ array[jj] = sourceData[ii];
+ assertEq('Storing ' + sourceData[ii], expectedResults[ii], array[jj]);
+ }
+ }
+ break;
+ case Int16Array:
+ for (var ii = 0; ii < sourceData.length; ++ii) {
+ for (var jj = 0; jj < numIterations; ++jj) {
+ array[jj] = sourceData[ii];
+ assertEq('Storing ' + sourceData[ii], expectedResults[ii], array[jj]);
+ }
+ }
+ break;
+ case Int32Array:
+ for (var ii = 0; ii < sourceData.length; ++ii) {
+ for (var jj = 0; jj < numIterations; ++jj) {
+ array[jj] = sourceData[ii];
+ assertEq('Storing ' + sourceData[ii], expectedResults[ii], array[jj]);
+ }
+ }
+ break;
+ case Uint8Array:
+ for (var ii = 0; ii < sourceData.length; ++ii) {
+ for (var jj = 0; jj < numIterations; ++jj) {
+ array[jj] = sourceData[ii];
+ assertEq('Storing ' + sourceData[ii], expectedResults[ii], array[jj]);
+ }
+ }
+ break;
+ case Uint8ClampedArray:
+ for (var ii = 0; ii < sourceData.length; ++ii) {
+ for (var jj = 0; jj < numIterations; ++jj) {
+ array[jj] = sourceData[ii];
+ assertEq('Storing ' + sourceData[ii], expectedResults[ii], array[jj]);
+ }
+ }
+ break;
+ case Uint16Array:
+ for (var ii = 0; ii < sourceData.length; ++ii) {
+ for (var jj = 0; jj < numIterations; ++jj) {
+ array[jj] = sourceData[ii];
+ assertEq('Storing ' + sourceData[ii], expectedResults[ii], array[jj]);
+ }
+ }
+ break;
+ case Uint32Array:
+ for (var ii = 0; ii < sourceData.length; ++ii) {
+ for (var jj = 0; jj < numIterations; ++jj) {
+ array[jj] = sourceData[ii];
+ assertEq('Storing ' + sourceData[ii], expectedResults[ii], array[jj]);
+ }
+ }
+ break;
+ default:
+ fail("Unhandled type");
+ break;
+ }
+
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+
+//
+// Test cases for both signed and unsigned types
+//
+
+function testGetWithOutOfRangeIndices(type, name) {
+ debug('Testing ' + name + ' GetWithOutOfRangeIndices');
+ // See below for declaration of this global variable
+ array = new type([2, 3]);
+ shouldBeUndefined("array[2]");
+ shouldBeUndefined("array[-1]");
+ shouldBeUndefined("array[0x20000000]");
+}
+
+function testOffsetsAndSizes(type, name, elementSizeInBytes) {
+ running('test ' + name + ' OffsetsAndSizes');
+ try {
+ var len = 10;
+ assertEq('type.BYTES_PER_ELEMENT', elementSizeInBytes, type.BYTES_PER_ELEMENT);
+ var array = new type(len);
+ assert('array.buffer', array.buffer);
+ assertEq('array.byteOffset', 0, array.byteOffset);
+ assertEq('array.length', len, array.length);
+ assertEq('array.byteLength', len * elementSizeInBytes, array.byteLength);
+ array = new type(array.buffer, elementSizeInBytes, len - 1);
+ assert('array.buffer', array.buffer);
+ assertEq('array.byteOffset', elementSizeInBytes, array.byteOffset);
+ assertEq('array.length', len - 1, array.length);
+ assertEq('array.byteLength', (len - 1) * elementSizeInBytes, array.byteLength);
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testSetFromTypedArray(type, name) {
+ running('test ' + name + ' SetFromTypedArray');
+ try {
+ var array = new type(10);
+ var array2 = new type(5);
+ for (var i = 0; i < 10; i++) {
+ assertEq('Element ' + i, 0, array[i]);
+ }
+ for (var i = 0; i < array2.length; i++) {
+ array2[i] = i;
+ }
+ array.set(array2);
+ for (var i = 0; i < array2.length; i++) {
+ assertEq('Element ' + i, i, array[i]);
+ }
+ array.set(array2, 5);
+ for (var i = 0; i < array2.length; i++) {
+ assertEq('Element ' + i, i, array[5 + i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function negativeTestSetFromTypedArray(type, name) {
+ running('negativeTest ' + name + ' SetFromTypedArray');
+ try {
+ var array = new type(5);
+ var array2 = new type(6);
+ for (var i = 0; i < 5; i++) {
+ assertEq('Element ' + i, 0, array[i]);
+ }
+ for (var i = 0; i < array2.length; i++) {
+ array2[i] = i;
+ }
+ try {
+ array.set(array2);
+ fail('Expected exception from array.set(array2)');
+ return;
+ } catch (e) {
+ }
+ try {
+ array2.set(array, 2);
+ fail('Expected exception from array2.set(array, 2)');
+ return;
+ } catch (e) {
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testSetFromArray(type, name) {
+ running('test ' + name + ' SetFromArray');
+ try {
+ var array = new type(10);
+ var array2 = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1];
+ for (var i = 0; i < 10; i++) {
+ assertEq('Element ' + i, 0, array[i]);
+ }
+ array.set(array2, 0);
+ for (var i = 0; i < array2.length; i++) {
+ assertEq('Element ' + i, 10 - i, array[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function negativeTestSetFromArray(type, name) {
+ running('negativeTest ' + name + ' SetFromArray');
+ try {
+ var array = new type([2, 3]);
+ try {
+ array.set([4, 5], 1);
+ fail();
+ return;
+ } catch (e) {
+ }
+ try {
+ array.set([4, 5, 6]);
+ fail();
+ return;
+ } catch (e) {
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+var subarray;
+function testSubarray(type, name) {
+ running('test ' + name + ' Subarray');
+ try {
+ var array = new type([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
+ var subarray = array.subarray(0, 5);
+ assertEq('subarray.length', 5, subarray.length);
+ for (var i = 0; i < 5; i++) {
+ assertEq('Element ' + i, i, subarray[i]);
+ }
+ subarray = array.subarray(4, 10);
+ assertEq('subarray.length', 6, subarray.length);
+ for (var i = 0; i < 6; i++) {
+ assertEq('Element ' + i, 4 + i, subarray[i]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testSubarrayOffsetAndLengthClamping(type, name) {
+ running('test ' + name + ' Subarray offset and length clamping');
+ try {
+ var array = new type([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
+ var subarray1 = array.subarray(0, 5);
+ var subarray2 = subarray1.subarray(-2, 10);
+ assertEq('subarray2.length', 2, subarray2.length);
+ assertEq('Element ' + 0, 3, subarray2[0]);
+ assertEq('Element ' + 1, 4, subarray2[1]);
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function negativeTestSubarray(type, name) {
+ running('negativeTest ' + name + ' Subarray');
+ try {
+ var array = new type([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
+ subarray = array.subarray(5, 11);
+ if (subarray.length != 5) {
+ fail();
+ return;
+ }
+ subarray = array.subarray(10, 10);
+ if (subarray.length != 0) {
+ fail();
+ return;
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testSetBoundaryConditions(type, name, testValues, expectedValues) {
+ running('test ' + name + ' SetBoundaryConditions');
+ try {
+ var array = new type(1);
+ assertEq('Array length', 1, array.length);
+ for (var ii = 0; ii < testValues.length; ++ii) {
+ for (var jj = 0; jj < 10; ++jj) {
+ array[0] = testValues[ii];
+ assertEq('Element 0', expectedValues[ii], array[0]);
+ }
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testConstructionBoundaryConditions(type, name, testValues, expectedValues) {
+ running('test ' + name + ' ConstructionBoundaryConditions');
+ try {
+ var array = new type(testValues);
+ assertEq('Array length', testValues.length, array.length);
+ for (var ii = 0; ii < testValues.length; ++ii) {
+ assertEq('Element ' + ii, expectedValues[ii], array[ii]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+function testConstructionWithNullBuffer(type, name) {
+ var array;
+ try {
+ array = new type(null);
+ assertEq("Length of " + name + " constructed with null", 0, array.length);
+ testPassed("Construction of " + name + " with null produced a " + name + " of length 0");
+ } catch (e) {
+ // This used to be correct, but TC39 has changed the behavior of these constructors.
+ testPassed("Construction of " + name + " with null threw exception");
+ }
+ try {
+ array = new type(null, 0);
+ assertEq("Length of " + name + " constructed with null", 0, array.length);
+ testPassed("Construction of " + name + " with null produced a " + name + " of length 0");
+ } catch (e) {
+ // This used to be correct, but TC39 has changed the behavior of these constructors.
+ testPassed("Construction of " + name + " with (null, 0) threw exception");
+ }
+ try {
+ array = new type(null, 0, 0);
+ assertEq("Length of " + name + " constructed with null", 0, array.length);
+ testPassed("Construction of " + name + " with null produced a " + name + " of length 0");
+ } catch (e) {
+ // This used to be correct, but TC39 has changed the behavior of these constructors.
+ testPassed("Construction of " + name + " with (null, 0, 0) threw exception");
+ }
+}
+
+function testConstructionWithExceptionThrowingObject(type, name) {
+ var o = {};
+ Object.defineProperty(o, "length", { get: function() { throw "bail;" }});
+ try {
+ var array = new type(o);
+ } catch (e) {
+ }
+ testPassed("Construction of " + name + " with exception-throwing array-like object didn't crash unexpectedly");
+}
+
+function shouldThrowIndexSizeErr(func, text) {
+ var errorText = text + " should throw an exception";
+ try {
+ func();
+ testFailed(errorText);
+ } catch (e) {
+ testPassed(text + " threw an exception");
+ }
+}
+
+function shouldThrowTypeError(func, text) {
+ var ok = false;
+ try {
+ func();
+ } catch (e) {
+ if (e instanceof TypeError) {
+ ok = true;
+ }
+ }
+ if (ok) {
+ testPassed(text + " threw TypeError");
+ } else {
+ testFailed(text + " should throw TypeError");
+ }
+}
+
+function testConstructionWithOutOfRangeValues(type, name) {
+ shouldThrowIndexSizeErr(function() {
+ var buffer = new ArrayBuffer(4);
+ var array = new type(buffer, 4, 0x3FFFFFFF);
+ }, "Construction of " + name + " with out-of-range number of elements");
+ shouldThrowIndexSizeErr(function() {
+ var buffer = new ArrayBuffer(4);
+ var array = new type(buffer, 8);
+ }, "Construction of " + name + " with out-of-range offset");
+}
+
+function testConstructionWithNegativeOutOfRangeValues(type, name) {
+ try {
+ var buffer = new ArrayBuffer(-1);
+ testFailed("Construction of ArrayBuffer with negative size should throw exception");
+ } catch (e) {
+ testPassed("Construction of ArrayBuffer with negative size threw exception");
+ }
+ try {
+ var array = new type(-1);
+ testFailed("Construction of " + name + " with negative size should throw exception");
+ } catch (e) {
+ testPassed("Construction of " + name + " with negative size threw exception");
+ }
+ shouldThrowIndexSizeErr(function() {
+ var buffer = new ArrayBuffer(4);
+ var array = new type(buffer, 4, -2147483648);
+ }, "Construction of " + name + " with negative out-of-range values");
+}
+
+function testConstructionWithUnalignedOffset(type, name, elementSizeInBytes) {
+ if (elementSizeInBytes > 1) {
+ shouldThrowIndexSizeErr(function() {
+ var buffer = new ArrayBuffer(32);
+ var array = new type(buffer, 1, elementSizeInBytes);
+ }, "Construction of " + name + " with unaligned offset");
+ }
+}
+
+function testConstructionWithUnalignedLength(type, name, elementSizeInBytes) {
+ if (elementSizeInBytes > 1) {
+ shouldThrowIndexSizeErr(function() {
+ var buffer = new ArrayBuffer(elementSizeInBytes + 1);
+ var array = new type(buffer, 0);
+ }, "Construction of " + name + " with unaligned length");
+ }
+}
+
+function testConstructionWithBothArrayBufferAndLength(type, name, elementSizeInBytes) {
+ var bufByteLength = 1000 * elementSizeInBytes;
+ var buf = new ArrayBuffer(bufByteLength);
+ var array1 = new type(buf);
+ var array2 = new type(bufByteLength / elementSizeInBytes);
+ if (array1.length == array2.length) {
+ testPassed("Array lengths matched with explicit and implicit creation of ArrayBuffer");
+ } else {
+ testFailed("Array lengths DID NOT MATCH with explicit and implicit creation of ArrayBuffer");
+ }
+}
+
+function testConstructionWithSubPortionOfArrayBuffer(type, name, elementSizeInBytes) {
+ if (elementSizeInBytes > 1) {
+ // Test construction with a valid sub-portion of an array buffer
+ // (whose size is not an integral multiple of the element size).
+ var size = 4 * elementSizeInBytes + (elementSizeInBytes / 2);
+ var buf = new ArrayBuffer(size);
+ try {
+ var array = new type(buf, 0, 2);
+ testPassed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) succeeded");
+ } catch (e) {
+ testFailed("new " + name + "(new ArrayBuffer(" + size + "), 0, 2) failed: " + e);
+ }
+ }
+}
+
+// These need to be global for shouldBe to see them
+var array;
+var typeSize;
+
+function testSubarrayWithOutOfRangeValues(type, name, sz) {
+ debug("Testing subarray of " + name);
+ try {
+ var buffer = new ArrayBuffer(32);
+ array = new type(buffer);
+ typeSize = sz;
+ shouldBe("array.length", "32 / typeSize");
+ try {
+ shouldBe("array.subarray(4, 0x3FFFFFFF).length", "(32 / typeSize) - 4");
+ shouldBe("array.subarray(4, -2147483648).length", "0");
+ // Test subarray() against overflows.
+ array = array.subarray(2);
+ if (sz > 1) {
+ // Full byte offset is +1 larger than the maximum unsigned long int.
+ // Make sure subarray() still handles it correctly. Otherwise overflow would happen and
+ // offset would be 0, and array.length array.length would incorrectly be 1.
+ var start = 4294967296 / sz - 2;
+ array = array.subarray(start, start + 1);
+ shouldBe("array.length", "0");
+ }
+ } catch (e) {
+ testFailed("Subarray of " + name + " threw exception");
+ }
+ } catch (e) {
+ testFailed("Exception: " + e);
+ }
+}
+
+function testSubarrayWithDefaultValues(type, name, sz) {
+ debug("Testing subarray with default inputs of " + name);
+ try {
+ var buffer = new ArrayBuffer(32);
+ array = new type(buffer);
+ typeSize = sz;
+ shouldBe("array.length", "32 / typeSize");
+ try {
+ shouldBe("array.subarray(0).length", "(32 / typeSize)");
+ shouldBe("array.subarray(2).length", "(32 / typeSize) - 2");
+ shouldBe("array.subarray(-2).length", "2");
+ shouldBe("array.subarray(-2147483648).length", "(32 / typeSize)");
+ } catch (e) {
+ testFailed("Subarray of " + name + " threw exception");
+ }
+ } catch (e) {
+ testFailed("Exception: " + e);
+ }
+}
+
+function setWithInvalidOffset(type, name, length,
+ sourceType, sourceName, sourceLength,
+ offset, offsetDescription) {
+ var webglArray = new type(length);
+ var sourceArray = new sourceType(sourceLength);
+ for (var i = 0; i < sourceLength; i++)
+ sourceArray[i] = 42 + i;
+ try {
+ webglArray.set(sourceArray, offset);
+ testFailed("Setting " + name + " from " + sourceName + " with " +
+ offsetDescription + " offset was not caught");
+ } catch (e) {
+ testPassed("Setting " + name + " from " + sourceName + " with " +
+ offsetDescription + " offset was caught");
+ }
+}
+
+function setWithValidOffset(type, name, length,
+ sourceType, sourceName, sourceLength,
+ offset, offsetDescription) {
+ running("Setting " + name + " from " + sourceName + " with " +
+ offsetDescription + " offset");
+ var webglArray = new type(length);
+ var sourceArray = new sourceType(sourceLength);
+ for (var i = 0; i < sourceLength; i++)
+ sourceArray[i] = 42 + i;
+ try {
+ webglArray.set(sourceArray, offset);
+ offset = Math.floor(offset);
+ for (var i = 0; i < sourceLength; i++) {
+ assertEq("Element " + i + offset, sourceArray[i], webglArray[i + offset]);
+ }
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+
+function testSettingFromArrayWithOutOfRangeOffset(type, name) {
+ setWithInvalidOffset(type, name, 32, Array, "array", 16,
+ 0x7FFFFFF8, "out-of-range");
+}
+
+function testSettingFromTypedArrayWithOutOfRangeOffset(type, name) {
+ setWithInvalidOffset(type, name, 32, type, name, 16,
+ 0x7FFFFFF8, "out-of-range");
+}
+
+function testSettingFromArrayWithNegativeOffset(type, name) {
+ setWithInvalidOffset(type, name, 32, Array, "array", 16,
+ -1, "negative");
+}
+
+function testSettingFromTypedArrayWithNegativeOffset(type, name) {
+ setWithInvalidOffset(type, name, 32, type, name, 16,
+ -1, "negative");
+}
+
+function testSettingFromArrayWithMinusZeroOffset(type, name) {
+ setWithValidOffset(type, name, 32, Array, "array", 16,
+ -0, "-0");
+}
+
+function testSettingFromTypedArrayWithMinusZeroOffset(type, name) {
+ setWithValidOffset(type, name, 32, type, name, 16,
+ -0, "-0");
+}
+
+function testSettingFromArrayWithBoundaryOffset(type, name) {
+ setWithValidOffset(type, name, 32, Array, "array", 16,
+ 16, "boundary");
+}
+
+function testSettingFromTypedArrayWithBoundaryOffset(type, name) {
+ setWithValidOffset(type, name, 32, type, name, 16,
+ 16, "boundary");
+}
+
+function testSettingFromArrayWithNonIntegerOffset(type, name) {
+ setWithValidOffset(type, name, 32, Array, "array", 16,
+ 16.999, "non-integer");
+}
+
+function testSettingFromTypedArrayWithNonIntegerOffset(type, name) {
+ setWithValidOffset(type, name, 32, type, name, 16,
+ 16.999, "non-integer");
+}
+
+function testSettingFromFakeArrayWithOutOfRangeLength(type, name) {
+ var webglArray = new type(32);
+ var array = {};
+ array.length = 0x80000000;
+ try {
+ webglArray.set(array, 8);
+ testFailed("Setting " + name + " from fake array with invalid length was not caught");
+ } catch (e) {
+ testPassed("Setting " + name + " from fake array with invalid length was caught");
+ }
+}
+
+
+function negativeTestGetAndSetMethods(type, name) {
+ array = new type([2, 3]);
+ shouldBeUndefined("array.get");
+ var exceptionThrown = false;
+ // We deliberately check for an exception here rather than using
+ // shouldThrow here because the precise contents of the syntax
+ // error are not specified.
+ try {
+ webGLArray.set(0, 1);
+ } catch (e) {
+ exceptionThrown = true;
+ }
+ var output = "array.set(0, 1) ";
+ if (exceptionThrown) {
+ testPassed(output + "threw exception.");
+ } else {
+ testFailed(output + "did not throw exception.");
+ }
+}
+
+function testNaNConversion(type, name) {
+ running('test storing NaN in ' + name);
+
+ var array = new type([1, 1]);
+ var results = [];
+
+ // The code block in each of the case statements below is identical, but some
+ // JavaScript engines need separate copies in order to exercise all of
+ // their optimized code paths.
+ try {
+ switch (type) {
+ case Float32Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Float64Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Int8Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Int16Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Int32Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Uint8Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Uint8ClampedArray:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Uint16Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ case Uint32Array:
+ for (var i = 0; i < array.length; ++i) {
+ array[i] = NaN;
+ results[i] = array[i];
+ }
+ break;
+ default:
+ fail("Unhandled type");
+ break;
+ }
+
+ // Some types preserve NaN values; all other types convert NaN to zero.
+ if (type === Float32Array || type === Float64Array) {
+ assert('initial NaN preserved', isNaN(new type([NaN])[0]));
+ for (var i = 0; i < array.length; ++i)
+ assert('NaN preserved via setter', isNaN(results[i]));
+ } else {
+ assertEq('initial NaN converted to zero', 0, new type([NaN])[0]);
+ for (var i = 0; i < array.length; ++i)
+ assertEq('NaN converted to zero by setter', 0, results[i]);
+ }
+
+ pass();
+ } catch (e) {
+ fail(e);
+ }
+}
+
+//
+// Test driver
+//
+
+function runTests() {
+ allPassed = true;
+
+ testSlice();
+ testArrayBufferIsViewMethod();
+ testInheritanceHierarchy();
+
+ for (var i = 0; i < testCases.length; i++) {
+ var testCase = testCases[i];
+ running(testCase.name);
+ if (!(testCase.name in window)) {
+ fail("does not exist");
+ continue;
+ }
+ var type = window[testCase.name];
+ var name = testCase.name;
+ if (testCase.unsigned) {
+ testSetAndGet10To1(type, name);
+ testConstructWithArrayOfUnsignedValues(type, name);
+ testConstructWithTypedArrayOfUnsignedValues(type, name);
+ } else {
+ testSetAndGetPos10ToNeg10(type, name);
+ testConstructWithArrayOfSignedValues(type, name);
+ testConstructWithTypedArrayOfSignedValues(type, name);
+ }
+ if (testCase.integral) {
+ testIntegralArrayTruncationBehavior(type, name, testCase.unsigned);
+ }
+ testGetWithOutOfRangeIndices(type, name);
+ testOffsetsAndSizes(type, name, testCase.elementSizeInBytes);
+ testSetFromTypedArray(type, name);
+ negativeTestSetFromTypedArray(type, name);
+ testSetFromArray(type, name);
+ negativeTestSetFromArray(type, name);
+ testSubarray(type, name);
+ testSubarrayOffsetAndLengthClamping(type, name);
+ negativeTestSubarray(type, name);
+ testSetBoundaryConditions(type,
+ name,
+ testCase.testValues,
+ testCase.expectedValues);
+ testConstructionBoundaryConditions(type,
+ name,
+ testCase.testValues,
+ testCase.expectedValues);
+ testConstructionWithNullBuffer(type, name);
+ testConstructionWithExceptionThrowingObject(type, name);
+ testConstructionWithOutOfRangeValues(type, name);
+ testConstructionWithNegativeOutOfRangeValues(type, name);
+ testConstructionWithUnalignedOffset(type, name, testCase.elementSizeInBytes);
+ testConstructionWithUnalignedLength(type, name, testCase.elementSizeInBytes);
+ testConstructionWithBothArrayBufferAndLength(type, name, testCase.elementSizeInBytes);
+ testConstructionWithSubPortionOfArrayBuffer(type, name, testCase.elementSizeInBytes);
+ testSubarrayWithOutOfRangeValues(type, name, testCase.elementSizeInBytes);
+ testSubarrayWithDefaultValues(type, name, testCase.elementSizeInBytes);
+ testSettingFromArrayWithOutOfRangeOffset(type, name);
+ testSettingFromTypedArrayWithOutOfRangeOffset(type, name);
+ testSettingFromArrayWithNegativeOffset(type, name);
+ testSettingFromTypedArrayWithNegativeOffset(type, name);
+ testSettingFromArrayWithMinusZeroOffset(type, name);
+ testSettingFromTypedArrayWithMinusZeroOffset(type, name);
+ testSettingFromArrayWithBoundaryOffset(type, name);
+ testSettingFromTypedArrayWithBoundaryOffset(type, name);
+ testSettingFromArrayWithNonIntegerOffset(type, name);
+ testSettingFromTypedArrayWithNonIntegerOffset(type, name);
+ testSettingFromFakeArrayWithOutOfRangeLength(type, name);
+ negativeTestGetAndSetMethods(type, name);
+ testNaNConversion(type, name);
+ }
+
+ printSummary();
+}
+
+runTests();
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html
new file mode 100644
index 0000000000..f634660181
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-crash.html
@@ -0,0 +1,33 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test that DataView does not crash with bad offset or length.");
+
+var array = new Uint8Array([164, 112, 157, 63]);
+var view;
+shouldThrow("view = new DataView(array.buffer, -4500000000)");
+shouldThrow("view = new DataView(array.buffer, -4500000000, 4500000000)");
+var value = view ? view.getFloat32(0, true) : 0;
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html
new file mode 100644
index 0000000000..1413227578
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/data-view-test.html
@@ -0,0 +1,421 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/test-eval.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Test DataView.");
+
+var intArray1 = [0, 1, 2, 3, 100, 101, 102, 103, 128, 129, 130, 131, 252, 253, 254, 255];
+var intArray2 = [31, 32, 33, 0, 1, 2, 3, 100, 101, 102, 103, 128, 129, 130, 131, 252, 253, 254, 255];
+var emptyArray = [204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204];
+
+var arrayBuffer = null;
+var view = null;
+var viewStart = 0;
+var viewLength = 0;
+
+function getElementSize(func)
+{
+ switch (func) {
+ case "Int8":
+ case "Uint8":
+ return 1;
+ case "Int16":
+ case "Uint16":
+ return 2;
+ case "Int32":
+ case "Uint32":
+ case "Float32":
+ return 4;
+ case "Float64":
+ return 8;
+ default:
+ debug("Should not reached");
+ }
+}
+
+function checkGet(func, index, expected, littleEndian)
+{
+ var expr = "view.get" + func + "(" + index;
+ if (littleEndian != undefined) {
+ expr += ", ";
+ expr += littleEndian ? "true" : "false";
+ }
+ expr += ")";
+ if (index >= 0 && index + getElementSize(func) - 1 < view.byteLength)
+ shouldBe(expr, expected);
+ else
+ shouldThrow(expr);
+}
+
+function checkSet(func, index, value, littleEndian)
+{
+ var expr = "view.set" + func + "(" + index + ", " + value;
+ if (littleEndian != undefined) {
+ expr += ", ";
+ expr += littleEndian ? "true" : "false";
+ }
+ expr += ")";
+ if (index >= 0 && index + getElementSize(func) - 1 < view.byteLength) {
+ shouldBeUndefined(expr);
+ checkGet(func, index, value, littleEndian);
+ } else
+ shouldThrow(expr);
+}
+
+function checkGetWithoutArgument(func, expected)
+{
+ var threw = false;
+ var value;
+ try {
+ value = view["get" + func]();
+ } catch (e) {
+ threw = true;
+ }
+
+ if (threw) {
+ // This used to be correct, but TC39 has changed the behavior of these methods.
+ testPassed("view.get" + func + " with no arguments throws.");
+ } else {
+ if (value === expected) {
+ testPassed("view.get" + func + " treats missing argument as 0.");
+ } else {
+ testFailed("view.get" + func + " accepts a missing argument but does not cast it to 0.");
+ }
+ }
+}
+
+function checkSetWithoutSecondArgument(func, index, isFloat)
+{
+ var expected = isFloat ? NaN : 0;
+ var threw = false;
+ var value;
+ try {
+ value = view["set" + func](index);
+ } catch (e) {
+ threw = true;
+ }
+
+ if (threw) {
+ // This used to be correct, but TC39 has changed the behavior of these methods.
+ testPassed("view.set" + func + " with missing second argument throws.");
+ } else {
+ var stored = view["get" + func](index);
+ if (value === undefined && isFloat ? isNaN(stored) : stored === expected) {
+ testPassed("view.set" + func + " treats missing second argument as " + expected + ".");
+ } else {
+ testFailed("view.set" + func + " accepts a missing second argument but does not cast it to " + expected + ".");
+ }
+ }
+}
+
+function checkSetWithoutArguments(func, isFloat)
+{
+ var expected = isFloat ? NaN : 0;
+ var threw = false;
+ var value;
+ try {
+ value = view["set" + func]();
+ } catch (e) {
+ threw = true;
+ }
+
+ if (threw) {
+ // This used to be correct, but TC39 has changed the behavior of these methods.
+ testPassed("view.set" + func + " with no arguments throws.");
+ } else {
+ var stored = view["get" + func](0);
+ if (value === undefined && isFloat ? isNaN(stored) : stored === expected) {
+ testPassed("view.set" + func + " treats missing first argument as 0.");
+ } else {
+ testFailed("view.set" + func + " accepts a missing first argument but does not cast it to 0.");
+ }
+ }
+}
+
+function testMissingArguments(func, constructor, isFloat)
+{
+ view = new DataView((new constructor(3)).buffer);
+ view["set" + func](0, 1);
+ view["set" + func](getElementSize(func), 2);
+ checkGetWithoutArgument(func, 1);
+ checkSetWithoutSecondArgument(func, getElementSize(func), isFloat);
+ view = new DataView((new constructor(3)).buffer);
+ view["set" + func](0, 1);
+ checkSetWithoutArguments(func, isFloat);
+}
+
+function test(isTestingGet, func, index, value, littleEndian)
+{
+ if (isTestingGet)
+ checkGet(func, index, value, littleEndian);
+ else
+ checkSet(func, index, value, littleEndian);
+}
+
+function createDataView(array, frontPaddingNum, littleEndian, start, length)
+{
+ if (!littleEndian)
+ array.reverse();
+ var paddingArray = new Array(frontPaddingNum);
+ arrayBuffer = (new Uint8Array(paddingArray.concat(array))).buffer;
+ viewStart = (start != undefined) ? start : 0;
+ viewLength = (length != undefined) ? length : arrayBuffer.byteLength - viewStart;
+ view = new DataView(arrayBuffer, viewStart, viewLength);
+ if (!littleEndian)
+ array.reverse(); // restore the array.
+}
+
+function runIntegerTestCases(isTestingGet, array, start, length)
+{
+ createDataView(array, 0, true, start, length);
+
+ test(isTestingGet, "Int8", 0, "0");
+ test(isTestingGet, "Int8", 8, "-128");
+ test(isTestingGet, "Int8", 15, "-1");
+
+ test(isTestingGet, "Uint8", 0, "0");
+ test(isTestingGet, "Uint8", 8, "128");
+ test(isTestingGet, "Uint8", 15, "255");
+
+ // Little endian.
+ test(isTestingGet, "Int16", 0, "256", true);
+ test(isTestingGet, "Int16", 5, "26213", true);
+ test(isTestingGet, "Int16", 9, "-32127", true);
+ test(isTestingGet, "Int16", 14, "-2", true);
+
+ // Big endian.
+ test(isTestingGet, "Int16", 0, "1");
+ test(isTestingGet, "Int16", 5, "25958");
+ test(isTestingGet, "Int16", 9, "-32382");
+ test(isTestingGet, "Int16", 14, "-257");
+
+ // Little endian.
+ test(isTestingGet, "Uint16", 0, "256", true);
+ test(isTestingGet, "Uint16", 5, "26213", true);
+ test(isTestingGet, "Uint16", 9, "33409", true);
+ test(isTestingGet, "Uint16", 14, "65534", true);
+
+ // Big endian.
+ test(isTestingGet, "Uint16", 0, "1");
+ test(isTestingGet, "Uint16", 5, "25958");
+ test(isTestingGet, "Uint16", 9, "33154");
+ test(isTestingGet, "Uint16", 14, "65279");
+
+ // Little endian.
+ test(isTestingGet, "Int32", 0, "50462976", true);
+ test(isTestingGet, "Int32", 3, "1717920771", true);
+ test(isTestingGet, "Int32", 6, "-2122291354", true);
+ test(isTestingGet, "Int32", 9, "-58490239", true);
+ test(isTestingGet, "Int32", 12, "-66052", true);
+
+ // Big endian.
+ test(isTestingGet, "Int32", 0, "66051");
+ test(isTestingGet, "Int32", 3, "56911206");
+ test(isTestingGet, "Int32", 6, "1718059137");
+ test(isTestingGet, "Int32", 9, "-2122152964");
+ test(isTestingGet, "Int32", 12, "-50462977");
+
+ // Little endian.
+ test(isTestingGet, "Uint32", 0, "50462976", true);
+ test(isTestingGet, "Uint32", 3, "1717920771", true);
+ test(isTestingGet, "Uint32", 6, "2172675942", true);
+ test(isTestingGet, "Uint32", 9, "4236477057", true);
+ test(isTestingGet, "Uint32", 12, "4294901244", true);
+
+ // Big endian.
+ test(isTestingGet, "Uint32", 0, "66051");
+ test(isTestingGet, "Uint32", 3, "56911206");
+ test(isTestingGet, "Uint32", 6, "1718059137");
+ test(isTestingGet, "Uint32", 9, "2172814332");
+ test(isTestingGet, "Uint32", 12, "4244504319");
+}
+
+function testFloat(isTestingGet, func, array, start, expected)
+{
+ // Little endian.
+ createDataView(array, 0, true, start);
+ test(isTestingGet, func, 0, expected, true);
+ createDataView(array, 3, true, start);
+ test(isTestingGet, func, 3, expected, true);
+ createDataView(array, 7, true, start);
+ test(isTestingGet, func, 7, expected, true);
+ createDataView(array, 10, true, start);
+ test(isTestingGet, func, 10, expected, true);
+
+ // Big endian.
+ createDataView(array, 0, false);
+ test(isTestingGet, func, 0, expected, false);
+ createDataView(array, 3, false);
+ test(isTestingGet, func, 3, expected, false);
+ createDataView(array, 7, false);
+ test(isTestingGet, func, 7, expected, false);
+ createDataView(array, 10, false);
+ test(isTestingGet, func, 10, expected, false);
+}
+
+function runFloatTestCases(isTestingGet, start)
+{
+ testFloat(isTestingGet, "Float32", isTestingGet ? [0, 0, 32, 65] : emptyArray, start, "10");
+ testFloat(isTestingGet, "Float32", isTestingGet ? [164, 112, 157, 63] : emptyArray, start, "1.2300000190734863");
+ testFloat(isTestingGet, "Float32", isTestingGet ? [95, 53, 50, 199] : emptyArray, start, "-45621.37109375");
+ testFloat(isTestingGet, "Float32", isTestingGet ? [255, 255, 255, 127] : emptyArray, start, "NaN");
+ testFloat(isTestingGet, "Float32", isTestingGet ? [255, 255, 255, 255] : emptyArray, start, "-NaN");
+
+ testFloat(isTestingGet, "Float64", isTestingGet ? [0, 0, 0, 0, 0, 0, 36, 64] : emptyArray, start, "10");
+ testFloat(isTestingGet, "Float64", isTestingGet ? [174, 71, 225, 122, 20, 174, 243, 63] : emptyArray, start, "1.23");
+ testFloat(isTestingGet, "Float64", isTestingGet ? [181, 55, 248, 30, 242, 179, 87, 193] : emptyArray, start, "-6213576.4839");
+ testFloat(isTestingGet, "Float64", isTestingGet ? [255, 255, 255, 255, 255, 255, 255, 127] : emptyArray, start, "NaN");
+ testFloat(isTestingGet, "Float64", isTestingGet ? [255, 255, 255, 255, 255, 255, 255, 255] : emptyArray, start, "-NaN");
+}
+
+function runNegativeIndexTests(isTestingGet)
+{
+ createDataView(intArray1, 0, true, 0, 16);
+
+ test(isTestingGet, "Int8", -1, "0");
+ test(isTestingGet, "Int8", -2, "0");
+
+ test(isTestingGet, "Uint8", -1, "0");
+ test(isTestingGet, "Uint8", -2, "0");
+
+ test(isTestingGet, "Int16", -1, "0");
+ test(isTestingGet, "Int16", -2, "0");
+ test(isTestingGet, "Int16", -3, "0");
+
+ test(isTestingGet, "Uint16", -1, "0");
+ test(isTestingGet, "Uint16", -2, "0");
+ test(isTestingGet, "Uint16", -3, "0");
+
+ test(isTestingGet, "Int32", -1, "0");
+ test(isTestingGet, "Int32", -3, "0");
+ test(isTestingGet, "Int32", -5, "0");
+
+ test(isTestingGet, "Uint32", -1, "0");
+ test(isTestingGet, "Uint32", -3, "0");
+ test(isTestingGet, "Uint32", -5, "0");
+
+ createDataView([0, 0, 0, 0, 0, 0, 36, 64], 0, true, 0, 8);
+
+ test(isTestingGet, "Float32", -1, "0");
+ test(isTestingGet, "Float32", -3, "0");
+ test(isTestingGet, "Float32", -5, "0");
+
+ test(isTestingGet, "Float64", -1, "0");
+ test(isTestingGet, "Float64", -5, "0");
+ test(isTestingGet, "Float64", -9, "0");
+}
+
+function runConstructorTests()
+{
+ arrayBuffer = (new Uint8Array([1, 2])).buffer;
+
+ debug("");
+ debug("Test for constructor taking 1 argument");
+ shouldBeDefined("view = new DataView(arrayBuffer)");
+ shouldBe("view.byteOffset", "0");
+ shouldBe("view.byteLength", "2");
+
+ debug("");
+ debug("Test for constructor taking 2 arguments");
+ shouldBeDefined("view = new DataView(arrayBuffer, 1)");
+ shouldBe("view.byteOffset", "1");
+ shouldBe("view.byteLength", "1");
+
+ debug("");
+ debug("Test for constructor taking 3 arguments");
+ shouldBeDefined("view = new DataView(arrayBuffer, 0, 1)");
+ shouldBe("view.byteOffset", "0");
+ shouldBe("view.byteLength", "1");
+
+ debug("");
+ debug("Test for constructor throwing exception");
+ shouldThrow("view = new DataView(arrayBuffer, 0, 3)");
+ shouldThrow("view = new DataView(arrayBuffer, 1, 2)");
+ shouldThrow("view = new DataView(arrayBuffer, 2, 1)");
+}
+
+function runGetTests()
+{
+ debug("");
+ debug("Test for get methods that work");
+ runIntegerTestCases(true, intArray1, 0, 16);
+ runFloatTestCases(true, 0);
+
+ debug("");
+ debug("Test for get methods that might read beyond range");
+ runIntegerTestCases(true, intArray2, 3, 2);
+ runFloatTestCases(true, 3);
+
+ debug("");
+ debug("Test for get methods that read from negative index");
+ runNegativeIndexTests(true);
+}
+
+function runSetTests()
+{
+ debug("");
+ debug("Test for set methods that work");
+ runIntegerTestCases(false, emptyArray, 0, 16);
+ runFloatTestCases(false);
+
+ debug("");
+ debug("Test for set methods that might write beyond the range");
+ runIntegerTestCases(false, emptyArray, 3, 2);
+ runFloatTestCases(false, 7);
+
+ debug("");
+ debug("Test for set methods that write to negative index");
+ runNegativeIndexTests(false);
+}
+
+function runMissingArgumentTests()
+{
+ debug("");
+ debug("Test for get and set methods missing arguments");
+ testMissingArguments("Int8", Int8Array);
+ testMissingArguments("Uint8", Uint8Array);
+ testMissingArguments("Int16", Int16Array);
+ testMissingArguments("Uint16", Uint16Array);
+ testMissingArguments("Int32", Int32Array);
+ testMissingArguments("Uint32", Uint32Array);
+ testMissingArguments("Float32", Float32Array, true);
+ testMissingArguments("Float64", Float64Array, true);
+}
+
+function runIndexingTests()
+{
+ debug("");
+ debug("Test for indexing that should not work");
+ view = new DataView((new Uint8Array([1, 2])).buffer);
+ shouldBeUndefined("view[0]");
+ shouldBeDefined("view[0] = 3");
+ shouldBe("view.getUint8(0)", "1");
+}
+
+runConstructorTests();
+runGetTests();
+runSetTests();
+runMissingArgumentTests();
+runIndexingTests();
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html
new file mode 100644
index 0000000000..69eb057589
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/typedarrays/typed-arrays-in-workers.html
@@ -0,0 +1,257 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/test-eval.js"></script>
+<script src="../../js/tests/typed-array-test-cases.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+
+var testQueue = [];
+var transferSupported = true;
+
+function nextTest() {
+ if (testQueue[0].subTests.length > 0) {
+ testQueue[0].subTests.shift();
+ }
+
+ while (testQueue.length > 0 && testQueue[0].subTests.length == 0) {
+ testQueue.shift();
+ }
+
+ if (testQueue.length == 0) {
+ finishTest();
+ return;
+ }
+
+ testQueue[0].subTests[0].runner();
+}
+
+function handleMessage(event) {
+ if (testQueue.length == 0)
+ return;
+
+ if (testQueue[0].subTests.length == 0)
+ return;
+
+ testQueue[0].subTests[0].checker(event);
+ nextTest();
+}
+
+function setupTest(testCase, runner, checker) {
+ testCase.subTests.push({ runner: runner.bind(null, testCase), checker: checker.bind(null, testCase) });
+}
+
+function arrayToString(arr) {
+ var result = "[ ";
+ for (var ii = 0; ii < arr.length; ++ii) {
+ if (ii > 0)
+ result += ", ";
+ result += arr[ii];
+ }
+ return result + " ]";
+}
+
+function constructTypedArray(type, data) {
+ if (type == 'Int8Array') {
+ return new Int8Array(data);
+ } else if (type == 'Uint8Array') {
+ return new Uint8Array(data);
+ } else if (type == 'Uint8ClampedArray') {
+ return new Uint8ClampedArray(data);
+ } else if (type == 'Int16Array') {
+ return new Int16Array(data);
+ } else if (type == 'Uint16Array') {
+ return new Uint16Array(data);
+ } else if (type == 'Int32Array') {
+ return new Int32Array(data);
+ } else if (type == 'Uint32Array') {
+ return new Uint32Array(data);
+ } else if (type == 'Float32Array') {
+ return new Float32Array(data);
+ } else if (type == 'Float64Array') {
+ return new Float64Array(data);
+ }
+}
+
+// Test runner / checker pairs
+function runTestWithData(command, testCase) {
+ worker.postMessage({command: command, type: testCase.name, subType: testCase.subType, elementSizeInBytes: testCase.elementSizeInBytes, data: testCase.testValues});
+}
+
+function checkArraysEqual(testKind, testCase, event) {
+ var array = event.data;
+ var testName = testKind + " " + testCase.name + " from worker to main thread";
+ if (areArraysEqual(array, testCase.expectedValues)) {
+ testPassed(testName);
+ } else {
+ testFailed(testName + ": expected " + arrayToString(testCase.expectedValues) + ", received " + arrayToString(array));
+ }
+}
+
+function checkBufferContentsEqual(testKind, testCase, event) {
+ var array = constructTypedArray(testCase.name, event.data);
+ var testName = testKind + " containing " + testCase.name + " values from worker to main thread";
+ if (areArraysEqual(array, testCase.expectedValues)) {
+ testPassed(testName);
+ } else {
+ testFailed(testName + ": expected " + arrayToString(testCase.expectedValues) + ", received " + arrayToString(array));
+ }
+}
+
+function checkDataViewContents(testKind, testCase, event) {
+ var dataView = event.data;
+ var testName = testKind + " " + testCase.name + " containing " + testCase.subType + " from worker to main thread";
+ var byteOffset = 0;
+ var allPassed = true;
+ for (var ii = 0; ii < testCase.expectedValues.length; ++ii) {
+ var expected = testCase.expectedValues[ii];
+ var received = dataView['get' + testCase.subType](byteOffset);
+ if (received != expected) {
+ allPassed = false;
+ testFailed(testName + ": at byte offset " + byteOffset + ": expected " + expected + ", received " + received);
+ }
+ byteOffset += testCase.elementSizeInBytes;
+ }
+ if (allPassed) {
+ testPassed(testName);
+ }
+}
+
+// Missing test: copy or transfer ArrayBuffer, wrap in DataView on this end, verify contents.
+
+function noop() {
+}
+
+function checkArraysEqualAndPingPong(testKind, transfer, testCase, event) {
+ checkArraysEqual(testKind, testCase, event);
+ var transferables = [];
+ if (transfer) {
+ transferables.push(event.data.buffer);
+ }
+ try {
+ worker.postMessage({ command: 'pong', data: event.data, transferables: transferables }, transferables);
+ } catch (e) {
+ testFailed("unexpected exception: " + e);
+ }
+}
+
+function checkBufferContentsEqualAndPingPong(testKind, transfer, testCase, event) {
+ checkBufferContentsEqual(testKind, testCase, event);
+ var transferables = [];
+ if (transfer) {
+ transferables.push(event.data);
+ }
+ try {
+ worker.postMessage({ command: 'pong', data: event.data, transferables: transferables }, transferables);
+ } catch (e) {
+ testFailed("unexpected exception: " + e);
+ }
+}
+
+function checkDataViewContentsAndPingPong(testKind, transfer, testCase, event) {
+ checkDataViewContents(testKind, testCase, event);
+ var transferables = [];
+ if (transfer) {
+ transferables.push(event.data.buffer);
+ }
+ try {
+ worker.postMessage({ command: 'pong', data: event.data, transferables: transferables }, transferables);
+ } catch (e) {
+ testFailed("unexpected exception: " + e);
+ }
+}
+
+description("Tests copying and transferring typed arrays and ArrayBuffers to and from workers");
+
+// See whether workers are supported at all
+if (window.Worker) {
+ // Start up the worker
+ var worker = new Worker('../../js/tests/typed-array-worker.js');
+ worker.onmessage = handleMessage;
+
+ // See whether transferables are supported
+ var buffer = new ArrayBuffer(16);
+ try {
+ worker.postMessage({ command: 'ignore', data: buffer }, [buffer]);
+ if (buffer.byteLength > 0)
+ transferSupported = false;
+ } catch (e) {
+ transferSupported = false;
+ }
+
+ // Iterate down the tests, queueing them up
+ for (var ii = 0; ii < testCases.length; ++ii) {
+ var testCase = testCases[ii];
+ testCase.subTests = [];
+ setupTest(testCase, runTestWithData.bind(null, 'copy'), checkArraysEqual.bind(null, 'copy'));
+ setupTest(testCase, runTestWithData.bind(null, 'copyBuffer'), checkBufferContentsEqual.bind(null, 'copy ArrayBuffer'));
+ setupTest(testCase, runTestWithData.bind(null, 'transfer'), checkArraysEqual.bind(null, 'transfer'));
+ setupTest(testCase, runTestWithData.bind(null, 'transferBuffer'), checkBufferContentsEqual.bind(null, 'transfer ArrayBuffer'));
+
+ // These two must run back-to-back
+ setupTest(testCase, runTestWithData.bind(null, 'copy'), checkArraysEqualAndPingPong.bind(null, 'copy', false));
+ setupTest(testCase, noop, checkArraysEqual.bind(null, 'ping-pong with copy'));
+
+ // These two must run back-to-back
+ setupTest(testCase, runTestWithData.bind(null, 'copyBuffer'), checkBufferContentsEqualAndPingPong.bind(null, 'copy ArrayBuffer', false));
+ setupTest(testCase, noop, checkBufferContentsEqual.bind(null, 'ping-pong with copy'));
+
+ // These two must run back-to-back
+ setupTest(testCase, runTestWithData.bind(null, 'transfer'), checkArraysEqualAndPingPong.bind(null, 'transfer', true));
+ setupTest(testCase, noop, checkArraysEqual.bind(null, 'ping-pong with transfer'));
+
+ // These two must run back-to-back
+ setupTest(testCase, runTestWithData.bind(null, 'transferBuffer'), checkBufferContentsEqualAndPingPong.bind(null, 'transfer ArrayBuffer', false));
+ setupTest(testCase, noop, checkBufferContentsEqual.bind(null, 'ping-pong with transfer'));
+
+ testQueue.push(testCase);
+
+ // Add just a couple of DataView tests; the behavior of that view type is thoroughly tested elsewhere
+ if (testCase.name == "Float32Array" || testCase.name == "Int32Array") {
+ var subTypeName = (testCase.name == "Float32Array" ? "Float32" : "Int32");
+ var dataViewTestCase = { name: "DataView",
+ subType: subTypeName,
+ elementSizeInBytes: testCase.elementSizeInBytes,
+ testValues: testCase.testValues,
+ expectedValues: testCase.expectedValues,
+ subTests: [] };
+ setupTest(dataViewTestCase, runTestWithData.bind(null, 'copy'), checkDataViewContents.bind(null, 'copy'));
+ setupTest(dataViewTestCase, runTestWithData.bind(null, 'transfer'), checkDataViewContents.bind(null, 'transfer'));
+
+ // These two must run back-to-back
+ setupTest(dataViewTestCase, runTestWithData.bind(null, 'copy'), checkDataViewContentsAndPingPong.bind(null, 'copy', false));
+ setupTest(dataViewTestCase, noop, checkDataViewContents.bind(null, 'ping-pong with copy'));
+
+ // These two must run back-to-back
+ setupTest(dataViewTestCase, runTestWithData.bind(null, 'transfer'), checkDataViewContentsAndPingPong.bind(null, 'transfer', false));
+ setupTest(dataViewTestCase, noop, checkDataViewContents.bind(null, 'ping-pong with transfer'));
+
+ testQueue.push(dataViewTestCase);
+ }
+ }
+
+ // Kick things off
+ testQueue[0].subTests[0].runner();
+} else {
+ debug("Workers not supported -- skipping test");
+ finishTest();
+}
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt
new file mode 100644
index 0000000000..2da0fc47a3
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/00_test_list.txt
@@ -0,0 +1,31 @@
+gl-uniform-arrays.html
+# This test is no longer valid with the new packing restrictions
+#--min-version 1.0.02 gl-uniform-unused-array-elements-get-truncated.html
+gl-uniform-bool.html
+--min-version 1.0.4 gl-get-uniform-non-current-program.html
+gl-uniformmatrix4fv.html
+gl-unknown-uniform.html
+no-over-optimization-on-uniform-array-00.html
+no-over-optimization-on-uniform-array-01.html
+no-over-optimization-on-uniform-array-02.html
+no-over-optimization-on-uniform-array-03.html
+no-over-optimization-on-uniform-array-04.html
+no-over-optimization-on-uniform-array-05.html
+no-over-optimization-on-uniform-array-06.html
+no-over-optimization-on-uniform-array-07.html
+no-over-optimization-on-uniform-array-08.html
+no-over-optimization-on-uniform-array-09.html
+no-over-optimization-on-uniform-array-10.html
+no-over-optimization-on-uniform-array-11.html
+no-over-optimization-on-uniform-array-12.html
+no-over-optimization-on-uniform-array-13.html
+no-over-optimization-on-uniform-array-14.html
+no-over-optimization-on-uniform-array-15.html
+no-over-optimization-on-uniform-array-16.html
+no-over-optimization-on-uniform-array-17.html
+null-uniform-location.html
+--min-version 1.0.2 out-of-bounds-uniform-array-access.html
+--min-version 1.0.2 uniform-default-values.html
+--min-version 1.0.3 uniform-values-per-program.html
+uniform-location.html
+uniform-samplers-test.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-get-uniform-non-current-program.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-get-uniform-non-current-program.html
new file mode 100644
index 0000000000..f6628748f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-get-uniform-non-current-program.html
@@ -0,0 +1,79 @@
+<!--
+Copyright (c) 2022 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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL getUniform from non-current program</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+ <script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 vPosition;
+ void main()
+ {
+ gl_Position = vPosition;
+ }
+ </script>
+
+ <script id="fshader" type="x-shader/x-fragment">
+ precision mediump float;
+ uniform float color;
+ void main()
+ {
+ gl_FragColor = vec4(color);
+ }
+ </script>
+<script>
+"use strict";
+description("This test ensures WebGL implementations handle getUniform when the program is not the current program");
+
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program1 = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+var program2 = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+var loc = gl.getUniformLocation(program1, "color");
+
+debug("check we can call getUniform when the program is current")
+gl.useProgram(program1);
+shouldBe("gl.getUniform(program1, loc)", "0");
+debug("check we can call getUniform when a different program is current")
+gl.useProgram(program2);
+shouldBe("gl.getUniform(program1, loc)", "0");
+debug("check we can call getUniform when no program is current")
+gl.useProgram(null);
+shouldBe("gl.getUniform(program1, loc)", "0");
+
+debug("check we can call getUniform when the program is current")
+gl.useProgram(program1);
+gl.uniform1f(loc, 123)
+shouldBe("gl.getUniform(program1, loc)", "123");
+debug("check we can call getUniform when a different program is current")
+gl.useProgram(program2);
+shouldBe("gl.getUniform(program1, loc)", "123");
+debug("check we can call getUniform when no program is current")
+gl.useProgram(null);
+shouldBe("gl.getUniform(program1, loc)", "123");
+
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should no errors");
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html
new file mode 100644
index 0000000000..7ffde96d84
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-arrays.html
@@ -0,0 +1,738 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 a_position;
+ void main()
+ {
+ gl_Position = a_position;
+ }
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+ precision mediump float;
+ uniform $(type) color[3];
+ void main()
+ {
+ gl_FragColor = vec4(color[0]$(elem), color[1]$(elem), color[2]$(elem), 1);
+ }
+</script>
+<script id="vshader300" type="x-shader/x-vertex">
+ #version 300 es
+ in vec4 a_position;
+ void main()
+ {
+ gl_Position = a_position;
+ }
+</script>
+
+<script id="fshader300" type="x-shader/x-fragment">
+ #version 300 es
+ precision mediump float;
+ uniform $(type) color[3];
+ out vec4 o_FragColor;
+ void main()
+ {
+ o_FragColor = vec4(color[0]$(elem), color[1]$(elem), color[2]$(elem), 1);
+ }
+</script>
+<script>
+"use strict";
+description();
+debug("");
+// MaxInt32 is 2^32-1. We need +1 of that to test overflow conditions.
+var MaxInt32PlusOne = 4294967296;
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+
+const contextVersion = wtu.getDefault3DContextVersion();
+
+let [vElemId, fElemId] = ["vshader", "fshader"];
+if (contextVersion >= 2) {
+ [vElemId, fElemId] = ["vshader300", "fshader300"];
+}
+
+var vSrc = wtu.getScript(vElemId).trim();
+var fTemplate = wtu.getScript(fElemId).trim();
+
+const typeInfos = [
+ { type: 'float',
+ jsTypeOf: 'number',
+ setter: 'uniform1fv',
+ elem: '',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform2fv(loc, [1, 2]);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return srcValues[index].toString();
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : value.toString();
+ },
+ checkType: function(value) {
+ return typeof value === 'number';
+ },
+ checkValue: function(typeInfo, index, value) {
+ return typeInfo.srcValues[index] == value;
+ },
+ srcValues: [16, 15, 14],
+ srcValuesLess: [],
+ srcValuesLessMultiple: [16],
+ srcValuesMoreMultiple: [16, 15, 14, 13],
+ srcValuesNonMultiple: null,
+ },
+ { type: 'vec2',
+ jsTypeOf: 'Float32Array',
+ setter: 'uniform2fv',
+ elem: '[1]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1fv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1fv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 2 + 0].toString() + ", " +
+ srcValues[index * 2 + 1].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : ("[" + value[0] + ", " + value[1] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 2;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 2 + 0] == value[0] &&
+ typeInfo.srcValues[index * 2 + 1] == value[1];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11],
+ srcValuesLess: [16],
+ srcValuesLessMultiple: [16, 15, 14, 13],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10],
+ },
+ { type: 'vec3',
+ jsTypeOf: 'Float32Array',
+ setter: 'uniform3fv',
+ elem: '[2]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1fv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1fv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 3 + 0].toString() + ", " +
+ srcValues[index * 3 + 1].toString() + ", " +
+ srcValues[index * 3 + 2].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] + ", " + value[2] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 3;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 3 + 0] == value[0] &&
+ typeInfo.srcValues[index * 3 + 1] == value[1] &&
+ typeInfo.srcValues[index * 3 + 2] == value[2];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8],
+ srcValuesLess: [16, 15],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7],
+ },
+ { type: 'vec4',
+ jsTypeOf: 'Float32Array',
+ setter: 'uniform4fv',
+ elem: '[3]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1fv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1fv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 4 + 0].toString() + ", " +
+ srcValues[index * 4 + 1].toString() + ", " +
+ srcValues[index * 4 + 2].toString() + ", " +
+ srcValues[index * 4 + 3].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] +
+ ", " + value[2] + ", " + value[3] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 4;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 4 + 0] == value[0] &&
+ typeInfo.srcValues[index * 4 + 1] == value[1] &&
+ typeInfo.srcValues[index * 4 + 2] == value[2] &&
+ typeInfo.srcValues[index * 4 + 3] == value[3];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5],
+ srcValuesLess: [16, 15, 14],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4],
+ }
+];
+
+if (contextVersion >= 2) {
+ const more = [
+ { type: 'int',
+ jsTypeOf: 'number',
+ setter: 'uniform1iv',
+ elem: '',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform2iv(loc, [1, 2]);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return srcValues[index].toString();
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : value.toString();
+ },
+ checkType: function(value) {
+ return typeof value === 'number';
+ },
+ checkValue: function(typeInfo, index, value) {
+ return typeInfo.srcValues[index] == value;
+ },
+ srcValues: [16, 15, 14],
+ srcValuesLess: [],
+ srcValuesLessMultiple: [16],
+ srcValuesMoreMultiple: [16, 15, 14, 13],
+ srcValuesNonMultiple: null,
+ },
+ { type: 'ivec2',
+ jsTypeOf: 'Int32Array',
+ setter: 'uniform2iv',
+ elem: '[1]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1iv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1iv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 2 + 0].toString() + ", " +
+ srcValues[index * 2 + 1].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : ("[" + value[0] + ", " + value[1] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 2;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 2 + 0] == value[0] &&
+ typeInfo.srcValues[index * 2 + 1] == value[1];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11],
+ srcValuesLess: [16],
+ srcValuesLessMultiple: [16, 15, 14, 13],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10],
+ },
+ { type: 'ivec3',
+ jsTypeOf: 'Int32Array',
+ setter: 'uniform3iv',
+ elem: '[2]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1iv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1iv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 3 + 0].toString() + ", " +
+ srcValues[index * 3 + 1].toString() + ", " +
+ srcValues[index * 3 + 2].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] + ", " + value[2] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 3;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 3 + 0] == value[0] &&
+ typeInfo.srcValues[index * 3 + 1] == value[1] &&
+ typeInfo.srcValues[index * 3 + 2] == value[2];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8],
+ srcValuesLess: [16, 15],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7],
+ },
+ { type: 'ivec4',
+ jsTypeOf: 'Int32Array',
+ setter: 'uniform4iv',
+ elem: '[3]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1iv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1iv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 4 + 0].toString() + ", " +
+ srcValues[index * 4 + 1].toString() + ", " +
+ srcValues[index * 4 + 2].toString() + ", " +
+ srcValues[index * 4 + 3].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] +
+ ", " + value[2] + ", " + value[3] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 4;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 4 + 0] == value[0] &&
+ typeInfo.srcValues[index * 4 + 1] == value[1] &&
+ typeInfo.srcValues[index * 4 + 2] == value[2] &&
+ typeInfo.srcValues[index * 4 + 3] == value[3];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5],
+ srcValuesLess: [16, 15, 14],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4],
+ },
+
+
+ { type: 'uint',
+ jsTypeOf: 'number',
+ setter: 'uniform1uiv',
+ elem: '',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform2uiv(loc, [1, 2]);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return srcValues[index].toString();
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : value.toString();
+ },
+ checkType: function(value) {
+ return typeof value === 'number';
+ },
+ checkValue: function(typeInfo, index, value) {
+ return typeInfo.srcValues[index] == value;
+ },
+ srcValues: [16, 15, 14],
+ srcValuesLess: [],
+ srcValuesLessMultiple: [16],
+ srcValuesMoreMultiple: [16, 15, 14, 13],
+ srcValuesNonMultiple: null,
+ },
+ { type: 'uvec2',
+ jsTypeOf: 'Uint32Array',
+ setter: 'uniform2uiv',
+ elem: '[1]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1uiv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1uiv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 2 + 0].toString() + ", " +
+ srcValues[index * 2 + 1].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : ("[" + value[0] + ", " + value[1] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 2;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 2 + 0] == value[0] &&
+ typeInfo.srcValues[index * 2 + 1] == value[1];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11],
+ srcValuesLess: [16],
+ srcValuesLessMultiple: [16, 15, 14, 13],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10],
+ },
+ { type: 'uvec3',
+ jsTypeOf: 'Uint32Array',
+ setter: 'uniform3uiv',
+ elem: '[2]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1uiv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1uiv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 3 + 0].toString() + ", " +
+ srcValues[index * 3 + 1].toString() + ", " +
+ srcValues[index * 3 + 2].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] + ", " + value[2] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 3;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 3 + 0] == value[0] &&
+ typeInfo.srcValues[index * 3 + 1] == value[1] &&
+ typeInfo.srcValues[index * 3 + 2] == value[2];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8],
+ srcValuesLess: [16, 15],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7],
+ },
+ { type: 'uvec4',
+ jsTypeOf: 'Uint32Array',
+ setter: 'uniform4uiv',
+ elem: '[3]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1uiv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1uiv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 4 + 0].toString() + ", " +
+ srcValues[index * 4 + 1].toString() + ", " +
+ srcValues[index * 4 + 2].toString() + ", " +
+ srcValues[index * 4 + 3].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] +
+ ", " + value[2] + ", " + value[3] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 4;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 4 + 0] == value[0] &&
+ typeInfo.srcValues[index * 4 + 1] == value[1] &&
+ typeInfo.srcValues[index * 4 + 2] == value[2] &&
+ typeInfo.srcValues[index * 4 + 3] == value[3];
+ },
+ srcValues: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5],
+ srcValuesLess: [16, 15, 14],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4],
+ },
+
+
+ { type: 'bool',
+ jsTypeOf: 'boolean',
+ setter: 'uniform1iv',
+ elem: '',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform2iv(loc, [1, 2]);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return srcValues[index].toString();
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : value.toString();
+ },
+ checkType: function(value) {
+ return typeof value === 'boolean';
+ },
+ checkValue: function(typeInfo, index, value) {
+ return typeInfo.srcValues[index] == value;
+ },
+ srcValues: [true, true, true],
+ srcValuesLess: [],
+ srcValuesLessMultiple: [16],
+ srcValuesMoreMultiple: [16, 15, 14, 13],
+ srcValuesNonMultiple: null,
+ },
+ { type: 'bvec2',
+ jsTypeOf: 'Float32Array',
+ setter: 'uniform2fv',
+ elem: '[1]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1iv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1iv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 2 + 0].toString() + ", " +
+ srcValues[index * 2 + 1].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' : ("[" + value[0] + ", " + value[1] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 2;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 2 + 0] == value[0] &&
+ typeInfo.srcValues[index * 2 + 1] == value[1];
+ },
+ srcValues: [true, true, true, true, true, true],
+ srcValuesLess: [16],
+ srcValuesLessMultiple: [16, 15, 14, 13],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10],
+ },
+ { type: 'bvec3',
+ jsTypeOf: 'Int32Array',
+ setter: 'uniform3iv',
+ elem: '[2]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1iv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1iv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 3 + 0].toString() + ", " +
+ srcValues[index * 3 + 1].toString() + ", " +
+ srcValues[index * 3 + 2].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] + ", " + value[2] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 3;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 3 + 0] == value[0] &&
+ typeInfo.srcValues[index * 3 + 1] == value[1] &&
+ typeInfo.srcValues[index * 3 + 2] == value[2];
+ },
+ srcValues: [true, true, true, true, true, true, true, true, true],
+ srcValuesLess: [16, 15],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7],
+ },
+ { type: 'bvec4',
+ jsTypeOf: 'Uint32Array',
+ setter: 'uniform4uiv',
+ elem: '[3]',
+ numSrcValues: 3,
+ invalidSet: function(loc) {
+ gl.uniform1iv(loc, [2]);
+ },
+ illegalSet: function(loc) {
+ gl.uniform1iv(loc, 2);
+ },
+ srcValueAsString: function(index, srcValues) {
+ return "[" + srcValues[index * 4 + 0].toString() + ", " +
+ srcValues[index * 4 + 1].toString() + ", " +
+ srcValues[index * 4 + 2].toString() + ", " +
+ srcValues[index * 4 + 3].toString() + "]";
+ },
+ returnValueAsString: function(value) {
+ return value === null ? 'null' :
+ ("[" + value[0] + ", " + value[1] +
+ ", " + value[2] + ", " + value[3] + "]");
+ },
+ checkType: function(value) {
+ return value &&
+ typeof value.length === 'number' &&
+ value.length == 4;
+ },
+ checkValue: function(typeInfo, index, value) {
+ return value !== null &&
+ typeInfo.srcValues[index * 4 + 0] == value[0] &&
+ typeInfo.srcValues[index * 4 + 1] == value[1] &&
+ typeInfo.srcValues[index * 4 + 2] == value[2] &&
+ typeInfo.srcValues[index * 4 + 3] == value[3];
+ },
+ srcValues: [true, true, true, true, true, true, true, true, true, true, true, true],
+ srcValuesLess: [16, 15, 14],
+ srcValuesLessMultiple: [16, 15, 14, 13, 12, 11, 10, 9],
+ srcValuesMoreMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1],
+ srcValuesNonMultiple: [16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4],
+ }
+ ];
+ typeInfos.push(...more);
+}
+
+let loc;
+for (var tt = 0; tt < typeInfos.length; ++tt) {
+ var typeInfo = typeInfos[tt];
+ debug("");
+ debug("check " + typeInfo.type);
+ var fSrc = wtu.replaceParams(fTemplate, typeInfo);
+ //debug("fSrc: " + fSrc);
+ var program = wtu.loadProgram(gl, vSrc, fSrc);
+
+ var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+ assertMsg(numUniforms == 1, "1 uniform found");
+ var info = gl.getActiveUniform(program, 0);
+ assertMsg(info.name == "color[0]",
+ "uniform name is 'color[0]' not 'color' as per OpenGL ES 2.0.24 section 2.10");
+ shouldBeNull("gl.getUniformLocation(program, 'color[" + MaxInt32PlusOne + "]');");
+ loc = gl.getUniformLocation(program, "color[0]");
+ if (!loc) throw 'Missing loc';
+ var srcValues = typeInfo.srcValues;
+ var srcValuesLess = typeInfo.srcValuesLess;
+ var srcValuesLessMultiple = typeInfo.srcValuesLessMultiple;
+ var srcValuesMoreMultiple = typeInfo.srcValuesMoreMultiple;
+ var srcValuesNonMultiple = typeInfo.srcValuesNonMultiple;
+
+ // Try setting the value before using the program
+ gl[typeInfo.setter](loc, srcValues);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "should fail if there is no current program");
+
+ gl.useProgram(program);
+ gl[typeInfo.setter](loc, srcValuesLess);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "should fail with insufficient array size with gl." + typeInfo.setter);
+ if (srcValuesNonMultiple) {
+ gl[typeInfo.setter](loc, srcValuesNonMultiple);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE,
+ "should fail with non-multiple array size with gl." + typeInfo.setter);
+ }
+
+ const validDatas = [
+ `new Float32Array(${srcValues.length})`,
+ `new Float32Array(new ArrayBuffer(4*${srcValues.length}))`,
+ ];
+ if (window.SharedArrayBuffer) {
+ validDatas.push(
+ `new Float32Array(new SharedArrayBuffer(4*${srcValues.length}))`
+ );
+ }
+ for (const x of validDatas) {
+ shouldNotThrow(`gl.${typeInfo.setter}(loc, ${x});`);
+ }
+
+ gl[typeInfo.setter](loc, srcValues);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "can set an array of uniforms with gl." + typeInfo.setter);
+ gl[typeInfo.setter](loc, srcValuesLessMultiple);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "can partially set an array of uniforms with gl." + typeInfo.setter + " with a smaller array");
+ gl[typeInfo.setter](loc, srcValuesMoreMultiple);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "can set an array of uniforms with gl." + typeInfo.setter + " with a larger array");
+
+ var values = gl.getUniform(program, loc);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "can call gl.getUniform");
+ assertMsg(typeInfo.checkType(values),
+ "gl.getUniform returns the correct type. " + `(was ${values.constructor.name})`);
+ for (var ii = 0; ii < typeInfo.numSrcValues; ++ii) {
+ shouldBeNull("gl.getUniformLocation(program, 'color[" + (MaxInt32PlusOne + ii) + "]')");
+ var elemLoc = gl.getUniformLocation(program, "color[" + ii + "]");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "can get location of element " + ii +
+ " of array from gl.getUniformLocation");
+ var value = gl.getUniform(program, elemLoc);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "can get value of element " + ii + " of array from gl.getUniform");
+ assertMsg(typeInfo.checkValue(typeInfo, ii, value),
+ "value put in (" + typeInfo.srcValueAsString(ii, srcValues) +
+ ") matches value pulled out (" +
+ typeInfo.returnValueAsString(value) + ")");
+ }
+ typeInfo.invalidSet(loc);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "using the wrong size of gl.Uniform fails");
+ var exceptionCaught = false;
+ if (typeInfo.illegalSet) {
+ try {
+ typeInfo.illegalSet(loc);
+ } catch (e) {
+ exceptionCaught = true;
+ }
+ assertMsg(exceptionCaught, "passing non-array to glUniform*fv should throw TypeError");
+ }
+
+ gl.useProgram(null);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "can call gl.useProgram(null)");
+}
+
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html
new file mode 100644
index 0000000000..4f23cb4cf4
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-bool.html
@@ -0,0 +1,59 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniformMatrix Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+ <script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 vPosition;
+ void main()
+ {
+ gl_Position = vPosition;
+ }
+ </script>
+
+ <script id="fshader" type="x-shader/x-fragment">
+ uniform bool color;
+ void main()
+ {
+ gl_FragColor = vec4(float(color),0.0,0.0,1.0);
+ }
+ </script>
+<script>
+"use strict";
+description("This test ensures WebGL implementations handle bool uniforms in a OpenGL ES 2.0 spec compliant way");
+
+debug("");
+debug("NOTE: Some OpenGL drivers do not handle this correctly");
+debug("");
+debug("Checking gl.uniform1f with bool.");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+var loc = gl.getUniformLocation(program, "color");
+gl.uniform1f(loc, 1);
+wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "should be able to set bool with gl.uniform1f");
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html
new file mode 100644
index 0000000000..b755e59ee2
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-struct-unused.html
@@ -0,0 +1,83 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform struct Conformance 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+uniform vec4 u0;
+struct MyStruct {
+ vec4 var1;
+ vec4 var2;
+ vec4 var3;
+ vec4 var4;
+};
+uniform MyStruct u1;
+uniform vec4 u2;
+varying vec4 v_color;
+void main()
+{
+ gl_Position = vPosition;
+ v_color = (u0 + u2 + u1.var1) - vec4(2.0);
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main()
+{
+ gl_FragColor = v_color;
+}
+</script>
+
+<script>
+"use strict";
+description("This test ensures WebGL implementations handle unused members at the end of structs correctly.");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var c = document.getElementById("console");
+program = wtu.setupProgram(gl, ["vshader", "fshader"], [ "vPosition"]);
+
+wtu.setupUnitQuad(gl, [0, 1]);
+var white = [1.0, 1.0, 1.0, 1.0];
+var black = [0.0, 0.0, 0.0, 0.0];
+gl.uniform4fv(gl.getUniformLocation(program, "u0"), white);
+gl.uniform4fv(gl.getUniformLocation(program, "u1.var1"), white);
+gl.uniform4fv(gl.getUniformLocation(program, "u1.var2"), black);
+gl.uniform4fv(gl.getUniformLocation(program, "u1.var3"), black);
+gl.uniform4fv(gl.getUniformLocation(program, "u1.var4"), black);
+gl.uniform4fv(gl.getUniformLocation(program, "u2"), white);
+wtu.clearAndDrawUnitQuad(gl);
+wtu.checkCanvas(gl, [255, 255, 255, 255], "should be white", 0);
+gl.uniform4fv(gl.getUniformLocation(program, "u1.var2"), black);
+gl.uniform4fv(gl.getUniformLocation(program, "u1.var3"), black);
+gl.uniform4fv(gl.getUniformLocation(program, "u1.var4"), black);
+wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 0]);
+wtu.checkCanvas(gl, [255, 255, 255, 255], "should still be white", 0);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no GL errors");
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html
new file mode 100644
index 0000000000..f8322cca01
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniform-unused-array-elements-get-truncated.html
@@ -0,0 +1,114 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform unused array elements get truncated Conformance 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshader" type="x-shader/x-vertex">
+ attribute vec4 a_position;
+ void main()
+ {
+ gl_Position = a_position;
+ }
+</script>
+<script id="fshader-max" type="x-shader/x-fragment">
+ precision mediump float;
+ uniform vec4 colora[$(numUniformVectors)];
+ void main()
+ {
+ gl_FragColor = vec4(colora[$(usedUniformVector)]);
+ }
+</script>
+<script>
+"use strict";
+description();
+debug("");
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var vSrc = wtu.getScript("vshader");
+var uniforms;
+// This test is to test drivers the have bugs related to optimizing
+// an array of uniforms when only 1 of those uniforms is used.
+debug("");
+var maxUniformVectors = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);
+var tests = [
+ { desc: "using 5th element",
+ maxUniformVectors: maxUniformVectors,
+ numUniformVectors: maxUniformVectors * 2,
+ usedUniformVector: 5,
+ shader: "fshader-max",
+ color: [0, 1, 0, 1],
+ arrayName: "colora",
+ },
+];
+
+// According to the spec unused array elements must be truncated.
+var requiredUniformLocationsExist;
+function testUniformIssues(testIndex) {
+ var test = tests[testIndex];
+ debug("");
+ debug(test.desc);
+ var fSrc = test.source;
+ if (!fSrc) {
+ fSrc = wtu.replaceParams(wtu.getScript(test.shader), test);
+ }
+
+ var consoleElem = document.getElementById("console");
+ wtu.addShaderSource(
+ consoleElem, "vertex shader", vSrc);
+ wtu.addShaderSource(
+ consoleElem, "fragment shader", fSrc);
+
+ var program = wtu.loadProgram(gl, vSrc, fSrc);
+ gl.useProgram(program);
+ uniforms = wtu.getUniformMap(gl, program);
+ shouldBe('uniforms["' + test.arrayName + '[0]"].size', (test.usedUniformVector + 1).toString());
+
+ requiredUniformLocationsExist = true;
+ for (var ii = 0; ii <= test.usedUniformVector + 1; ++ii) {
+ var name = test.arrayName + "[" + ii + "]";
+ var colorLocation = gl.getUniformLocation(program, name);
+ if (ii <= test.usedUniformVector) {
+ if (!colorLocation) {
+ requiredUniformLocationsExist = false
+ }
+ } else {
+ if (colorLocation) {
+ testFailed("uniform array was not truncated as specified in OpenGL ES 2.0.25 section 2.10.4");
+ }
+ }
+ }
+ shouldBeTrue("requiredUniformLocationsExist");
+}
+
+var testIndex = 0;
+function runNextTest() {
+ testUniformIssues(testIndex++);
+ if (testIndex < tests.length) {
+ setTimeout(runNextTest, 0);
+ } else {
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+ debug("");
+ finishTest();
+ }
+}
+runNextTest();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html
new file mode 100644
index 0000000000..eb4977a6fd
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-uniformmatrix4fv.html
@@ -0,0 +1,149 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniformMatrix Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+
+<script id="vshader" type="x-shader/x-vertex">
+uniform mat2 world2x2;
+uniform mat3 world3x3;
+uniform mat4 world4x4;
+void main() {
+ gl_Position.x += world2x2[0][0];
+ gl_Position.x += world3x3[0][0];
+ gl_Position.x += world4x4[0][0];
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main() {}
+</script>
+
+<script id="vshader300" type="x-shader/x-vertex">
+#version 300 es
+uniform mat2 world2x2;
+uniform mat2x3 world2x3;
+uniform mat2x4 world2x4;
+uniform mat3x2 world3x2;
+uniform mat3 world3x3;
+uniform mat3x4 world3x4;
+uniform mat4x2 world4x2;
+uniform mat4x3 world4x3;
+uniform mat4 world4x4;
+void main() {
+ gl_Position.x += world2x2[0][0];
+ gl_Position.x += world2x3[0][0];
+ gl_Position.x += world2x4[0][0];
+ gl_Position.x += world3x2[0][0];
+ gl_Position.x += world3x3[0][0];
+ gl_Position.x += world3x4[0][0];
+ gl_Position.x += world4x2[0][0];
+ gl_Position.x += world4x3[0][0];
+ gl_Position.x += world4x4[0][0];
+}
+</script>
+
+<script id="fshader300" type="x-shader/x-fragment">
+#version 300 es
+void main() {}
+</script>
+
+<script>
+"use strict";
+description("This test ensures WebGL implementations handle uniformMatrix in a OpenGL ES 2.0 spec compliant way");
+
+debug("");
+debug("Checking gl.uniformMatrix.");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var contextVersion = wtu.getDefault3DContextVersion();
+
+let shaders = ["vshader", "fshader"];
+const dims = [
+ [2, 2, 'uniformMatrix2fv'],
+ [3, 3, 'uniformMatrix3fv'],
+ [4, 4, 'uniformMatrix4fv'],
+];
+
+if (contextVersion >= 2) {
+ shaders = ["vshader300", "fshader300"];
+ dims.push(
+ [2, 3, 'uniformMatrix2x3fv'],
+ [2, 4, 'uniformMatrix2x4fv'],
+ [3, 2, 'uniformMatrix3x2fv'],
+ [3, 4, 'uniformMatrix3x4fv'],
+ [4, 2, 'uniformMatrix4x2fv'],
+ [4, 3, 'uniformMatrix4x3fv']
+ );
+}
+
+const program = wtu.setupProgram(gl, shaders);
+let loc;
+
+for (const [A, B, name] of dims) {
+ loc = gl.getUniformLocation(program, `world${A}x${B}`);
+ if (!loc) throw 'missing loc';
+
+ const mat = [];
+ for (let a = 0; a < A; ++a) {
+ for (let b = 0; b < B; ++b) {
+ mat.push((a == b) ? 1 : 0);
+ }
+ }
+ const matLess = mat.slice(0, mat.length-2);
+ const matMore = mat.concat([1]);
+
+ gl[name](loc, false, matLess);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "should fail with insufficient array size for " + name);
+ gl[name](loc, false, mat);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should succeed with correct array size for " + name);
+ gl[name](loc, false, matMore);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, "should fail with more than 1 array size for " + name);
+
+ const validDatas = [
+ `new Float32Array(${mat.length})`,
+ `new Float32Array(new ArrayBuffer(4*${mat.length}))`,
+ ];
+ if (window.SharedArrayBuffer) {
+ validDatas.push(
+ `new Float32Array(new SharedArrayBuffer(4*${mat.length}))`
+ );
+ }
+ for (const x of validDatas) {
+ shouldNotThrow(`gl.${name}(loc, false, ${x});`);
+ }
+
+ gl[name](loc, false, mat);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "can call " + name + "with transpose = false");
+ if (contextVersion <= 1) {
+ gl[name](loc, true, mat);
+ wtu.glErrorShouldBe(gl, gl.INVALID_VALUE, name + " should return INVALID_VALUE with transpose = true");
+ } else {
+ gl[name](loc, true, mat);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "can call " + name + "with transpose = true");
+ }
+}
+
+debug("");
+var successfullyParsed = true;
+
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html
new file mode 100644
index 0000000000..825fd23831
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/gl-unknown-uniform.html
@@ -0,0 +1,67 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL Unknown Uniform Conformance 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>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="canvas" width="2" height="2"> </canvas>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+void main()
+{
+ gl_FragColor = vec4(1.0,0.0,0.0,1.0);
+}
+</script>
+<script>
+"use strict";
+description("Tests that unknown uniforms don't cause errors.");
+
+debug("");
+debug("Canvas.getContext");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("canvas");
+if (!gl) {
+ testFailed("context does not exist");
+} else {
+ testPassed("context exists");
+
+ debug("");
+
+ var program = wtu.setupProgram(gl, ["vshader", "fshader"], ["vPosition"]);
+ // Get the location of an unknown uniform.
+ var loc = gl.getUniformLocation(program, "someUnknownUniform");
+ assertMsg(loc === null, "location of unknown uniform should be null");
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "there should be no error from getting an unknown uniform");
+ gl.uniform1f(loc, 1);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "there should be no error from trying to set an unknown uniform");
+}
+
+debug("");
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-00.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-00.html
new file mode 100644
index 0000000000..d331fa9299
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-00.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 0;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-01.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-01.html
new file mode 100644
index 0000000000..a60c1af473
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-01.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 1;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-02.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-02.html
new file mode 100644
index 0000000000..670d553802
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-02.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 2;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-03.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-03.html
new file mode 100644
index 0000000000..5702b78033
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-03.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 3;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-04.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-04.html
new file mode 100644
index 0000000000..b46e8915e1
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-04.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 4;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-05.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-05.html
new file mode 100644
index 0000000000..43caca6c9f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-05.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 5;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-06.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-06.html
new file mode 100644
index 0000000000..e18b69ea5e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-06.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 6;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-07.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-07.html
new file mode 100644
index 0000000000..365890dc90
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-07.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 7;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-08.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-08.html
new file mode 100644
index 0000000000..442cea6bed
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-08.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 8;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-09.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-09.html
new file mode 100644
index 0000000000..4543434e77
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-09.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 9;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-10.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-10.html
new file mode 100644
index 0000000000..dd4827f5f9
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-10.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 10;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-11.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-11.html
new file mode 100644
index 0000000000..93b34b906b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-11.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 11;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-12.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-12.html
new file mode 100644
index 0000000000..e802600741
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-12.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 12;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-13.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-13.html
new file mode 100644
index 0000000000..0606ef5a28
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-13.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 13;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-14.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-14.html
new file mode 100644
index 0000000000..7e33adce4f
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-14.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 14;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-15.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-15.html
new file mode 100644
index 0000000000..46b50679b7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-15.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 15;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-16.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-16.html
new file mode 100644
index 0000000000..881b76b560
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-16.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 16;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-17.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-17.html
new file mode 100644
index 0000000000..9dcb8ae9b8
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/no-over-optimization-on-uniform-array-17.html
@@ -0,0 +1,39 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform array Conformance Tests</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/tests/no-over-optimizations-on-uniform-array.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script>
+"use strict";
+description();
+debug("");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext("example");
+var testIndex = 17;
+var testSet = NoOverOptimizeOnUniformArrayTester.setupTests(gl);
+var testCases = [testSet[testIndex]];
+
+NoOverOptimizeOnUniformArrayTester.runTests(gl, testCases)
+wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html
new file mode 100644
index 0000000000..0c49bdb2f0
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/null-uniform-location.html
@@ -0,0 +1,81 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Tests calling the various uniform[Matrix]* APIs with a null uniform location");
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var program = wtu.loadStandardProgram(gl);
+
+wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+shouldBeUndefined("gl.useProgram(program)");
+var floatArray = new Float32Array([1, 2, 3, 4]);
+var intArray = new Int32Array([1, 2, 3, 4]);
+
+function callUniformFunction(name) {
+ var isArrayVariant = (name.charAt(name.length - 1) == 'v');
+ var isMatrix = (name.indexOf("Matrix") != -1);
+ var isFloat =
+ (name.charAt(name.length - 1) == 'f' ||
+ name.charAt(name.length - 2) == 'f');
+ var sizeIndex = (isArrayVariant ? name.length - 3 : name.length - 2);
+ var size = parseInt(name.substring(sizeIndex, sizeIndex + 1));
+ // Initialize argument list with null uniform location
+ var args = [ null ];
+ if (isArrayVariant) {
+ // Call variant which takes values as array
+ if (isMatrix) {
+ size = size * size;
+ args.push(false);
+ }
+ var array = (isFloat ? new Float32Array(size) : new Int32Array(size));
+ for (var i = 0; i < size; i++) {
+ array[i] = i;
+ }
+ args.push(array);
+ } else {
+ // Call variant which takes values as parameters
+ for (var i = 0; i < size; i++) {
+ args.push(i);
+ }
+ }
+ var func = gl[name];
+ return func.apply(gl, args);
+}
+
+var funcs = [ "uniform1f", "uniform1fv", "uniform1i", "uniform1iv",
+ "uniform2f", "uniform2fv", "uniform2i", "uniform2iv",
+ "uniform3f", "uniform3fv", "uniform3i", "uniform3iv",
+ "uniform4f", "uniform4fv", "uniform4i", "uniform4iv",
+ "uniformMatrix2fv", "uniformMatrix3fv", "uniformMatrix4fv" ];
+var callString;
+
+for (var i = 0; i < funcs.length; i++) {
+ callString = "callUniformFunction('" + funcs[i] + "')";
+ shouldBeUndefined(callString);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR);
+}
+
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html
new file mode 100644
index 0000000000..1defc8ee0e
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/out-of-bounds-uniform-array-access.html
@@ -0,0 +1,168 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL out of bounds uniform array access.</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"> </script>
+</head>
+<body>
+<div id="description"></div>
+<canvas id="example" width="128" height="128" style="background: black;">
+</canvas>
+<div id="console"></div>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec4 v_color;
+uniform float lineWidth;
+uniform int elemMult;
+uniform vec4 colorArray[6];
+void main()
+{
+ vec2 texcoord = vec2(vPosition.xy * 0.5 + vec2(0.5, 0.5));
+ int index = int(texcoord.x + texcoord.y * lineWidth) * elemMult;
+ v_color = colorArray[index];
+ gl_Position = vPosition;
+ gl_PointSize = 1.0;
+}
+</script>
+
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main()
+{
+ gl_FragColor = v_color;
+}
+</script>
+<script>
+"use strict";
+debug("Tests a WebGL program that accesses out of bounds uniform array elements");
+
+var gl;
+var gridRes = 127;
+var lineWidthLoc;
+var elemMultLoc;
+var width = 128;
+var height = 128;
+var pixels = new Uint8Array(width * height * 4);
+
+var lineWidth = 0;
+var elemMult = 0;
+
+var knownColors = [
+ 1.0, 0.0, 0.0, 1.0, // Red
+ 0.0, 1.0, 0.0, 1.0, // Green
+ 0.0, 0.0, 1.0, 1.0, // Blue
+ 0.0, 1.0, 1.0, 1.0, // Cyan
+ 1.0, 0.0, 1.0, 1.0, // Magenta
+ 1.0, 1.0, 0.0, 1.0 // Yellow
+];
+
+function main() {
+ var wtu = WebGLTestUtils;
+ gl = wtu.create3DContext("example");
+ var program = wtu.setupProgram(
+ gl,
+ ['vshader', 'fshader'],
+ ['vPosition'], [0]);
+
+ // setupQuad produces the geometry we want for a gridRes x gridRes grid
+ // of points. No interpolation will be performed across the points, so
+ // according to the WebGL specification for out-of-bounds array accesses,
+ // we will get exactly the input colors from the uniform colorArray, or
+ // zero, for each pixel on the canvas.
+ wtu.setupIndexedQuad(gl, gridRes, 0);
+ var colorArrayLoc = gl.getUniformLocation(program, "colorArray[0]");
+ assertMsg(colorArrayLoc != null, "color array uniform should be found");
+ var colors = new Float32Array(knownColors);
+ gl.uniform4fv(colorArrayLoc, colors);
+ lineWidthLoc = gl.getUniformLocation(program, "lineWidth");
+ elemMultLoc = gl.getUniformLocation(program, "elemMult");
+ assertMsg(gl.getError() == gl.NO_ERROR, "Should be no errors from setup.");
+ runOneIteration();
+}
+
+function withinEpsilon(val1, val2) {
+ return Math.abs(val1 - val2) < 0.0001;
+}
+
+function isKnownColor(r, g, b) {
+ if (r == 0 && g == 0 && b == 0)
+ return true;
+ for (var ii = 0; ii < knownColors.length; ii += 4) {
+ if (withinEpsilon(r / 255.0, knownColors[ii + 0]) &&
+ withinEpsilon(g / 255.0, knownColors[ii + 1]) &&
+ withinEpsilon(b / 255.0, knownColors[ii + 2]))
+ return true;
+ }
+ return false;
+}
+
+function runOneIteration() {
+ if (elemMult < 2048) {
+ var ok = true;
+ var startingLineWidth = lineWidth;
+ var firstFailingPixel = null;
+ var firstFailingValue = null;
+ for (; lineWidth < 2540; lineWidth += 31) {
+ // Draw
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ gl.uniform1f(lineWidthLoc, lineWidth);
+ gl.uniform1i(elemMultLoc, elemMult);
+ gl.drawArrays(gl.POINTS, 0, gridRes * gridRes);
+
+ // Read back
+ gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
+
+ // Verify
+ for (var y = 0; y < height; ++y) {
+ for (var x = 0; x < width; ++x) {
+ if (!isKnownColor(pixels[4 * (width * y + x) + 0],
+ pixels[4 * (width * y + x) + 1],
+ pixels[4 * (width * y + x) + 2])) {
+ ok = false;
+ if (firstFailingPixel == null) {
+ firstFailingPixel = [x, y];
+ firstFailingValue = [pixels[4 * (width * y + x) + 0],
+ pixels[4 * (width * y + x) + 1],
+ pixels[4 * (width * y + x) + 2]];
+ }
+ }
+ }
+ }
+ }
+ var endingLineWidth = lineWidth - 31;
+ lineWidth -= 2540;
+ if (ok) {
+ testPassed("Good rendering results for lineWidths " +
+ startingLineWidth + "..." + endingLineWidth +
+ " at elemMult=" + elemMult);
+ } else {
+ testFailed("for lineWidth=" + lineWidth + ", elemMult=" + elemMult +
+ ": first failing pixel (" + firstFailingPixel[0] + ", " + firstFailingPixel[1] + ") was (" +
+ firstFailingValue[0] + ", " +
+ firstFailingValue[1] + ", " +
+ firstFailingValue[2] + "), should be (0, 0, 0) or one of known colors");
+ }
+ elemMult += 73;
+ setTimeout(runOneIteration, 0);
+ } else {
+ finishTest();
+ }
+}
+
+main();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html
new file mode 100644
index 0000000000..862182c272
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-default-values.html
@@ -0,0 +1,339 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform default values</title>
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+<script src="../../js/test-eval.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<canvas id="example" width="2" height="2"> </canvas>
+<script id="vshader0" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="fshader0" type="x-shader/x-fragment">
+precision mediump float;
+uniform $(type) u_uniform;
+
+bool isZero($(type) value) {
+ $(check);
+}
+
+void main()
+{
+ gl_FragColor = isZero(u_uniform) ? vec4(0,1,0,1) : vec4(1,0,0,1);
+}
+</script>
+<script id="vshader1" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec4 v_color;
+uniform $(type) u_uniform;
+
+bool isZero($(type) value) {
+ $(check);
+}
+
+void main()
+{
+ gl_Position = vPosition;
+ v_color = isZero(u_uniform) ? vec4(0,1,0,1) : vec4(1,0,0,1);
+}
+</script>
+<script id="fshader1" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main()
+{
+ gl_FragColor = v_color;
+}
+</script>
+<script id="vshader2" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+void main()
+{
+ gl_Position = vPosition;
+}
+</script>
+<script id="fshader2" type="x-shader/x-fragment">
+precision mediump float;
+uniform $(type) u_uniform[2];
+
+bool isZero($(type) value) {
+ $(check);
+}
+
+void main()
+{
+ gl_FragColor = isZero(u_uniform[1]) ? vec4(0,1,0,1) : vec4(1,0,0,1);
+}
+</script>
+<script id="vshader3" type="x-shader/x-vertex">
+attribute vec4 vPosition;
+varying vec4 v_color;
+uniform $(type) u_uniform[2];
+
+bool isZero($(type) value) {
+ $(check);
+}
+
+void main()
+{
+ gl_Position = vPosition;
+ v_color = isZero(u_uniform[1]) ? vec4(0,1,0,1) : vec4(1,0,0,1);
+}
+</script>
+<script id="fshader3" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main()
+{
+ gl_FragColor = v_color;
+}
+</script>
+<script>
+"use strict";
+description();
+
+var tests = [
+{ type: 'float',
+ check: "return value == 0.0",
+ setFn: function(gl, loc) { gl.uniform1f(loc, 3.0); }
+},
+{ type: 'int',
+ check: "return value == 0",
+ setFn: function(gl, loc) { gl.uniform1i(loc, 3.0); }
+},
+{ type: 'bool',
+ check: "return value == false",
+ setFn: function(gl, loc) { gl.uniform1i(loc, 1); }
+},
+{ type: 'vec2',
+ check: "return value[0] == 0.0 && value[1] == 0.0",
+ setFn: function(gl, loc) { gl.uniform2f(loc, 3.0, 3.0); }
+},
+{ type: 'vec3',
+ check: "return value[0] == 0.0 && value[1] == 0.0 && value[2] == 0.0",
+ setFn: function(gl, loc) { gl.uniform3f(loc, 3.0, 3.0, 3.0); }
+},
+{ type: 'vec4',
+ check: "return value[0] == 0.0 && value[1] == 0.0 && value[2] == 0.0 && value[3] == 0.0",
+ setFn: function(gl, loc) { gl.uniform4f(loc, 3.0, 3.0, 3.0, 3.0); }
+},
+{ type: 'ivec2',
+ check: "return value[0] == 0 && value[1] == 0",
+ setFn: function(gl, loc) { gl.uniform2i(loc, 3, 3); }
+},
+{ type: 'ivec3',
+ check: "return value[0] == 0 && value[1] == 0 && value[2] == 0",
+ setFn: function(gl, loc) { gl.uniform3i(loc, 3, 3, 3); }
+},
+{ type: 'ivec4',
+ check: "return value[0] == 0 && value[1] == 0 && value[2] == 0 && value[3] == 0",
+ setFn: function(gl, loc) { gl.uniform4i(loc, 3, 3, 3, 3); }
+},
+{ type: 'bvec2',
+ check: "return value[0] == false && value[1] == false",
+ setFn: function(gl, loc) { gl.uniform2i(loc, 1, 1); }
+},
+{ type: 'bvec3',
+ check: "return value[0] == false && value[1] == false && value[2] == false",
+ setFn: function(gl, loc) { gl.uniform3i(loc, 1, 1, 1); }
+},
+{ type: 'bvec4',
+ check: "return value[0] == false && value[1] == false && value[2] == false && value[3] == false",
+ setFn: function(gl, loc) { gl.uniform4i(loc, 1, 1, 1, 1); }
+},
+{ type: 'mat2',
+ check:
+ "return " +
+ "value[0][0] == 0.0 && value[0][1] == 0.0 && " +
+ "value[1][0] == 0.0 && value[1][0] == 0.0",
+ valueCheck:
+ "return " +
+ "value[0] == 0.0 && value[1] == 0.0 && " +
+ "value[2] == 0.0 && value[3] == 0.0",
+ setFn: function(gl, loc) { gl.uniformMatrix2fv(loc, false, [1, 1, 1, 1]); }
+},
+{ type: 'mat3',
+ check:
+ "return " +
+ "value[0][0] == 0.0 && value[1][0] == 0.0 && value[2][0] == 0.0 && " +
+ "value[0][1] == 0.0 && value[1][1] == 0.0 && value[2][1] == 0.0 && " +
+ "value[0][2] == 0.0 && value[1][2] == 0.0 && value[2][2] == 0.0",
+ valueCheck:
+ "return " +
+ "value[0] == 0.0 && value[1] == 0.0 && value[2] == 0.0 && " +
+ "value[3] == 0.0 && value[4] == 0.0 && value[5] == 0.0 && " +
+ "value[6] == 0.0 && value[7] == 0.0 && value[8] == 0.0",
+ setFn: function(gl, loc) { gl.uniformMatrix3fv(loc, false, [1, 1, 1, 1, 1, 1, 1, 1, 1]); }
+},
+{ type: 'mat4',
+ check:
+ "return " +
+ "value[0][0] == 0.0 && value[1][0] == 0.0 && value[2][0] == 0.0 && value[3][0] == 0.0 && " +
+ "value[0][1] == 0.0 && value[1][1] == 0.0 && value[2][1] == 0.0 && value[3][1] == 0.0 && " +
+ "value[0][2] == 0.0 && value[1][2] == 0.0 && value[2][2] == 0.0 && value[3][2] == 0.0 && " +
+ "value[0][3] == 0.0 && value[1][3] == 0.0 && value[2][3] == 0.0 && value[3][3] == 0.0",
+ valueCheck:
+ "return " +
+ "value[ 0] == 0.0 && value[ 1] == 0.0 && value[ 2] == 0.0 && value[ 3] == 0.0 && " +
+ "value[ 4] == 0.0 && value[ 5] == 0.0 && value[ 6] == 0.0 && value[ 7] == 0.0 && " +
+ "value[ 8] == 0.0 && value[ 9] == 0.0 && value[10] == 0.0 && value[11] == 0.0 && " +
+ "value[12] == 0.0 && value[13] == 0.0 && value[14] == 0.0 && value[15] == 0.0",
+ setFn: function(gl, loc) { gl.uniformMatrix4fv(loc, false, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]); }
+},
+{ type: 'sampler2D',
+ check:
+ "vec4 v = texture2D(value, vec2(0, 0));" +
+ "return v.x == 1.0 && v.y == 1.0 && v.z == 1.0 && v.w == 1.0",
+ valueCheck:
+ "return value == 0",
+ setFn: function(gl, loc) { gl.uniform1i(loc, 1); }
+},
+{ type: 'samplerCube',
+ check:
+ "vec4 v = textureCube(value, vec3(0, 0, 0));" +
+ "return v.x == 1.0 && v.y == 1.0 && v.z == 1.0 && v.w == 1.0",
+ valueCheck:
+ "return value == 0",
+ setFn: function(gl, loc) { gl.uniform1i(loc, 1); }
+},
+];
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+var c = document.getElementById("console");
+var checkFn;
+
+wtu.setupUnitQuad(gl, [0, 1]);
+
+// Set unit 0 to a non-0 texture.
+var haveVertexTextureImageUnits =
+ gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS) >= 2;
+var tex2D = gl.createTexture();
+var texCube = gl.createTexture();
+gl.bindTexture(gl.TEXTURE_2D, tex2D);
+gl.bindTexture(gl.TEXTURE_CUBE_MAP, texCube);
+
+var pixel = new Uint8Array([255, 255, 255, 255]);
+var targets = [
+ gl.TEXTURE_2D,
+ 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 ii = 0; ii < targets.length; ++ii) {
+ gl.texImage2D(
+ targets[ii], 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
+}
+
+var shaderTemplates = [
+{ vs: "vshader0", fs: "fshader0", type: 'f' },
+{ vs: "vshader1", fs: "fshader1", type: 'v' },
+{ vs: "vshader2", fs: "fshader2", type: 'f' },
+{ vs: "vshader3", fs: "fshader3", type: 'v' },
+];
+
+// Get shader templates
+for (var ii = 0; ii < shaderTemplates.length; ++ii) {
+ var template = shaderTemplates[ii];
+ template.vs = wtu.getScript(template.vs);
+ template.fs = wtu.getScript(template.fs);
+}
+
+function testType(test) {
+ debug("");
+ debug("testing: " + test.type);
+
+ for (var ii = 0; ii < shaderTemplates.length; ++ii) {
+ var template = shaderTemplates[ii];
+
+ if (test.type.substring(0, 7) == "sampler" &&
+ template.type == 'v' &&
+ !haveVertexTextureImageUnits) {
+ continue;
+ }
+
+ var vs = wtu.replaceParams(template.vs, test);
+ var fs = wtu.replaceParams(template.fs, test);
+
+ wtu.addShaderSource(c, "vertex shader", vs);
+ wtu.addShaderSource(c, "fragment shader", fs);
+
+ var vs = wtu.loadShader(gl, vs, gl.VERTEX_SHADER);
+ var fs = wtu.loadShader(gl, fs, gl.FRAGMENT_SHADER);
+ var program = wtu.createProgram(gl, vs, fs);
+
+ gl.useProgram(program);
+
+ var loc = gl.getUniformLocation(program, "u_uniform[1]");
+ if (!loc) {
+ var loc = gl.getUniformLocation(program, "u_uniform");
+ }
+
+ var value = gl.getUniform(program, loc);
+ TestEval("checkFn = function(value) {" + (test.valueCheck ? test.valueCheck : test.check) + ";}");
+ if (checkFn(value)) {
+ testPassed("uniform is zero");
+ } else {
+ testFailed("uniform is not zero");
+ }
+
+ debug("default value should be zero");
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0);
+
+ debug("test test by setting value");
+ test.setFn(gl, loc);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red", 0);
+
+ debug("re-linking should reset to defaults");
+ gl.linkProgram(program);
+
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, [0, 255, 0, 255], "should be green", 0);
+
+ gl.deleteProgram(program);
+ gl.deleteShader(vs);
+ gl.deleteShader(fs);
+
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no GL errors");
+ }
+}
+
+var testNdx = 0;
+function runNextTest() {
+ testType(tests[testNdx++]);
+ if (testNdx >= tests.length) {
+ finishTest();
+ } else {
+ setTimeout(runNextTest, 0);
+ }
+}
+
+runNextTest();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html
new file mode 100644
index 0000000000..3b1c185caf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-location.html
@@ -0,0 +1,96 @@
+<!--
+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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../resources/js-test-style.css"/>
+<script src="../../js/js-test-pre.js"></script>
+<script src="../../js/webgl-test-utils.js"></script>
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+description("Tests the WebGLUniformLocation API");
+
+var wtu = WebGLTestUtils;
+var contextA = wtu.create3DContext();
+var contextB = wtu.create3DContext();
+var programA1 = wtu.loadStandardProgram(contextA);
+var programA2 = wtu.loadStandardProgram(contextA);
+var programB = wtu.loadStandardProgram(contextB);
+var programS = wtu.loadProgramFromFile(contextA, "../../resources/structUniformShader.vert", "../../resources/fragmentShader.frag");
+var programV = wtu.loadProgramFromFile(contextA, "../../resources/floatUniformShader.vert", "../../resources/noopUniformShader.frag");
+var locationA = contextA.getUniformLocation(programA1, 'u_modelViewProjMatrix');
+var locationB = contextB.getUniformLocation(programB, 'u_modelViewProjMatrix');
+var locationSx = contextA.getUniformLocation(programS, "u_struct.x");
+var locationSx2;
+var locationArray0 = contextA.getUniformLocation(programS, "u_array[0]");
+var locationArray1 = contextA.getUniformLocation(programS, "u_array[1]");
+var locationVec4 = contextA.getUniformLocation(programV, "fval4");
+
+var vec = [1, 2, 3, 4];
+var mat = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
+
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programA2)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix4fv(locationA, false, mat)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programA1)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniformMatrix4fv(locationA, false, mat)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniformMatrix4fv(null, false, mat)");
+
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programS)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1i(locationSx, 333)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1f(locationArray0, 4.0)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1f(locationArray1, 5.0)");
+
+shouldBe("contextA.getUniform(programS, locationSx)", "333");
+shouldBe("contextA.getUniform(programS, locationArray0)", "4.0");
+shouldBe("contextA.getUniform(programS, locationArray1)", "5.0");
+
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programV)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform4fv(locationVec4, vec)");
+shouldBe("contextA.getUniform(programV, locationVec4)", "vec");
+
+shouldBeNull("contextA.getUniformLocation(programV, \"IDontExist\")");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.linkProgram(programA1)");
+// After linking all boxes are bad.
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniformMatrix4fv(locationA, false, mat)");
+
+// after re-linking the same program, all uniform locations become invalid.
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.useProgram(programS)");
+contextA.stencilMask(1);
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.linkProgram(programS)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.uniform1i(locationSx, 3)");
+wtu.shouldGenerateGLError(contextA, contextA.INVALID_OPERATION, "contextA.getUniform(programS, locationSx)");
+
+// Retrieve the locations again, and they should be good.
+locationSx = contextA.getUniformLocation(programS, "u_struct.x");
+locationArray0 = contextA.getUniformLocation(programS, "u_array[0]");
+debug("here");
+contextA.stencilMask(0);
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1i(locationSx, 3)");
+wtu.shouldGenerateGLError(contextA, contextA.NO_ERROR, "contextA.uniform1f(locationArray0, 123)");
+shouldBe("contextA.getUniform(programS, locationSx)", "3");
+shouldBe("contextA.getUniform(programS, locationArray0)", "123");
+
+// getUniformLocation should return a different object everytime, should not cache and return the same object
+debug("Testing that getUniformLocation returns a different object everytime");
+locationSx = contextA.getUniformLocation(programS, "u_struct.x");
+locationSx2 = contextA.getUniformLocation(programS, "u_struct.x");
+shouldBeFalse("locationSx === locationSx2");
+locationSx.foo = {};
+locationSx2.foo = {};
+shouldBeFalse("locationSx.foo === locationSx2.foo");
+
+var successfullyParsed = true;
+</script>
+
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html
new file mode 100644
index 0000000000..fc680c0eaa
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-samplers-test.html
@@ -0,0 +1,111 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL sampler uniforms conformance 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>
+</head>
+<body>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+
+<script>
+"use strict";
+function init()
+{
+ description(
+ "Tests that only Uniform1i and Uniform1iv can be used to set" +
+ "sampler uniforms.");
+
+ var canvas2d = document.getElementById("canvas2d");
+
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ var program = wtu.setupTexturedQuad(gl);
+
+ var textureLoc = gl.getUniformLocation(program, "tex");
+
+ gl.uniform1i(textureLoc, 1);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "uniform1i can set a sampler uniform");
+ gl.uniform1iv(textureLoc, [1]);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR,
+ "uniform1iv can set a sampler uniform");
+ gl.uniform1f(textureLoc, 1);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "uniform1f returns INVALID_OPERATION if attempting to set a sampler uniform");
+ gl.uniform1fv(textureLoc, [1]);
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION,
+ "uniform1fv returns INVALID_OPERATION if attempting to set a sampler uniform");
+
+ var maxTextureUnits = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+
+ var testUniformi = function() {
+ var success = true;
+ for (var ii = 0; ii < maxTextureUnits; ++ii) {
+ gl.uniform1i(textureLoc, ii);
+ success = success && (gl.getError() == gl.NO_ERROR);
+ }
+ expectTrue(success, "uniform1i works for any valid texture unit");
+ };
+
+ var testUniformiv = function() {
+ var success = true;
+ for (var ii = 0; ii < maxTextureUnits; ++ii) {
+ gl.uniform1iv(textureLoc, [ii]);
+ success = success && (gl.getError() == gl.NO_ERROR);
+ }
+ expectTrue(success, "uniform1iv works for any valid texture unit");
+ };
+
+ var steps = [
+ testUniformi,
+ testUniformiv,
+ ];
+
+ var generateInvalidUniformiTests = function(start, end) {
+ return function() {
+ var success = true;
+ for (var ii = start; ii < end; ++ii) {
+ gl.uniform1i(textureLoc, ii);
+ success = success && (gl.getError() == gl.INVALID_VALUE);
+ }
+ expectTrue(success, "uniform1i generates INVALID_VALUE for invalid texture units 0x" + start.toString(16) + " to 0x" + end.toString(16));
+ };
+ };
+
+ var generateInvalidUniformivTests = function(start, end) {
+ return function() {
+ var success = true;
+ for (var ii = start; ii < end; ++ii) {
+ gl.uniform1iv(textureLoc, [ii]);
+ success = success && (gl.getError() == gl.INVALID_VALUE);
+ }
+ expectTrue(success, "uniform1iv generates INVALID_VALUE for invalid texture units 0x" + start.toString(16) + " to 0x" + end.toString(16));
+ };
+ };
+
+ var step = 0x1000;
+ for (var ii = maxTextureUnits; ii < 0x10000; ii += step) {
+ steps.push(generateInvalidUniformiTests(ii, ii + step));
+ steps.push(generateInvalidUniformivTests(ii, ii + step));
+ }
+
+ steps.push(finishTest);
+ wtu.runSteps(steps);
+}
+
+init();
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html
new file mode 100644
index 0000000000..6ff693f347
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/uniforms/uniform-values-per-program.html
@@ -0,0 +1,179 @@
+<!--
+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.
+-->
+
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL uniform values are per program conformance 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>
+</head>
+<body>
+<script id="vshader" type="x-shader/x-vertex">
+attribute vec4 a_position;
+void main() {
+ gl_Position = a_position;
+}
+</script>
+<script id="fshader" type="x-shader/x-fragment">
+precision mediump float;
+varying vec4 v_color;
+void main() {
+ gl_FragColor = v_color;
+}
+</script>
+<script id="vshaderTest" type="x-shader/x-vertex">
+attribute vec4 a_position;
+uniform $(type) $(name1);
+uniform $(type) $(name2);
+uniform bool u_select;
+varying vec4 v_color;
+void main() {
+ $(type) value = u_select ? $(name2) : $(name1);
+ v_color = $(conversion);
+ gl_Position = a_position;
+}
+</script>
+<script id="fshaderTest" type="x-shader/x-fragment">
+precision mediump float;
+uniform $(type) $(name1);
+uniform $(type) $(name2);
+uniform bool u_select;
+void main() {
+ $(type) value = u_select ? $(name2) : $(name1);
+ gl_FragColor = $(conversion);
+}
+</script>
+<canvas id="example" width="2" height="2" style="width: 40px; height: 40px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+<script>
+"use strict";
+function init() {
+ description();
+
+ var console = document.getElementById("console");
+ var wtu = WebGLTestUtils;
+ var gl = wtu.create3DContext("example");
+ wtu.setupUnitQuad(gl);
+ var vtemplate = wtu.getScript("vshader");
+ var ftemplate = wtu.getScript("fshader");
+ var vtemplateTest = wtu.getScript("vshaderTest");
+ var ftemplateTest = wtu.getScript("fshaderTest");
+
+ var shaders = [
+ [vtemplate, ftemplateTest],
+ [vtemplateTest, ftemplate],
+ ];
+
+ var names = [
+ ["u_value1", "u_value2"],
+ ["a", "b"],
+ ["x", "y"],
+ ["y", "z"],
+ ["y", "u"],
+ ["a00000", "a00001"],
+ ];
+ var testList = [
+ { type: "float",
+ conversion: "vec4(value, 0, 0, 0)",
+ values: [[64], [128]],
+ func: 'uniform1fv',
+ },
+ { type: "vec2",
+ conversion: "vec4(value, 0, 0)",
+ values: [[64, 128], [128, 64]],
+ func: 'uniform2fv',
+ },
+ { type: "vec3",
+ conversion: "vec4(value, 0)",
+ values: [[64, 128, 192], [192, 128, 64]],
+ func: 'uniform3fv',
+ },
+ { type: "vec4",
+ conversion: "vec4(value)",
+ values: [[64, 128, 192, 255], [255, 192, 128, 64]],
+ func: 'uniform4fv',
+ },
+ ];
+
+ var clone = function(obj) {
+ var n = { };
+ for (var $key in obj) {
+ n[$key] = obj[$key];
+ }
+ return n;
+ };
+
+ var tests = [];
+ names.forEach(function(namePair) {
+ testList.forEach(function(test) {
+ var t = clone(test);
+ t.name1 = namePair[0];
+ t.name2 = namePair[1];
+ tests.push(t);
+ });
+ });
+
+ var runTest = function(test) {
+ debug("");
+ debug("testing: " + test.type);
+ shaders.forEach(function(shaderPair) {
+ var progs = [];
+ for (var ii = 0; ii < 2; ++ii) {
+ var vsource = wtu.replaceParams(shaderPair[0], test);
+ var fsource = wtu.replaceParams(shaderPair[1], test);
+ if (!ii) {
+ wtu.addShaderSource(console, "vertex shader: type = " + test.type + " with names " + test.name1 + ", " + test.name2, vsource);
+ wtu.addShaderSource(console, "fragment shader: type = " + test.type + " with names " + test.name1 + ", " + test.name2, fsource);
+ }
+ var program = wtu.setupProgram(gl, [vsource, fsource], ["a_position"]);
+ var info = {
+ program: program,
+ valueLocs: [gl.getUniformLocation(program, test.name1),
+ gl.getUniformLocation(program, test.name2)],
+ selectLoc: gl.getUniformLocation(program, "u_select"),
+ };
+ var v1 = test.values[0];
+ var v2 = test.values[1];
+ if (ii) {
+ var t = v1;
+ v1 = v2;
+ v2 = t;
+ }
+ info.expect = [v1, v2];
+ for (var jj = 0; jj < 2; ++jj) {
+ var input = info.expect[jj].map(function(v) { return v / 255; });
+ gl[test.func](info.valueLocs[jj], input);
+ }
+ progs.push(info);
+ }
+ for (var ii = 0; ii < 2; ++ii) {
+ progs.forEach(function(info) {
+ gl.useProgram(info.program);
+ gl.uniform1i(info.selectLoc, ii);
+ wtu.clearAndDrawUnitQuad(gl);
+ wtu.checkCanvas(gl, info.expect[ii], undefined, 1);
+ });
+ }
+ progs.forEach(function(info) {
+ gl.deleteProgram(info.program);
+ });
+ });
+ }
+ tests.forEach(function(test){
+ runTest(test);
+ });
+}
+init();
+var successfullyParsed = true;
+</script>
+<script src="../../js/js-test-post.js"></script>
+</body>
+</html>
+