tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ext-float-blend.html (3389B)


      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.");
     17 
     18 var wtu = WebGLTestUtils;
     19 var canvas = document.getElementById("canvas");
     20 var gl = wtu.create3DContext(canvas);
     21 var ext = null;
     22 
     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);
     29 
     30    const floatBlend = gl.getExtension("EXT_float_blend");
     31    if (!floatBlend) {
     32        testPassed("EXT_float_blend is allowed to be missing.");
     33        return;
     34    }
     35 
     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);
     41 }
     42 
     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;
     49        }
     50 
     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;
     55        }
     56 
     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.");
     60        }
     61 
     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.");
     67        }
     68 
     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;
     78        }
     79 
     80        const internalFormat = gl.RGBA32F;
     81        extFloatBlendTests(2, {
     82            internalFormat
     83        });
     84    }
     85 })();
     86 
     87 debug("");
     88 var successfullyParsed = true;
     89 </script>
     90 <script src="../../js/js-test-post.js"></script>
     91 
     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 -->