Diff
Modified: trunk/LayoutTests/ChangeLog (288614 => 288615)
--- trunk/LayoutTests/ChangeLog 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/ChangeLog 2022-01-26 14:11:03 UTC (rev 288615)
@@ -1,5 +1,63 @@
2022-01-26 Kimmo Kinnunen <[email protected]>
+ WebGL conformance tests that are pending upstreaming should not duplicate unmodified files
+ https://bugs.webkit.org/show_bug.cgi?id=235631
+
+ Reviewed by Antti Koivisto.
+
+ Duplicating the unmodified files keeps the pending tests somewhat isolated from the
+ upstream test updates. However, this is not feasible as the tests refer to bigger files
+ that are inconvenient to duplicate, such as videos. Also this makes it harder to write new tests,
+ since if the new pending test starts to use a file, the file would need duplication.
+ Also if the upstream has modified the shared files, the change done to the pending test needs
+ to be done anyway.
+
+ It is more consistent to use the same helper media, js and css resources for the pending tests
+ as the conformance test suite snapshot uses.
+
+ Remove all unmodified helper css and js files from the pending test directory and
+ use the unmodified files from the actual test files.
+
+ WebGL conformance tests are:
+ webgl/2.0.y/ -- autogenerated driver html files referencing the actual test suite test files
+ webgl/resources/webgl_test_files -- the actual test suite files
+
+ Move the pending tests similarly:
+ webgl/pending -- drivers
+ webgl/pending/resources/webgl_test_files -- old pending actual test files
+ webgl/resources/pending_webgl_test_files -- new pending actual test files
+
+ This way it is easier to refer to the resources from the actual test files.
+
+ * webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt:
+ * webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias.html:
+ * webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2-expected.txt:
+ * webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2.html:
+ * webgl/pending/conformance/glsl/misc/swizzle-as-lvalue-expected.txt:
+ * webgl/pending/conformance/glsl/misc/swizzle-as-lvalue.html:
+ * webgl/pending/conformance/textures/misc/tex-image-video-repeated-expected.txt:
+ * webgl/pending/conformance/textures/misc/tex-image-video-repeated.html:
+ * webgl/pending/conformance2/glsl3/empty-shader-with-output-expected.txt:
+ * webgl/pending/conformance2/glsl3/empty-shader-with-output.html:
+ * webgl/pending/conformance2/glsl3/float-constant-expressions-expected.txt:
+ * webgl/pending/conformance2/glsl3/float-constant-expressions.html:
+ * webgl/pending/resources/js-test-pre.js: Removed.
+ * webgl/pending/resources/webgl_test_files/js/glsl-conformance-test.js: Removed.
+ * webgl/pending/resources/webgl_test_files/js/js-test-post.js: Removed.
+ * webgl/pending/resources/webgl_test_files/js/js-test-pre.js: Removed.
+ * webgl/pending/resources/webgl_test_files/js/webgl-test-utils.js: Removed.
+ * webgl/pending/resources/webgl_test_files/resources/glsl-feature-tests.css: Removed.
+ * webgl/pending/resources/webgl_test_files/resources/js-test-style.css: Removed.
+ * webgl/pending/resources/webkit-webgl-test-harness.js: Removed.
+ * webgl/resources/pending_webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html: Renamed from LayoutTests/webgl/pending/resources/webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html.
+ * webgl/resources/pending_webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html: Renamed from LayoutTests/webgl/pending/resources/webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html.
+ * webgl/resources/pending_webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html: Renamed from LayoutTests/webgl/pending/resources/webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html.
+ * webgl/resources/pending_webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html: Renamed from LayoutTests/webgl/pending/resources/webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html.
+ * webgl/resources/pending_webgl_test_files/conformance2/glsl3/empty-shader-with-output.html: Renamed from LayoutTests/webgl/pending/resources/webgl_test_files/conformance2/glsl3/empty-shader-with-output.html.
+ * webgl/resources/pending_webgl_test_files/conformance2/glsl3/float-constant-expressions.html: Renamed from LayoutTests/webgl/pending/resources/webgl_test_files/conformance2/glsl3/float-constant-expressions.html.
+
+2022-01-26 Kimmo Kinnunen <[email protected]>
+
Streams tests try to call ReadableStream.prototype.pipeThrough.call generically
https://bugs.webkit.org/show_bug.cgi?id=235560
Modified: trunk/LayoutTests/webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt 2022-01-26 14:11:03 UTC (rev 288615)
@@ -1,4 +1,4 @@
This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
-Test: ../../resources/webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html?webglVersion=2
+Test: ../../../resources/pending_webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html?webglVersion=2
[ PASS ] All tests passed
Modified: trunk/LayoutTests/webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias.html (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias.html 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/context/context-attributes-alpha-depth-stencil-antialias.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -4,14 +4,14 @@
<head>
<meta charset="utf-8">
<title>WebGL Conformance Test Wrapper for context-attributes-alpha-depth-stencil-antialias.html</title>
-<script type="text/_javascript_" src=""
-<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
</head>
<body>
<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
-Test: <a href=""
+Test: <a href=""
<div id="iframe">
-<iframe src="" width="800" height="600"></iframe>
+<iframe src="" width="800" height="600"></iframe>
</div>
<div id="result"></div>
</body>
Modified: trunk/LayoutTests/webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2-expected.txt (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2-expected.txt 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2-expected.txt 2022-01-26 14:11:03 UTC (rev 288615)
@@ -1,4 +1,4 @@
This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
-Test: ../../../resources/webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html?webglVersion=2
+Test: ../../../../resources/pending_webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html?webglVersion=2
[ PASS ] All tests passed
Modified: trunk/LayoutTests/webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2.html (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2.html 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/glsl/misc/shader-with-reserved-words-2.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -4,14 +4,14 @@
<head>
<meta charset="utf-8">
<title>WebGL Conformance Test Wrapper for shader-with-reserved-words-2.html</title>
-<script type="text/_javascript_" src=""
-<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
</head>
<body>
<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
-Test: <a href=""
+Test: <a href=""
<div id="iframe">
-<iframe src="" width="800" height="600"></iframe>
+<iframe src="" width="800" height="600"></iframe>
</div>
<div id="result"></div>
</body>
Modified: trunk/LayoutTests/webgl/pending/conformance/glsl/misc/swizzle-as-lvalue-expected.txt (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/glsl/misc/swizzle-as-lvalue-expected.txt 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/glsl/misc/swizzle-as-lvalue-expected.txt 2022-01-26 14:11:03 UTC (rev 288615)
@@ -1,5 +1,5 @@
This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
-Test: ../../../resources/webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html
+Test: ../../../../resources/pending_webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html
Modified: trunk/LayoutTests/webgl/pending/conformance/glsl/misc/swizzle-as-lvalue.html (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/glsl/misc/swizzle-as-lvalue.html 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/glsl/misc/swizzle-as-lvalue.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -9,9 +9,9 @@
</head>
<body>
<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
-Test: <a href=""
+Test: <a href=""
<div id="iframe">
-<iframe src="" width="800" height="600"></iframe>
+<iframe src="" width="800" height="600"></iframe>
</div>
<div id="result"></div>
</body>
Modified: trunk/LayoutTests/webgl/pending/conformance/textures/misc/tex-image-video-repeated-expected.txt (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/textures/misc/tex-image-video-repeated-expected.txt 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/textures/misc/tex-image-video-repeated-expected.txt 2022-01-26 14:11:03 UTC (rev 288615)
@@ -1,4 +1,4 @@
This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
-Test: ../../../resources/webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html
+Test: ../../../../resources/pending_webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html
[ PASS ] All tests passed
Modified: trunk/LayoutTests/webgl/pending/conformance/textures/misc/tex-image-video-repeated.html (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance/textures/misc/tex-image-video-repeated.html 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance/textures/misc/tex-image-video-repeated.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -4,14 +4,14 @@
<head>
<meta charset="utf-8">
<title>WebGL Conformance Test Wrapper for context-attributes-alpha-depth-stencil-antialias.html</title>
-<script type="text/_javascript_" src=""
-<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
</head>
<body>
<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
-Test: <a href=""
+Test: <a href=""
<div id="iframe">
-<iframe src="" width="800" height="600"></iframe>
+<iframe src="" width="800" height="600"></iframe>
</div>
<div id="result"></div>
</body>
Modified: trunk/LayoutTests/webgl/pending/conformance2/glsl3/empty-shader-with-output-expected.txt (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance2/glsl3/empty-shader-with-output-expected.txt 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance2/glsl3/empty-shader-with-output-expected.txt 2022-01-26 14:11:03 UTC (rev 288615)
@@ -1,4 +1,4 @@
This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
-Test: ../../resources/webgl_test_files/conformance2/glsl3/empty-shader-with-output.html?webglVersion=2
+Test: ../../../resources/pending_webgl_test_files/conformance2/glsl3/empty-shader-with-output.html?webglVersion=2
[ PASS ] All tests passed
Modified: trunk/LayoutTests/webgl/pending/conformance2/glsl3/empty-shader-with-output.html (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance2/glsl3/empty-shader-with-output.html 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance2/glsl3/empty-shader-with-output.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -4,14 +4,15 @@
<head>
<meta charset="utf-8">
<title>WebGL Conformance Test Wrapper for empty-shader-with-output.html</title>
-<script type="text/_javascript_" src=""
-<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
</head>
<body>
<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
-Test: <a href=""
+Test: <a href=""
<div id="iframe">
-<iframe src="" width="800" height="600"></iframe>
+<iframe src="" width="800" height="600"></iframe>
+<iframe src="" width="800" height="600"></iframe>
</div>
<div id="result"></div>
</body>
Modified: trunk/LayoutTests/webgl/pending/conformance2/glsl3/float-constant-expressions-expected.txt (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance2/glsl3/float-constant-expressions-expected.txt 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance2/glsl3/float-constant-expressions-expected.txt 2022-01-26 14:11:03 UTC (rev 288615)
@@ -1,4 +1,4 @@
This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.
-Test: ../../resources/webgl_test_files/conformance2/glsl3/float-constant-expressions.html?webglVersion=2
+Test: ../../../resources/pending_webgl_test_files/conformance2/glsl3/float-constant-expressions.html?webglVersion=2
[ PASS ] All tests passed
Modified: trunk/LayoutTests/webgl/pending/conformance2/glsl3/float-constant-expressions.html (288614 => 288615)
--- trunk/LayoutTests/webgl/pending/conformance2/glsl3/float-constant-expressions.html 2022-01-26 12:56:20 UTC (rev 288614)
+++ trunk/LayoutTests/webgl/pending/conformance2/glsl3/float-constant-expressions.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -4,14 +4,14 @@
<head>
<meta charset="utf-8">
<title>WebGL Conformance Test Wrapper for float-constant-expressions.html</title>
-<script type="text/_javascript_" src=""
-<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
+<script type="text/_javascript_" src=""
</head>
<body>
<p>This test runs the WebGL Test listed below in an iframe and reports PASS or FAIL.</p>
-Test: <a href=""
+Test: <a href=""
<div id="iframe">
-<iframe src="" width="800" height="600"></iframe>
+<iframe src="" width="800" height="600"></iframe>
</div>
<div id="result"></div>
</body>
Copied: trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html (from rev 288614, trunk/LayoutTests/webgl/pending/resources/webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html) (0 => 288615)
--- trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html (rev 0)
+++ trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/context/context-attributes-alpha-depth-stencil-antialias.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -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">
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<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;
+
+function init()
+{
+ description('Verify WebGLContextAttributes are working as specified, including alpha, depth, stencil, antialias, but not premultipliedAlpha');
+
+ runTest();
+}
+
+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);
+ 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);
+ wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
+
+ return gl;
+}
+
+function drawAndReadPixel(gl, vertices, colors)
+{
+ 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.TRIANGLES, 0, vertices.length / 3);
+}
+
+function testDefault()
+{
+ debug("Testing default attributes: { stencil:false }");
+ shouldBeNonNull("gl = getWebGL(1, 1, null, [ 0, 0, 0, 0 ], 1, 0)");
+ shouldBeFalse("gl.getContextAttributes().stencil");
+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) == 0");
+}
+
+function testAlpha(alpha)
+{
+ debug("Testing alpha = " + alpha);
+ if (alpha) {
+ shouldBeNonNull("gl = getWebGL(1, 1, { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
+ shouldBeTrue("gl.getParameter(gl.ALPHA_BITS) >= 8");
+ } else {
+ shouldBeNonNull("gl = getWebGL(1, 1, { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
+ shouldBeTrue("gl.getParameter(gl.ALPHA_BITS) == 0");
+ }
+ shouldBeTrue("gl.getParameter(gl.RED_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.GREEN_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.BLUE_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) == 0");
+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) == 0");
+
+ shouldBeNonNull("contextAttribs = gl.getContextAttributes()");
+ shouldBeTrue("contextAttribs.alpha == " + alpha);
+
+ var correctColor = (contextAttribs.alpha ? [0, 0, 0, 0] : [0, 0, 0, 255]);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, correctColor);
+
+ if (fbHasColor) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.clearColor(0.5, 0.5, 0.5, 0.5);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [127, 127, 127, 127], undefined, 1);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ }
+}
+
+function testDepth(depth)
+{
+ debug("Testing depth = " + depth);
+ if (depth) {
+ shouldBeNonNull("gl = getWebGL(1, 1, { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) >= 16");
+ } else {
+ shouldBeNonNull("gl = getWebGL(1, 1, { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) == 0");
+ }
+ shouldBeTrue("gl.getParameter(gl.RED_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.GREEN_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.BLUE_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.ALPHA_BITS) >= 8");
+
+ shouldBeNonNull("contextAttribs = gl.getContextAttributes()");
+
+ gl.depthFunc(gl.NEVER);
+
+ 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]);
+
+ drawAndReadPixel(gl, vertices, colors, 0, 0);
+ correctColor = (contextAttribs.depth ? [0, 0, 0, 255] : [255, 0, 0, 255]);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, correctColor);
+
+ if (fbHasDepth) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ drawAndReadPixel(gl, vertices, colors, 0, 0);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 255]);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ }
+}
+
+function testStencilAndDepth(stencil, depth)
+{
+ debug("Testing stencil = " + stencil + ", depth = " + depth);
+ var creationString =
+ "gl = getWebGL(1, 1, { depth: " + depth + ", stencil: " + stencil + ", antialias: false }, [ 0, 0, 0, 1 ], 1, 0)";
+ shouldBeNonNull(creationString);
+
+ shouldBeTrue("gl.getParameter(gl.RED_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.GREEN_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.BLUE_BITS) >= 8");
+ shouldBeTrue("gl.getParameter(gl.ALPHA_BITS) >= 8");
+ if (depth)
+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) >= 16");
+ else
+ shouldBeTrue("gl.getParameter(gl.DEPTH_BITS) == 0");
+
+ if (stencil)
+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) >= 8");
+ else
+ shouldBeTrue("gl.getParameter(gl.STENCIL_BITS) == 0");
+
+ shouldBeNonNull("contextAttribs = gl.getContextAttributes()");
+ if (!depth && contextAttribs.depth) {
+ testFailed("WebGL implementation provided a depth buffer when it should not have");
+ }
+ if (!contextAttribs.depth)
+ depth = false;
+ if (!stencil && contextAttribs.stencil) {
+ testFailed("WebGL implementation provided a stencil buffer when it should not have");
+ }
+ if (!contextAttribs.stencil)
+ stencil = false;
+
+ gl.depthFunc(gl.ALWAYS);
+
+ gl.stencilFunc(gl.NEVER, 1, 1);
+ gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);
+
+ 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]);
+
+ drawAndReadPixel(gl, vertices, colors, 0, 0);
+ correctColor = (stencil ? [0, 0, 0, 255] : [255, 0, 0, 255]);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, correctColor)
+
+ if (fbHasStencil) {
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ drawAndReadPixel(gl, vertices, colors, 0, 0);
+ wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 0, 255]);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ }
+}
+
+function testAntialias(antialias)
+{
+ debug("Testing antialias = " + antialias);
+ // Both the width and height of canvas are N.
+ var N = 2;
+ if (antialias)
+ shouldBeNonNull("gl = getWebGL(" + N + ", " + N + ", { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0)");
+ else
+ shouldBeNonNull("gl = getWebGL(" + N + ", " + N + ", { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
+ shouldBeNonNull("contextAttribs = gl.getContextAttributes()");
+
+ var vertices = new Float32Array([
+ 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]);
+ drawAndReadPixel(gl, vertices, colors, 0, 0);
+ var 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
+ shouldBeTrue("redChannels[1] == 255 && redChannels[2] == 0");
+ shouldBe("redChannels[0] != 255 && redChannels[0] != 0", "contextAttribs.antialias");
+}
+
+function runTest()
+{
+ // testDefault();
+ // testAlpha(true);
+ // testAlpha(false);
+ // testDepth(true);
+ // testDepth(false);
+ // testStencilAndDepth(true, false);
+ // testStencilAndDepth(false, false);
+ // testStencilAndDepth(true, true);
+ // testStencilAndDepth(false, true);
+ testAntialias(true);
+ //testAntialias(false);
+
+ finishTest();
+}
+
+</script>
+</head>
+<body _onload_="init()">
+<div id="description"></div>
+<div id="console"></div>
+</body>
+</html>
Copied: trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html (from rev 288614, trunk/LayoutTests/webgl/pending/resources/webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html) (0 => 288615)
--- trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html (rev 0)
+++ trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/glsl/misc/shader-with-reserved-words-2.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -0,0 +1,226 @@
+<!--
+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 GLSL Conformance Tests - Non Reserved Words</title>
+<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+</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 MetalWords = [
+ "alignas",
+ "alignof",
+ "as_type",
+ "and",
+ "auto",
+ "catch",
+ "char",
+ "const_cast",
+ "constant",
+ "constexpr",
+ "decltype",
+ "delete",
+ "device",
+ "dynamic_cast",
+ "explicit",
+ "export",
+ "fragment",
+ "friend",
+ "int16_t",
+ "int32_t",
+ "int64_t",
+ "int8_t",
+ "kernel",
+ "main0",
+ "metal",
+ "mutable",
+ "new",
+ "noexcept",
+ "nullptr_t",
+ "nullptr",
+ "operator",
+ "override",
+ "or",
+ "private",
+ "protected",
+ "ptrdiff_t",
+ "ray_data",
+ "register",
+ "signed",
+ "size_t",
+ "stage_in",
+ "static_assert",
+ "static_cast",
+ "thread_local",
+ "thread",
+ "threadgroup_imageblock",
+ "threadgroup",
+ "throw",
+ "try",
+ "typeid",
+ "typename",
+ "uchar",
+ "uint16_t",
+ "uint32_t",
+ "uint64_t",
+ "uint8_t",
+ "ushort",
+ "vertex",
+ "virtual",
+ "wchar_t",
+ "xor",
+ "NAN",
+ "INFINITY",
+ "Pragma",
+ "_Pragma",
+ "ANGLE_1",
+ "INT_MAX",
+];
+
+
+description();
+
+var wtu = WebGLTestUtils;
+var gl = wtu.create3DContext();
+
+var sources = [];
+for (var ii = 0; ii < 4; ++ii) {
+ var vsrc = document.getElementById("vertexShader" + ii).text;
+ var fsrc = document.getElementById("fragmentShader" + ii).text;
+ sources.push({vsrc: vsrc, fsrc: fsrc});
+}
+
+var badWordNdx = 0;
+var listNdx = 0;
+
+function testNextWord() {
+ var list = MetalWords;
+ if (listNdx >= list.length) {
+ finishTest();
+ return;
+ }
+ testWord(list[listNdx]);
+ ++listNdx;
+ setTimeout(testNextWord, 0);
+}
+testNextWord();
+
+function testWord(word) {
+ debug("");
+ debug("testing: " + word);
+
+ sources.forEach(src ="" {
+ var vs = src.vsrc.replace(/\$replaceMe/g, word);
+ var fs = src.fsrc.replace(/\$replaceMe/g, word);
+
+ var success = true;
+ var program = wtu.loadProgram(gl, vs, fs, function(msg) {
+ debug(msg);
+ success = false;
+ }, true);
+ if (success) {
+ testPassed("shader with: '" + word + "' compiled");
+ } else {
+ testFailed("shader with: '" + word + "' 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>
+
+
Copied: trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html (from rev 288614, trunk/LayoutTests/webgl/pending/resources/webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html) (0 => 288615)
--- trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html (rev 0)
+++ trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/glsl/misc/swizzle-as-lvalue.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -0,0 +1,146 @@
+<!--
+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 GLSL Conformance Tests - Swizzle as lvalue</title>
+<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<!--
+Tests swizzle lvalues with out and inout function parameters.
+6.1.1 Function Calling Conventions
+Evaluation of an inout parameter results in both a value and an l-value; the value is copied to
+the formal parameter at call time and the l- value is used to copy out a value when the function
+returns.
+-->
+<script id="fs0" type="text/something-not-_javascript_">
+precision mediump float;
+void f(out $dim v) {
+ v = $ref;
+}
+void main()
+{
+ vec4 i = vec4(10., 11., 12., 13.);
+ f(i.$components);
+ bool correct = false;
+ if (i == $result)
+ correct = true;
+ gl_FragColor = vec4(0, correct ? 1. : 0., 0., 1.);
+}
+</script>
+<script id="fs1" type="text/something-not-_javascript_">
+precision mediump float;
+void f(inout $dim v) {
+ v += $ref;
+}
+void main()
+{
+ vec4 i = vec4(10., 11., 12., 13.);
+ f(i.$components);
+ bool correct = false;
+ if (i == $resultInOut)
+ correct = true;
+ gl_FragColor = vec4(0, correct ? 1. : 0., 0., 1.);
+}
+</script>
+<script>
+"use strict";
+
+description();
+
+// GLSL ES 3.00.6 5.5 Vector Components
+// To form an l-value, swizzling must be applied to an l-value of vector type, contain no duplicate
+// components, and it results in an l-value of scalar or vector type, depending on number of
+// components specified.
+function computeLValueSwizzles() {
+ let results = [];
+ function f(components, swizzle) {
+ for (let c of components) {
+ results.push(swizzle.concat([c]));
+ let rest = components.filter((e) => { return e != c; });
+ if (rest)
+ f(rest, swizzle.concat([c]));
+ }
+ }
+ f([0, 1, 2, 3], []);
+ return results;
+}
+
+var swizzles = computeLValueSwizzles();
+
+// Sanity check that computing the swizzles produces something to test.
+shouldBe("swizzles.length", "64");
+shouldBe("components(swizzles[0])", "'r'");
+shouldBe("components(swizzles[swizzles.length - 1])", "'abgr'");
+
+var refValue = [ "1.", "2.", "3.", "4." ];
+
+var init = [ "10.", "11.", "12.", "13." ];
+
+function dim(swizzle) {
+ if (swizzle.length == 1)
+ return 'float'
+ return `vec${swizzle.length}`;
+}
+
+function result(swizzle) {
+ let a = init.map((e, c) => {
+ if (swizzle.includes(c))
+ return refValue[c];
+ return e;
+ });
+ return `vec4(${a.join(', ')})`;
+}
+
+function resultInOut(swizzle) {
+ let a = init.map((e, c) => {
+ if (swizzle.includes(c))
+ return `${e} + ${refValue[c]}`;
+ return e;
+ });
+ return `vec4(${a.join(', ')})`;
+}
+
+function ref(swizzle) {
+ let a = swizzle.map((c) => { return refValue[c]; });
+ return `${dim(swizzle)}(${a.join(', ')})`;
+}
+
+function components(swizzle) {
+ return swizzle.map((e) => { return 'rgba'[e]; }).join('');
+}
+
+var tests = [];
+for (var swizzle of swizzles) {
+ for (var ii = 0; ii < 2; ++ii) {
+ var fsrc = document.getElementById("fs" + ii).text;
+ fsrc = fsrc.replace(/\$dim/g, dim(swizzle))
+ .replace(/\$resultInOut/g, resultInOut(swizzle))
+ .replace(/\$result/g, result(swizzle))
+ .replace(/\$ref/g, ref(swizzle))
+ .replace(/\$components/g, components(swizzle));
+ tests.push({
+ fShaderSource: fsrc,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: `Swizzle as lvalue works, func: ${ii}, swizzle: ${components(swizzle)}`
+ });
+ }
+}
+
+GLSLConformanceTester.runRenderTests(tests);
+</script>
+</body>
+</html>
Copied: trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html (from rev 288614, trunk/LayoutTests/webgl/pending/resources/webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html) (0 => 288615)
--- trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html (rev 0)
+++ trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance/textures/misc/tex-image-video-repeated.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -0,0 +1,108 @@
+<!--
+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=""
+<script src=""
+<script src=""
+<script>
+"use strict";
+var wtu = WebGLTestUtils;
+var gl = null;
+var textureLoc = null;
+var successfullyParsed = false;
+var blue = [0, 0, 248];
+var yellow = [255, 255, 0];
+var black = [0, 0, 0];
+initTestingHarness();
+
+function init()
+{
+ description('Verify optimization of repeated uploads of HTMLVideoElement to a texture');
+
+ const canvas = document.getElementById("example");
+ gl = wtu.create3DContext(canvas, { antialias: false, depth: false });
+ const program = wtu.setupTexturedQuad(gl);
+ gl.clearColor(0,0,0,1);
+ gl.clearDepth(1);
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+ const textureLoc = gl.getUniformLocation(program, "tex");
+ gl.uniform1i(textureLoc, 0);
+ gl.viewport(0, 0, canvas.width, canvas.height);
+
+ const video1 = document.getElementById("video1");
+ const video2 = document.getElementById("video2");
+ wtu.startPlayingAndWaitForVideo(video1, (video) => {
+ wtu.startPlayingAndWaitForVideo(video2, (video) => {
+ runTest(video1, video2);
+ });
+ });
+}
+
+function checkFramebufferHasVideo2(gl)
+{
+ const leftColor = blue;
+ const rightColor = yellow;
+ const tolerance = 5;
+ debug("Checking mid left border");
+ wtu.checkCanvasRect(gl, 4, 20, 2, 2, leftColor, "shouldBe " + leftColor, tolerance);
+ debug("Checking mid right border");
+ wtu.checkCanvasRect(gl, gl.canvas.width - 4, gl.canvas.height - 20, 2, 2, rightColor, "shouldBe " + rightColor, tolerance);
+}
+
+function testTwoTexturesBug1(video1, video2)
+{
+ debug("Testing uploading same video to two different textures does not skip the latter upload")
+ const textures = [gl.createTexture(), gl.createTexture()];
+ // Initialize texture[0] to some specific content that fails the test.
+ // Initialization is done with video to exercise the video content identification
+ // algorithm.
+ gl.bindTexture(gl.TEXTURE_2D, textures[0]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video1);
+
+ // Try to fool the video content identification algorithm by first uploading
+ // the passing content to some other, untested texture.
+ gl.bindTexture(gl.TEXTURE_2D, textures[1]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video2);
+
+ // Update texture[0] to some content that passes the test.
+ gl.bindTexture(gl.TEXTURE_2D, textures[0]);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video2);
+
+ // Verify that the texture[0] received the new content.
+ 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.clearAndDrawUnitQuad(gl, [255, 0, 0, 255]);
+ checkFramebufferHasVideo2(gl);
+}
+
+function runTest(video1, video2)
+{
+ testTwoTexturesBug1(video1, video2);
+ 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="video1" >
+ <source src="" type='video/mp4; codecs="avc1.42E01E"' />
+ <source src="" type='video/webm; codecs="vp8"' />
+ <source src="" type='video/ogg; codecs="theora"' />
+</video>
+<video id="video2" >
+ <source src="" type='video/mp4; codecs="avc1.42E01E"' />
+ </video>
+</body>
+</html>
Copied: trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance2/glsl3/empty-shader-with-output.html (from rev 288614, trunk/LayoutTests/webgl/pending/resources/webgl_test_files/conformance2/glsl3/empty-shader-with-output.html) (0 => 288615)
--- trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance2/glsl3/empty-shader-with-output.html (rev 0)
+++ trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance2/glsl3/empty-shader-with-output.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -0,0 +1,93 @@
+<!--
+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 GLSL Conformance Tests - Empty Shader as Output</title>
+<link rel="stylesheet" href=""
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<!--
+Test that an empty vertex shader and fragment shader compile.
+-->
+<script id="fs0" type="text/something-not-_javascript_">#version 300 es
+precision mediump float;
+out vec4 outColor0;
+void main()
+{
+}
+</script>
+
+<script id="fs1" type="text/something-not-_javascript_">#version 300 es
+precision mediump float;
+void main()
+{
+}
+</script>
+
+<script id="vs2" type="text/something-not-_javascript_">#version 300 es
+precision mediump float;
+void main()
+{
+}
+</script>
+<script id="fs2" type="text/something-not-_javascript_">#version 300 es
+precision mediump float;
+out vec4 outColor0;
+void main()
+{
+ outColor0 = vec4(0,255,0,255);
+}
+</script>
+
+<script>
+"use strict";
+
+description();
+
+var tests = [];
+var fsrc = document.getElementById("fs0").text;
+tests.push({
+ fShaderSource: fsrc,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ renderColor: [255, 255, 255, 255],
+ passMsg:`Empty fragment shader with colorOut works`
+})
+
+var fsrc1 = document.getElementById("fs1").text;
+tests.push({
+ fShaderSource: fsrc1,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ renderColor: [255, 255, 255, 255],
+ passMsg: `Empty fragment shader with no output works`
+})
+
+var vsrc2 = document.getElementById("vs2").text;
+var fsrc2 = document.getElementById("fs2").text;
+tests.push({
+ vShaderSource: vsrc2,
+ vShaderSuccess: true,
+ fShaderSource: fsrc2,
+ fShaderSuccess: true,
+ linkSuccess: true,
+ renderColor: [255, 255, 255, 255],
+ passMsg: `Empty Vertex shader works`
+})
+
+GLSLConformanceTester.runRenderTests(tests, 2);
+</script>
+</body>
+</html>
Copied: trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance2/glsl3/float-constant-expressions.html (from rev 288614, trunk/LayoutTests/webgl/pending/resources/webgl_test_files/conformance2/glsl3/float-constant-expressions.html) (0 => 288615)
--- trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance2/glsl3/float-constant-expressions.html (rev 0)
+++ trunk/LayoutTests/webgl/resources/pending_webgl_test_files/conformance2/glsl3/float-constant-expressions.html 2022-01-26 14:11:03 UTC (rev 288615)
@@ -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>Float constant _expression_ corner cases</title>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script id="fshaderPositiveDivisionByZeroIsInfinite" type="x-shader/x-fragment">#version 300 es
+precision highp float;
+out vec4 my_FragColor;
+uniform float u; // Assumed to have the default value 0.0
+void main()
+{
+ // Positive non-zero division by zero should produce infinity.
+ // GLSL ES 3.00.6 4.5.1 Range and Precision
+ // "However, dividing a non-zero by 0 results in the appropriately signed IEEE Inf:
+ // If both positive and negative zeros are implemented, the correctly signed Inf will be
+ // generated, otherwise positive Inf is generated."
+ float f = 1. / 0.;
+ f = u == 0. ? f : 1.;
+ bool correct = isinf(f) && sign(f) > 0.;
+ my_FragColor = vec4(0.0, correct ? 1. : 0., 0.0, 1.0);
+}
+</script>
+<script id="fshaderNegativeDivisionByZeroIsInfinite" type="x-shader/x-fragment">#version 300 es
+precision highp float;
+out vec4 my_FragColor;
+uniform float u; // Assumed to have the default value 0.0
+void main()
+{
+ // Negative non-zero division by zero should produce negative infinity if supported,
+ // othervies infinity.
+ // GLSL ES 3.00.6 4.5.1 Range and Precision
+ // "However, dividing a non-zero by 0 results in the appropriately signed IEEE Inf:
+ // If both positive and negative zeros are implemented, the correctly signed Inf will be
+ // generated, otherwise positive Inf is generated."
+ float f = -1. / 0.;
+ f = u == 0. ? f : 1.;
+ bool supportsNegativeZeros = sign(-0.) < 0.;
+ bool correct = isinf(f) && (sign(f) < 0. || !supportsNegativeZeros);
+ my_FragColor = vec4(0., correct ? 1. : 0., 0., 1.);
+}
+</script>
+
+<script id="fshaderZeroDivisionByZeroIsNan" type="x-shader/x-fragment">#version 300 es
+precision highp float;
+out vec4 my_FragColor;
+uniform float u; // Assumed to have the default value 0.0
+void main()
+{
+ // Non-zero division by zero should produce infinity.
+ // GLSL ES 3.00.6 4.5.1 Range and Precision
+ // "NaNs are not required to be generated. Support for signaling NaNs is not required and
+ // exceptions are never raised. Operations and built-in functions that operate on a NaN are not
+ // required to return a NaN as the result. However if NaNs are generated, isnan() should return
+ // the correct value."
+ float f = 0. / 0.;
+ f = u == 0. ? f : 1.;
+ bool nanWasGenerated = !(f <= 0. || 0. <= f);
+ bool correct = isnan(f) || !nanWasGenerated;
+ my_FragColor = vec4(0., correct ? 1. : 0., 0., 1.);
+}
+</script>
+
+<script type="text/_javascript_">
+"use strict";
+description();
+
+GLSLConformanceTester.runRenderTests([
+{
+ fShaderId: 'fshaderPositiveDivisionByZeroIsInfinite',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Positive floats divided by zero should produce infinity."
+},
+{
+ fShaderId: 'fshaderNegativeDivisionByZeroIsInfinite',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Negative floats divided by zero should produce infinity of correct sign."
+},
+{
+ fShaderId: 'fshaderZeroDivisionByZeroIsNan',
+ fShaderSuccess: true,
+ linkSuccess: true,
+ passMsg: "Float zero divided by zero should maybe produce NaN."
+}
+], 2);
+</script>
+</body>
+</html>