diff --git a/sdk/tests/conformance2/wasm/00_test_list.txt b/sdk/tests/conformance2/wasm/00_test_list.txt index d188fc30a..fe31a7e18 100644 --- a/sdk/tests/conformance2/wasm/00_test_list.txt +++ b/sdk/tests/conformance2/wasm/00_test_list.txt @@ -1,12 +1,18 @@ ---min-version 2.0.1 readpixels-16gb-wasm-memory.html ---min-version 2.0.1 readpixels-4gb-wasm-memory.html ---min-version 2.0.1 teximage2d-16gb-wasm-memory.html ---min-version 2.0.1 teximage2d-4gb-wasm-memory.html ---min-version 2.0.1 texsubimage2d-16gb-wasm-memory.html ---min-version 2.0.1 texsubimage2d-4gb-wasm-memory.html ---min-version 2.0.1 bufferdata-16gb-wasm-memory.html +--min-version 2.0.1 bufferdata-2gb-in-4gb-wasm-memory.html --min-version 2.0.1 bufferdata-4gb-wasm-memory.html ---min-version 2.0.1 buffersubdata-16gb-wasm-memory.html +--min-version 2.0.1 bufferdata-16gb-wasm-memory.html +--min-version 2.0.1 buffersubdata-2gb-in-4gb-wasm-memory.html --min-version 2.0.1 buffersubdata-4gb-wasm-memory.html +--min-version 2.0.1 buffersubdata-16gb-wasm-memory.html +--min-version 2.0.1 getbuffersubdata-2gb-in-4gb-wasm-memory.html +--min-version 2.0.1 getbuffersubdata-4gb-wasm-memory.html --min-version 2.0.1 getbuffersubdata-16gb-wasm-memory.html ---min-version 2.0.1 getbuffersubdata-4gb-wasm-memory.html \ No newline at end of file +--min-version 2.0.1 readpixels-2gb-in-4gb-wasm-memory.html +--min-version 2.0.1 readpixels-4gb-wasm-memory.html +--min-version 2.0.1 readpixels-16gb-wasm-memory.html +--min-version 2.0.1 teximage2d-2gb-in-4gb-wasm-memory.html +--min-version 2.0.1 teximage2d-4gb-wasm-memory.html +--min-version 2.0.1 teximage2d-16gb-wasm-memory.html +--min-version 2.0.1 texsubimage2d-2gb-in-4gb-wasm-memory.html +--min-version 2.0.1 texsubimage2d-4gb-wasm-memory.html +--min-version 2.0.1 texsubimage2d-16gb-wasm-memory.html diff --git a/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html index 0dd21bf64..ca4d494e5 100644 --- a/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html @@ -19,30 +19,42 @@ diff --git a/sdk/tests/conformance2/wasm/bufferdata-2gb-in-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/bufferdata-2gb-in-4gb-wasm-memory.html new file mode 100644 index 000000000..cfe484e62 --- /dev/null +++ b/sdk/tests/conformance2/wasm/bufferdata-2gb-in-4gb-wasm-memory.html @@ -0,0 +1,64 @@ + + + + + +bufferData test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/sdk/tests/conformance2/wasm/bufferdata-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/bufferdata-4gb-wasm-memory.html index 2296c3a5e..62d468b02 100644 --- a/sdk/tests/conformance2/wasm/bufferdata-4gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/bufferdata-4gb-wasm-memory.html @@ -19,30 +19,42 @@ diff --git a/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html index 08d6d1df5..7ce95d8e3 100644 --- a/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html @@ -19,31 +19,43 @@ diff --git a/sdk/tests/conformance2/wasm/buffersubdata-2gb-in-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/buffersubdata-2gb-in-4gb-wasm-memory.html new file mode 100644 index 000000000..ab6fd84ff --- /dev/null +++ b/sdk/tests/conformance2/wasm/buffersubdata-2gb-in-4gb-wasm-memory.html @@ -0,0 +1,65 @@ + + + + + +bufferSubData test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/sdk/tests/conformance2/wasm/buffersubdata-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/buffersubdata-4gb-wasm-memory.html index 2834a6901..c25200e1e 100644 --- a/sdk/tests/conformance2/wasm/buffersubdata-4gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/buffersubdata-4gb-wasm-memory.html @@ -19,31 +19,43 @@ diff --git a/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html index 8390957b0..724a9bfa1 100644 --- a/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html @@ -19,27 +19,40 @@ diff --git a/sdk/tests/conformance2/wasm/getbuffersubdata-2gb-in-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/getbuffersubdata-2gb-in-4gb-wasm-memory.html new file mode 100644 index 000000000..91ad7653d --- /dev/null +++ b/sdk/tests/conformance2/wasm/getbuffersubdata-2gb-in-4gb-wasm-memory.html @@ -0,0 +1,62 @@ + + + + + +getBufferSubData test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/sdk/tests/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html index 09a336b75..90c9b6610 100644 --- a/sdk/tests/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/getbuffersubdata-4gb-wasm-memory.html @@ -19,27 +19,40 @@ diff --git a/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html index af74678dd..21c65a2c7 100644 --- a/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html @@ -20,30 +20,41 @@ "use strict"; description(document.title); debug(""); -debug("Tests that gl.readPixels() can be called on WebAssembly Memory of 16GB in size."); +debug("Tests that readPixels can be called on the end of a WebAssembly Memory of 16GB in size."); debug(""); let wtu = WebGLTestUtils; let gl = wtu.create3DContext("canvas", undefined, 2); const PAGE = 65536; const SIZE = 16*1024*1024*1024; -let view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE/PAGE }).buffer); +(() => { + let view; + try { + view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer); + } catch (e) { + testPassed(`Allocating ${SIZE} threw: ${e}`); + return; + } -// Clear the canvas to a specific color -const expectedColor = [42, 84, 128, 255]; -gl.clearColor(expectedColor[0]/255.0, expectedColor[1]/255.0, expectedColor[2]/255.0, expectedColor[3]/255.0); -gl.clear(gl.COLOR_BUFFER_BIT); + // Clear the canvas to a specific color + const expectedColor = [42, 84, 128, 255]; + gl.clearColor(expectedColor[0]/255.0, expectedColor[1]/255.0, expectedColor[2]/255.0, expectedColor[3]/255.0); + gl.clear(gl.COLOR_BUFFER_BIT); + + // Test that gl.readPixels() can be called with a high offset to Memory + const offset = SIZE - 4; + view.set([0,0,0,0], offset); // For good measure, clear data at offset before reading + try { + gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, view, offset); + } catch (e) { + testFailed(`readPixels from ${view.length} byte view threw: ${e}`); + return; + } + wtu.glErrorShouldBe(gl, gl.NO_ERROR); + let obtainedColor = view.subarray(offset, offset+4); + expectArray(obtainedColor, expectedColor); +})(); -// Test that gl.readPixels() can be called with a high offset to Memory -const offset = SIZE - 4; -view.set([0,0,0,0], offset); // For good measure, clear data at offset before reading -gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, view, offset); -wtu.glErrorShouldBe(gl, gl.NO_ERROR); -let obtainedColor = view.subarray(offset, offset+4); -shouldBe('obtainedColor[0]', 'expectedColor[0]'); -shouldBe('obtainedColor[1]', 'expectedColor[1]'); -shouldBe('obtainedColor[2]', 'expectedColor[2]'); -shouldBe('obtainedColor[3]', 'expectedColor[3]'); var successfullyParsed = true; diff --git a/sdk/tests/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html new file mode 100644 index 000000000..175d07cef --- /dev/null +++ b/sdk/tests/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html @@ -0,0 +1,62 @@ + + + + + +gl.readPixels() test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/sdk/tests/conformance2/wasm/readpixels-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/readpixels-4gb-wasm-memory.html index f97a3ccba..c9fe15476 100644 --- a/sdk/tests/conformance2/wasm/readpixels-4gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/readpixels-4gb-wasm-memory.html @@ -19,30 +19,41 @@ diff --git a/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html index 8ce511195..0f39e2ceb 100644 --- a/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html @@ -19,65 +19,79 @@ diff --git a/sdk/tests/conformance2/wasm/teximage2d-2gb-in-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/teximage2d-2gb-in-4gb-wasm-memory.html new file mode 100644 index 000000000..dc1d1277a --- /dev/null +++ b/sdk/tests/conformance2/wasm/teximage2d-2gb-in-4gb-wasm-memory.html @@ -0,0 +1,101 @@ + + + + + +gl.texImage2D() test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/sdk/tests/conformance2/wasm/teximage2d-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/teximage2d-4gb-wasm-memory.html index 5d6897347..ccd2a4a8f 100644 --- a/sdk/tests/conformance2/wasm/teximage2d-4gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/teximage2d-4gb-wasm-memory.html @@ -19,65 +19,80 @@ diff --git a/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html index 328d42ec4..7266e88f4 100644 --- a/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html @@ -19,66 +19,80 @@ diff --git a/sdk/tests/conformance2/wasm/texsubimage2d-2gb-in-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/texsubimage2d-2gb-in-4gb-wasm-memory.html new file mode 100644 index 000000000..92901ff6a --- /dev/null +++ b/sdk/tests/conformance2/wasm/texsubimage2d-2gb-in-4gb-wasm-memory.html @@ -0,0 +1,101 @@ + + + + + +gl.texSubImage2D() test to Wasm Memory 4GB in size. + + + + + + +
+
+ + + + diff --git a/sdk/tests/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html b/sdk/tests/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html index d7756629a..4d5ffd1c9 100644 --- a/sdk/tests/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/texsubimage2d-4gb-wasm-memory.html @@ -19,66 +19,80 @@