Backed out changeset 7272b7396c78 (bug 1932758) for causing fenix debug failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance2 / extensions / required-extensions.html
blobc3de2a5677776ff9a2371d1e7af61ebec14f700f
1 <!--
2 Copyright (c) 2021 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
5 -->
7 <!DOCTYPE html>
8 <html>
9 <head>
10 <meta charset="utf-8">
11 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
12 <script src="../../js/js-test-pre.js"></script>
13 <script src="../../js/webgl-test-utils.js"></script>
14 </head>
15 <body>
16 <div id="description"></div>
17 <div id="console"></div>
19 <script>
20 "use strict";
21 const wtu = WebGLTestUtils;
22 let gl;
24 description("Ensure that required extensions are supported");
26 shouldBeNonNull("gl = wtu.create3DContext(undefined, undefined, 2)");
28 const supportedExts = gl.getSupportedExtensions();
30 function hasExt(name) {
31 return supportedExts.indexOf(name) >= 0;
34 const has_s3tc = hasExt('WEBGL_compressed_texture_s3tc');
35 const has_s3tc_srgb = hasExt('WEBGL_compressed_texture_s3tc_srgb');
36 const has_rgtc = hasExt('EXT_texture_compression_rgtc');
37 const has_etc = hasExt('WEBGL_compressed_texture_etc');
39 debug(`has_s3tc: ${has_s3tc}`);
40 debug(`has_s3tc_srgb: ${has_s3tc_srgb}`);
41 debug(`has_rgtc: ${has_rgtc}`);
42 debug(`has_etc: ${has_etc}`);
44 shouldBeTrue("((has_s3tc && has_s3tc_srgb && has_rgtc) || has_etc)");
46 // ETC1 extension must not be exposed on WebGL 2.0 contexts without ETC2.
47 debug("");
48 const has_etc1 = hasExt('WEBGL_compressed_texture_etc1');
49 debug(`has_etc1: ${has_etc1}`);
50 shouldBeTrue("has_etc1 == has_etc");
52 debug("");
53 var successfullyParsed = true;
54 </script>
56 <script src="../../js/js-test-post.js"></script>
57 </body>
58 </html>