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.
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>
16 <div id=
"description"></div>
17 <div id=
"console"></div>
21 const wtu
= WebGLTestUtils
;
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.
48 const has_etc1
= hasExt('WEBGL_compressed_texture_etc1');
49 debug(`has_etc1: ${has_etc1}`);
50 shouldBeTrue("has_etc1 == has_etc");
53 var successfullyParsed
= true;
56 <script src=
"../../js/js-test-post.js"></script>