summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html
index df10edb4d3..760bc6bd19 100644
--- a/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html
+++ b/dom/canvas/test/webgl-conf/checkout/conformance2/textures/misc/tex-new-formats.html
@@ -37,6 +37,7 @@ if (!gl) {
testPassed("WebGL context exists");
runTexFormatsTest();
+ runDepthStencilFormatTest();
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "there should be no errors");
}
@@ -556,6 +557,35 @@ function runTexFormatsTest()
});
}
+function runDepthStencilFormatTest() {
+ debug("");
+ debug("Testing FLOAT_32_UNSIGNED_INT_24_8_REV with data");
+ const fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+
+ const tex2D = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, tex2D);
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH32F_STENCIL8, 1, 1, 0, gl.DEPTH_STENCIL, gl.FLOAT_32_UNSIGNED_INT_24_8_REV, new Uint8Array(8));
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.TEXTURE_2D, tex2D, 0);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ testFailed("2D texture with invalid type was created");
+ } else {
+ testPassed("2D texture with invalid type was not created")
+ }
+
+ const tex3D = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, tex3D);
+ gl.texImage3D(gl.TEXTURE_2D_ARRAY, 0, gl.DEPTH32F_STENCIL8, 1, 1, 1, 0, gl.DEPTH_STENCIL, gl.FLOAT_32_UNSIGNED_INT_24_8_REV, new Uint8Array(8));
+ wtu.glErrorShouldBe(gl, gl.INVALID_OPERATION);
+ gl.framebufferTextureLayer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, tex3D, 0, 0);
+ if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE) {
+ testFailed("2D array texture with invalid type was created");
+ } else {
+ testPassed("2D array texture with invalid type was not created")
+ }
+}
+
debug("");
var successfullyParsed = true;
</script>