Backed out changeset b462e7b742d8 (bug 1908261) for causing multiple reftest failures...
[gecko.git] / dom / canvas / test / webgl-conf / checkout / conformance / extensions / ext-float-blend.html
bloba825d78bef6e9c891784cd5a3814f150d52f911e
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>WebGL EXT_float_blend Conformance Tests</title>
6 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
7 <script src="../../js/js-test-pre.js"></script>
8 <script src="../../js/webgl-test-utils.js"></script>
9 <script src="../../js/tests/ext-float-blend.js"></script>
10 </head>
11 <body>
12 <div id="description"></div>
13 <div id="console"></div>
14 <script>
15 "use strict";
16 description("This test verifies the functionality of the EXT_float_blend extension, if it is available.");
18 var wtu = WebGLTestUtils;
19 var canvas = document.getElementById("canvas");
20 var gl = wtu.create3DContext(canvas);
21 var ext = null;
23 function extFloatBlendTests(version, config) {
24 debug("");
25 debug("Testing float32 blending without EXT_float_blend");
26 testExtFloatBlend(config.internalFormat);
27 testExtFloatBlendMRT(version, config.drawBuffers);
28 testExtFloatBlendNonFloat32Type(version, config.oesTextureHalfFloat);
30 const floatBlend = gl.getExtension("EXT_float_blend");
31 if (!floatBlend) {
32 testPassed("EXT_float_blend is allowed to be missing.");
33 return;
36 debug("");
37 debug("Testing that float32 blending is allowed with EXT_float_blend");
38 testExtFloatBlend(config.internalFormat);
39 testExtFloatBlendMRT(version, config.drawBuffers);
40 testExtFloatBlendNonFloat32Type(version, config.oesTextureHalfFloat);
43 (function(){
44 if (wtu.getDefault3DContextVersion() < 2) {
45 const oesTextureFloat = gl.getExtension("OES_texture_float");
46 if (!oesTextureFloat) {
47 testPassed("OES_texture_float is allowed to be missing.");
48 return;
51 const colorBufferFloat = gl.getExtension("WEBGL_color_buffer_float");
52 if (!colorBufferFloat) {
53 testPassed("WEBGL_color_buffer_float is allowed to be missing.");
54 return;
57 const drawBuffers = gl.getExtension("WEBGL_draw_buffers");
58 if (!drawBuffers) {
59 debug("WEBGL_draw_buffers is allowed to be missing. MRT tests will be skipped.");
62 const oesTextureHalfFloat = gl.getExtension("OES_texture_half_float");
63 const extColorBufferHalfFloat = gl.getExtension("EXT_color_buffer_half_float");
64 const testHalfFloat = !(!oesTextureHalfFloat || !extColorBufferHalfFloat);
65 if (!testHalfFloat) {
66 debug("OES_texture_half_float or EXT_color_buffer_half_float is allowed to be missing. NonFloat32Type tests will be skipped.");
69 const internalFormat = gl.RGBA;
70 extFloatBlendTests(1, {
71 internalFormat, drawBuffers, oesTextureHalfFloat
72 });
73 } else {
74 const colorBufferFloat = gl.getExtension("EXT_color_buffer_float");
75 if (!colorBufferFloat) {
76 testPassed("EXT_color_buffer_float is allowed to be missing.");
77 return;
80 const internalFormat = gl.RGBA32F;
81 extFloatBlendTests(2, {
82 internalFormat
83 });
85 })();
87 debug("");
88 var successfullyParsed = true;
89 </script>
90 <script src="../../js/js-test-post.js"></script>
92 </body>
93 </html>
94 <!--
95 Copyright (c) 2019 The Khronos Group Inc.
96 Use of this source code is governed by an MIT-style license that can be
97 found in the LICENSE.txt file.
98 -->