aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-05-21 17:10:24 -0400
committerGitHub <noreply@github.com>2019-05-21 17:10:24 -0400
commit123f58592c9bedae735a84fe5c93b0a20292ea86 (patch)
tree88a191c94b97aff6cf47758b3113266387f9c127 /tests
parentcde3ecf64091e56d761697d0a798da5b2d2ca352 (diff)
parent7f0b820d4ee87351aba9e7c785a704c6c83f135f (diff)
downloadservo-123f58592c9bedae735a84fe5c93b0a20292ea86.tar.gz
servo-123f58592c9bedae735a84fe5c93b0a20292ea86.zip
Auto merge of #23226 - mmatyas:webgl_compressed_textures, r=jdm
Add initial support for WebGL compressed textures This patch is an initial implementation of WebGL compressed texture support, it contains - functions for registering and querying compressed texture extensions - initial implementation of `CompressedTexImage2D` and `CompressedTexSubImage2D` and their parameter validation - implementation of S3TC (DXT1, DXT3, DXT5) and ETC1 extensions as examples What's still missing: - some of the parameter validation steps are missing - the pixel comparison tests fail for more complex cases (I'm probably missing something trivial at the GL calls) Related: #10209 and #20594 cc @jdm @zakorgy --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] Related issues: #10209, #20594 - [x] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23226) <!-- Reviewable:end -->
Diffstat (limited to 'tests')
-rw-r--r--tests/wpt/webgl/meta/MANIFEST.json6
-rw-r--r--tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html15
-rw-r--r--tests/wpt/webgl/tools/compressed-images.patch32
-rwxr-xr-xtests/wpt/webgl/tools/import-conformance-tests.py1
-rw-r--r--tests/wpt/webgl/tools/timeout.patch12
5 files changed, 57 insertions, 9 deletions
diff --git a/tests/wpt/webgl/meta/MANIFEST.json b/tests/wpt/webgl/meta/MANIFEST.json
index ccf761ac8a9..752c28611b4 100644
--- a/tests/wpt/webgl/meta/MANIFEST.json
+++ b/tests/wpt/webgl/meta/MANIFEST.json
@@ -10888,7 +10888,9 @@
"conformance/extensions/webgl-compressed-texture-s3tc.html": [
[
"conformance/extensions/webgl-compressed-texture-s3tc.html",
- {}
+ {
+ "timeout": "long"
+ }
]
],
"conformance/extensions/webgl-compressed-texture-size-limit.html": [
@@ -27817,7 +27819,7 @@
"testharness"
],
"conformance/extensions/webgl-compressed-texture-s3tc.html": [
- "28e3cfc5628760d1ae27166612f17ed46fa12b88",
+ "ea56180224af7537748a649a724563a86c431710",
"testharness"
],
"conformance/extensions/webgl-compressed-texture-size-limit.html": [
diff --git a/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html b/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
index 28e3cfc5628..ea56180224a 100644
--- a/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
+++ b/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
@@ -29,6 +29,7 @@
<html>
<head>
<meta charset="utf-8">
+<meta name="timeout" content="long">
<link rel="stylesheet" href="../../resources/js-test-style.css"/>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
@@ -694,13 +695,6 @@ function compareRect(width, height, channels, expectedData, filteringMode) {
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";
- insertImg(div, "expected", makeImage(width, height, expectedData, channels == 4));
- insertImg(div, "actual", makeImage(width, height, actual, channels == 4));
- 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) {
@@ -714,6 +708,13 @@ function compareRect(width, height, channels, expectedData, filteringMode) {
for (var jj = 0; jj < 4; ++jj) {
if (actual[offset + jj] != expected[jj]) {
failed = true;
+ var div = document.createElement("div");
+ div.className = "testimages";
+ insertImg(div, "expected", makeImage(width, height, expectedData, channels == 4));
+ insertImg(div, "actual", makeImage(width, height, actual, channels == 4));
+ div.appendChild(document.createElement('br'));
+ document.getElementById("console").appendChild(div);
+
var was = actual[offset + 0].toString();
for (var j = 1; j < 4; ++j) {
was += "," + actual[offset + j];
diff --git a/tests/wpt/webgl/tools/compressed-images.patch b/tests/wpt/webgl/tools/compressed-images.patch
new file mode 100644
index 00000000000..d403b7d7cf5
--- /dev/null
+++ b/tests/wpt/webgl/tools/compressed-images.patch
@@ -0,0 +1,32 @@
+diff --git a/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html b/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
+index 308e8577a8..ea56180224 100644
+--- a/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
++++ b/tests/wpt/webgl/tests/conformance/extensions/webgl-compressed-texture-s3tc.html
+@@ -695,13 +695,6 @@ function compareRect(width, height, channels, expectedData, filteringMode) {
+ 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";
+- insertImg(div, "expected", makeImage(width, height, expectedData, channels == 4));
+- insertImg(div, "actual", makeImage(width, height, actual, channels == 4));
+- 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) {
+@@ -715,6 +708,13 @@ function compareRect(width, height, channels, expectedData, filteringMode) {
+ for (var jj = 0; jj < 4; ++jj) {
+ if (actual[offset + jj] != expected[jj]) {
+ failed = true;
++ var div = document.createElement("div");
++ div.className = "testimages";
++ insertImg(div, "expected", makeImage(width, height, expectedData, channels == 4));
++ insertImg(div, "actual", makeImage(width, height, actual, channels == 4));
++ div.appendChild(document.createElement('br'));
++ document.getElementById("console").appendChild(div);
++
+ var was = actual[offset + 0].toString();
+ for (var j = 1; j < 4; ++j) {
+ was += "," + actual[offset + j];
diff --git a/tests/wpt/webgl/tools/import-conformance-tests.py b/tests/wpt/webgl/tools/import-conformance-tests.py
index 58afe1ddc77..9440abab4d0 100755
--- a/tests/wpt/webgl/tools/import-conformance-tests.py
+++ b/tests/wpt/webgl/tools/import-conformance-tests.py
@@ -15,6 +15,7 @@ PATCHES = [
("unit.patch", "conformance/more/unit.js"),
("timeout.patch", None),
("set-zero-timeout.patch", "js/webgl-test-utils.js"),
+ ("compressed-images.patch", "conformance/extensions/webgl-compressed-texture-s3tc.html"),
]
# Fix for 'UnicodeDecodeError: 'ascii' codec can't decode byte'
diff --git a/tests/wpt/webgl/tools/timeout.patch b/tests/wpt/webgl/tools/timeout.patch
index b5284094e52..89bf21807bc 100644
--- a/tests/wpt/webgl/tools/timeout.patch
+++ b/tests/wpt/webgl/tools/timeout.patch
@@ -92,3 +92,15 @@ index c1542f4fa9..b3ee786e0b 100644
<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"/>
+diff --git i/conformance/extensions/webgl-compressed-texture-s3tc.html w/conformance/extensions/webgl-compressed-texture-s3tc.html
+index 28e3cfc562..308e8577a8 100644
+--- i/conformance/extensions/webgl-compressed-texture-s3tc.html
++++ w/conformance/extensions/webgl-compressed-texture-s3tc.html
+@@ -29,6 +29,7 @@
+ <html>
+ <head>
+ <meta charset="utf-8">
++<meta name="timeout" content="long">
+ <link rel="stylesheet" href="../../resources/js-test-style.css"/>
+ <script src=/resources/testharness.js></script>
+ <script src=/resources/testharnessreport.js></script>