Add initial support for WebGL compressed textures

This commit is contained in:
Mátyás Mustoha 2019-03-25 12:50:45 +01:00 committed by Josh Matthews
parent a14b952fa3
commit 7f0b820d4e
16 changed files with 792 additions and 37 deletions

View file

@ -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": [

View file

@ -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];

View file

@ -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];

View file

@ -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'

View file

@ -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>